[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: |
Sat, 05 Nov 2005 09:55:35 +0200 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) |
> 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.
>
> Why?
>
> Otherwise, almost all code in `lookup-key' should be duplicated in
> `shadow_lookup'.
>
> Why?
To fix the bug, I think changes should be made in `shadow_lookup'.
Let's see how it currently works for the case when dired-mode-map
defines the "M-g" key, and the global-map defines "M-gn":
`shadow_lookup' iterates over two maps (dired and global) and calls
`Flookup_key' on them. When `Flookup_key' returns 1 for the key
"M-gn" on the dired map, the loop in `shadow_lookup' skips it
and advances to the next iteration on the global map where it finds
the command `next-error' bound to "M-gn", and returns it.
This causes the current code to assume that "M-gn" in the global map
is not shadowed by "M-g" in the dired map. It fails due to the value 1
returned by `Flookup_key', which is unsuitable to decide whether "M-g"
is bound in the dired map or not, and thus whether it shadows "M-gn"
in the global map or not.
To fix this, I intended to use the same code as `Flookup_key' uses
to process key sequences, but additionally to check whether a shorter
prefix key is bound or not. This can be achieved either by adding
a new argument to `Flookup_key' to check if a key is bound and to
return the corresponding return value (and not to change its current
default semantics of the return value), or to duplicate most code of
`Flookup_key' in `shadow_lookup' to do this.
--
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, 2005/11/04
- Re: M-g in dired, Richard M. Stallman, 2005/11/04
- Re: M-g in dired,
Juri Linkov <=
- 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