jed-users mailing list

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

Re: [Jed-users-l] .jedrc woes


Mike McClain <mike.junk@xxxxxxxxxxx> wrote:
> These from the key bindings list generated from the 't' buffer:
> ( 't' is the name of the file I'm editing and a copy of .jedrc)
>     TAB                     indent_line
>     ESC Ctrl-A              c_top_of_function
>     ESC Ctrl-E              c_end_of_function
>     ESC Ctrl-H              c_mark_function
>     ESC ;                   c_make_comment
>    :                       c_insert_colon
>    {                       c_insert_bra
>    }                       c_insert_ket

Those are C mode bindings, but I do not know why C mode would be
activated for a file/buffer called "t".  In any case, when C mode is
loaded, it redefines some keys, and in particular binds the ESC Ctrl-H
sequence to c_mark_function.  What you need is a C mode hook, or more
generically a global mode hook.  I suspect that the latter will work
better for you.  So I suggest adding the following to your .jedrc file:

  define global_mode_hook (hook)
  {
     local_setkey ("yp_bkill_word", "\e^H");
  }

Here is a description of the global_mode_hook function from the
hooks.txt file distributed with jed:

global_mode_hook
----------------

This hook is called by the run_mode_hooks function prior to calling
the actual mode-hook.  It takes a single argument whose value is the
name of the mode-hook.  For instance, many users prefer to have the
TAB key always insert a TAB instead of running the indent_line
function.  The easiest way to enforce this for every mode is through a
global_mode_hook such as:

    define global_mode_hook (hook_name)
    {
        if (hook_name != "c_mode_hook")
	  local_setkey ("self_insert_cmd", "\t");
    }

This example illustrates how to cause the TAB key to insert a TAB in
all modes _except_ C-mode.


I hope this helps. --John
_______________________________________________
Jed-users-l mailing list
Jed-users-l@xxxxxxxx
http://mailman.jtan.com/mailman/listinfo/jed-users-l


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