jed-users mailing list

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

Re: [jed-users] Re: definekey


Hi Ulli,

SCNR: I'd advise to avoid global variables at all: ;)

define perl_mode_hook() {
  pop(evalfile("cmode"));
  variable kmap = "perl";
  definekey("indent_line", "\t", kmap);
  definekey("bsearch_char('{')", "Û", kmap);  % Alt-[
  definekey("fsearch_char('}')", "Ý", kmap);  % Alt-]
  definekey("c_insert_ket", "}", kmap);
  definekey(".9 insert_char", "\e\t", kmap);
  definekey(".9 insert_char", Key_Shift_Tab, kmap);
}

Cheers & schöne Grüße,

Manfred


On 29.09.2015 10:50, Ulli Horlacher wrote:
> On Tue 2015-09-29 (10:36), Ulli Horlacher wrote:
>> In my jed.rc I have:
>>
>> define perl_mode_hook() {
>>   $1 = "perl";
>>   pop(evalfile("cmode"));
>>   definekey("indent_line","\t",$1);
>>   definekey("bsearch_char('{')","Û",$1);  % Alt-[
>>   definekey("fsearch_char('}')","Ý",$1);  % Alt-]
>>   definekey("c_insert_ket","}",$1);
>>   definekey(".9 insert_char","\e\t",$1);
>>   definekey(".9 insert_char",Key_Shift_Tab,$1);
>> }
>>
>> But the keys are not defined when I edit a perl file.
> 
> Got it:
> cmode modifies $1 !
> I have to swap the first 2 commands in perl_mode_hook() :
> 
> define perl_mode_hook() {
>   pop(evalfile("cmode"));
>   $1 = "perl";
>   definekey("indent_line","\t",$1);
>   definekey("bsearch_char('{')","Û",$1);  % Alt-[
>   definekey("fsearch_char('}')","Ý",$1);  % Alt-]
>   definekey("c_insert_ket","}",$1);
>   definekey(".9 insert_char","\e\t",$1);
>   definekey(".9 insert_char",Key_Shift_Tab,$1);
> }
_______________________________________________
For list information, visit <http://jedsoft.org/jed/mailinglists.html>.


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