jed-users mailing list

[2016 Date Index] [2016 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: [jed-users] Suggestion for the replace-function


On 20.09.16, Manfred Hanke wrote:

> assuming that you use the emacs keybinding Alt + % (or ESC, %),
> you probably need something like this in your ~/.jedrc:
> > unsetkey("\e%");
> > setkey("push_spot;replace_cmd;pop_spot", "\e%");

Actually, "unsetkey" is not required here, as the "setkey" overwrites the
old binding.

(Unsetkey is required, if you want a longer key-combination, e.g.

 unsetkey("\e%");
 setkey("push_spot;replace_cmd;pop_spot", "\e%a");
 setkey("replace_cmd", "\e%b");

)

> Although I have to admit that I'm never sure about the difference
> between setkey and definekey, I found the following to work for me
> at runtime (pasted as an S-Lang command, i.e., via Alt + Shift + X
> [or ESC, Shift + X] or menu System -> S-Lang Command), too:
> > definekey("push_spot;replace_cmd;pop_spot", "\e%", what_keymap);


You can also write a new function

define replace_and_come_back()
{
   push_spot();
   replace_cmd();
   pop_spot();
}

and bind this to your "replace-key-combo". (untested)


Günter
_______________________________________________
For list information, visit <http://jedsoft.org/jed/mailinglists.html>.


[2016 date index] [2016 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]