[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: M-g in dired
From: |
Juri Linkov |
Subject: |
Re: M-g in dired |
Date: |
Fri, 04 Nov 2005 14:06:09 +0200 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) |
>> This docstring is not very clear. The documentation in the Emacs Lisp
>> is better:
>
>> If the string or vector KEY is not a valid key sequence according to
>> the prefix keys specified in KEYMAP, it must be "too long" and have
>> extra events at the end that do not fit into a single key sequence.
>> Then the value is a number, the number of events at the front of KEY
>> that compose a complete key.
>
>> For the case of dired-mode-map where lookup-key returns 1 for "\C-x`",
>> 1 is not a number of events at the front of "\C-x`" that compose
>> a complete key, because "C-x" alone is not a valid key in dired-mode-map.
>
> It doesn't say "valid key" it says "valid key sequence". "C-x" is a valid
> key sequence in this context. It is not bound to anything, but it is
> a valid sequence. C-x ` is not a valid sequence on the other hand, because
> read-key-sequence would have immediately stopped after C-x.
>From the docstring I understood that "valid key sequence" means
a valid and bound key sequence, due to the sentence:
The number is how many characters at the front of key it takes
to reach a non-prefix command.
To me "a non-prefix command" implies a bound command key sequence.
That's why I changed the code to return the integer value only
on the condition `if (!NILP (cmd))'.
However, if this is not what the docstring meant, and leaving the logic
of the current return value is desirable, then maybe `lookup-key' needs
an additional argument defining another logic of its return value.
Otherwise, almost all code in `lookup-key' should be duplicated in
`shadow_lookup'.
--
Juri Linkov
http://www.jurta.org/emacs/
- Re: M-g in dired, Juri Linkov, 2005/11/01
- Re: M-g in dired, Andreas Schwab, 2005/11/01
- Re: M-g in dired, Richard M. Stallman, 2005/11/02
- Re: M-g in dired, Juri Linkov, 2005/11/03
- Re: M-g in dired, Stefan Monnier, 2005/11/03
- Re: M-g in dired,
Juri Linkov <=
- Re: M-g in dired, Richard M. Stallman, 2005/11/04
- Re: M-g in dired, Juri Linkov, 2005/11/05
- Re: M-g in dired, Richard M. Stallman, 2005/11/05
- Re: M-g in dired, Juri Linkov, 2005/11/07
- Re: M-g in dired, Stefan Monnier, 2005/11/07
- Re: M-g in dired, Juri Linkov, 2005/11/08
- Re: M-g in dired, Richard M. Stallman, 2005/11/08
- Re: M-g in dired, Richard M. Stallman, 2005/11/07
- Re: M-g in dired, Richard M. Stallman, 2005/11/03