[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Updated Patch for command remapping through keymaps

From: Kim F. Storm
Subject: Re: Updated Patch for command remapping through keymaps
Date: 05 Feb 2002 12:15:38 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.50

Richard Stallman <address@hidden> writes:

> I don't think tha global-set-key and local-set-key should
> accept a symbol.  They cannot read a symbol interactively anyway.

Maybe not, but basically they are just wrappers for define-key which
accepts a symbol - so it may be confusing that (global-set-key ...)
suddenly differs from (define-key global-map ...) if used for command
remapping.  I suggest we leave it in - but I change the description
in NEWS to:

- In calls from Lisp, global-set-key, global-unset-key, local-set-key,
  and local-unset-key also accept a command name as the KEY argument.

>     +   if (SYMBOLP (key))
>     +     {
>     +       GCPRO1 (key);
>     +       cmd = access_keymap (keymap, key, t_ok, 0, 1);
>     +       RETURN_UNGCPRO (cmd);
>     +     }
> No GCPRO is necessary here.

Ok, If you say so ... :-)

However, I don't really understand the lack of GCPRO in some of the
functions in keymap.c.  Specifically, I would have expected GCPRO
before the calls to
  keymap = get_keymap (..., ..., 1);
  Fset_keymap_parent  (parent)
  Fdefine_key         (key, def -- and later cmd)
  Flookup_key         (key, accept_default)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]