emacs-devel
[Top][All Lists]
Advanced

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

Re: substitute-key-definition vs. define-key MAP [remap ...]


From: Stephen J. Turnbull
Subject: Re: substitute-key-definition vs. define-key MAP [remap ...]
Date: Fri, 23 Jul 2010 12:50:03 +0900

Stefan Monnier writes:

 > > So, am I right in saying that using substitute-key-definition on global
 > > map directly is a bad practice?
 > 
 > Yes and no.  Part of the reason why it exists is because that code was
 > written before remap was available.  Another part is because I'm not
 > sure remap is available in XEmacs, so packages who want to work in
 > XEmacs may prefer not to use it.

It's not available in XEmacs.

I haven't thought carefully about it, but my initial reaction is to
oppose introducing it.  It adds a lot of complexity (an additional
layer of indirection), and like `substitute-key-definition', it
postpones the real solution to issues that create demand for these
features: rewrite the function so that it can be configured by users,
modes, etc.

 > Finally, in some cases, using remap is not the right answer either
 > because remap not only replaces the command at its "usual" key-bindings,
 > but at all its key-bindings,

If I understand you correctly, that won't get into XEmacs any time
soon.  Do you really mean that `define-key' is allowed to effectively
change the command binding of a symbol globally, so that its function
definition is ignored in the context of interpreting keystrokes?  Ie,
`define-key' now turns Emacs into what is effectively a LISP-3?





reply via email to

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