unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* What lookup-key returns for an undefined key
@ 2005-01-15 12:49 Eli Zaretskii
  2005-01-15 16:33 ` Luc Teirlinck
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Eli Zaretskii @ 2005-01-15 12:49 UTC (permalink / raw)


In Emacs 21.3, lookup-key returns `undefined' for an undefined key; in
the current CVS it returns nil.

If this change is intentional, I think we should reflect that in NEWS.

Two bundled Lisp packages are affected by this: woman.el and
gnus-util.el.  I've fixed the former, but not the latter.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: What lookup-key returns for an undefined key
  2005-01-15 12:49 What lookup-key returns for an undefined key Eli Zaretskii
@ 2005-01-15 16:33 ` Luc Teirlinck
  2005-01-15 17:18 ` Luc Teirlinck
  2005-01-15 18:36 ` Luc Teirlinck
  2 siblings, 0 replies; 9+ messages in thread
From: Luc Teirlinck @ 2005-01-15 16:33 UTC (permalink / raw)
  Cc: emacs-devel

Eli Zaretskii wrote:

   In Emacs 21.3, lookup-key returns `undefined' for an undefined key; in
   the current CVS it returns nil.

In what concrete way has the behavior of `lookup-key' changed since
21.3?  I could not find any indications of such a change in the
changelogs, nor in actual behavior.  The following produced identical
*ielm* runs in 21.3 and this morning's CVS:

ELISP> (setq kmp (make-sparse-keymap))
(keymap)

ELISP> (define-key kmp "\C-a" 'undefined)
undefined
ELISP> (lookup-key kmp "\C-a")
undefined
ELISP> (lookup-key kmp "\C-b")
nil
ELISP> (lookup-key kmp "\C-a" t)
undefined
ELISP> (lookup-key kmp "\C-b" t)
nil
ELISP> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: What lookup-key returns for an undefined key
  2005-01-15 12:49 What lookup-key returns for an undefined key Eli Zaretskii
  2005-01-15 16:33 ` Luc Teirlinck
@ 2005-01-15 17:18 ` Luc Teirlinck
  2005-01-16  4:41   ` Eli Zaretskii
  2005-01-15 18:36 ` Luc Teirlinck
  2 siblings, 1 reply; 9+ messages in thread
From: Luc Teirlinck @ 2005-01-15 17:18 UTC (permalink / raw)
  Cc: emacs-devel

Eli Zaretskii wrote"
   
   In Emacs 21.3, lookup-key returns `undefined' for an undefined key; in
   the current CVS it returns nil.

   If this change is intentional, I think we should reflect that in NEWS.

   Two bundled Lisp packages are affected by this: woman.el and
   gnus-util.el.  I've fixed the former, but not the latter.

There are three types of key that are commonly referred to as
"undefined":  keys that are not bound, keys bound to the symbol nil and
keys bound to the command `undefined'.  If nothing else tries to
define the key, the end result is the same, in as far as the user is
concerned.  If something else tries to define the key, there are
subtle differences.  `lookup-key' returns nil for the first two types
and `undefined' for the latter.

`dired-mode-map' used by woman.el has been changed from 21.3 to unbind
several keys that were formerly bound to the command `undefined'.  I
believe that your change to woman.el is correct.  However that code
was _already_ broken in 21.3.  Probably, gnus-util.el needs a similar
change.

Sincerely,

Luc.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: What lookup-key returns for an undefined key
  2005-01-15 12:49 What lookup-key returns for an undefined key Eli Zaretskii
  2005-01-15 16:33 ` Luc Teirlinck
  2005-01-15 17:18 ` Luc Teirlinck
@ 2005-01-15 18:36 ` Luc Teirlinck
  2 siblings, 0 replies; 9+ messages in thread
From: Luc Teirlinck @ 2005-01-15 18:36 UTC (permalink / raw)
  Cc: emacs-devel

>From my previous message:

   I believe that your change to woman.el is correct.  However that
   code was _already_ broken in 21.3.

Actually, I do not use woman.el and so I can not be really sure of
those two statements.  The reason why self-inserting characters not
bound by Dired are no longer bound to the command `undefined' in Dired
is that dired-mode-map now remaps `self-insert-command' to
`undefined'.  _If_ the woman.el code was correct for 21.3, that is if
it really _only_ was meant to apply to commands that were explicitly
bound to `undefined' in Dired, then your latest patch might not be
completely accurate.  (In that case it should only apply to non-bound
self-inserting characters.)

The reason for the changed behavior you refer to seems to have nothing
to do with `lookup-key' but with the following:

2002-08-26  Kim F. Storm  <storm@cua.dk>

	    * subr.el (suppress-keymap): Use command remapping instead of
	    substitute-key-definition to undefine self-inserting keys.

Sincerely,

Luc.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: What lookup-key returns for an undefined key
  2005-01-15 17:18 ` Luc Teirlinck
@ 2005-01-16  4:41   ` Eli Zaretskii
  2005-01-16  4:58     ` Luc Teirlinck
  2005-01-17  2:08     ` Richard Stallman
  0 siblings, 2 replies; 9+ messages in thread
From: Eli Zaretskii @ 2005-01-16  4:41 UTC (permalink / raw)
  Cc: emacs-devel

> Date: Sat, 15 Jan 2005 11:18:28 -0600 (CST)
> From: Luc Teirlinck <teirllm@dms.auburn.edu>
> Cc: emacs-devel@gnu.org
> 
> `dired-mode-map' used by woman.el has been changed from 21.3 to unbind
> several keys that were formerly bound to the command `undefined'.

It's possible that I only checked with dired-mode-map, so it looked to
me like lookup-key have changed.

In any case, I think that the change to dired-mode-map should be in
NEWS.  There's no way to know what unbundled packages used the
`undefined' thing to bind keys in Dired that were free.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: What lookup-key returns for an undefined key
  2005-01-16  4:41   ` Eli Zaretskii
@ 2005-01-16  4:58     ` Luc Teirlinck
  2005-01-17  2:08     ` Richard Stallman
  1 sibling, 0 replies; 9+ messages in thread
From: Luc Teirlinck @ 2005-01-16  4:58 UTC (permalink / raw)
  Cc: emacs-devel

Eli Zaretskii wrote:

   It's possible that I only checked with dired-mode-map, so it looked to
   me like lookup-key have changed.

   In any case, I think that the change to dired-mode-map should be in
   NEWS.  There's no way to know what unbundled packages used the
   `undefined' thing to bind keys in Dired that were free.

Actually, after taking a closer look, I noticed that the change in
dired-mode-map is a consequence of a change in suppress-keymap (as I
already pointed out in a previous message):

   2002-08-26  Kim F. Storm  <storm@cua.dk>

	       * subr.el (suppress-keymap): Use command remapping instead of
	       substitute-key-definition to undefine self-inserting keys.

Sincerely,

Luc.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: What lookup-key returns for an undefined key
  2005-01-16  4:41   ` Eli Zaretskii
  2005-01-16  4:58     ` Luc Teirlinck
@ 2005-01-17  2:08     ` Richard Stallman
  2005-01-17  3:22       ` Luc Teirlinck
  1 sibling, 1 reply; 9+ messages in thread
From: Richard Stallman @ 2005-01-17  2:08 UTC (permalink / raw)
  Cc: teirllm, emacs-devel

    In any case, I think that the change to dired-mode-map should be in
    NEWS.

This is an implementation detail.  In general, programs that depend on
the internal behavior of various parts of Emacs may break when we
change those internals.  I don't want NEWS to describe internal
changes merely because of this; it would distract people from more
important changes by burying them in lots of minor ones.

However, the change in suppress-keymap ought to be in NEWS.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: What lookup-key returns for an undefined key
  2005-01-17  2:08     ` Richard Stallman
@ 2005-01-17  3:22       ` Luc Teirlinck
  2005-01-17 23:43         ` Richard Stallman
  0 siblings, 1 reply; 9+ messages in thread
From: Luc Teirlinck @ 2005-01-17  3:22 UTC (permalink / raw)
  Cc: eliz, emacs-devel

Richard Stallman wrote:

   However, the change in suppress-keymap ought to be in NEWS.

Is the following OK?  Should this count as an "incompatible" change?

+++
** `suppress-keymap' now works by remapping `self-insert-command' to
the command `undefined'.  (In earlier Emacs versions, it used
`substitute-key-definition' to rebind self inserting characters to
`undefined'.)

Sincerely,

Luc.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: What lookup-key returns for an undefined key
  2005-01-17  3:22       ` Luc Teirlinck
@ 2005-01-17 23:43         ` Richard Stallman
  0 siblings, 0 replies; 9+ messages in thread
From: Richard Stallman @ 2005-01-17 23:43 UTC (permalink / raw)
  Cc: eliz, emacs-devel

    Is the following OK?  Should this count as an "incompatible" change?

It is ok.  I think it should count as incompatible, since the only
reason to mention it in NEWS is that it might break some things.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-01-17 23:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-15 12:49 What lookup-key returns for an undefined key Eli Zaretskii
2005-01-15 16:33 ` Luc Teirlinck
2005-01-15 17:18 ` Luc Teirlinck
2005-01-16  4:41   ` Eli Zaretskii
2005-01-16  4:58     ` Luc Teirlinck
2005-01-17  2:08     ` Richard Stallman
2005-01-17  3:22       ` Luc Teirlinck
2005-01-17 23:43         ` Richard Stallman
2005-01-15 18:36 ` Luc Teirlinck

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).