GNU bug report logs -
#9922
24.0.91; prompt by y-or-n-p changes tool bar on another frame
Previous Next
Reported by: Eli Zaretskii <eliz <at> gnu.org>
Date: Mon, 31 Oct 2011 18:27:02 UTC
Severity: normal
Found in version 24.0.91
Done: Chong Yidong <cyd <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #17 received at 9922 <at> debbugs.gnu.org (full text, mbox):
> Unfortunately, currently we don't have a way to tell `lookup-key' to
> just return the menu item without evaluating :filter functions. The
> following hack would work around this for 24.1, though it's a bit
> black-magicky.
> Stefan, AFAICT think you wrote the code in question. Opinions?
I think it's an OK workaround, tho it needs a comment like "lookup-key
without running :filters".
A better approach might be to provide a lookup-key which doesn't
run :filters. Tho semantically, this is a murky area: without running
the filter we can't know whether the binding is nil, a keymap, or
something else, so we can't know whether it hides (or merges with)
other bindings in parent keymaps. IOW, such a function should probably
return a list of "raw unreduced bindings".
Stefan
> === modified file 'lisp/subr.el'
> *** lisp/subr.el 2012-04-19 06:04:05 +0000
> --- lisp/subr.el 2012-04-26 14:40:59 +0000
> ***************
> *** 2019,2025 ****
> (let ((map (make-sparse-keymap)))
> ;; Don't hide the menu-bar and tool-bar entries.
> (define-key map [menu-bar] (lookup-key global-map [menu-bar]))
> ! (define-key map [tool-bar] (lookup-key global-map [tool-bar]))
> map))
> (aref (catch 'read-key (read-key-sequence-vector prompt nil t)) 0))
> (cancel-timer timer)
> --- 2019,2027 ----
> (let ((map (make-sparse-keymap)))
> ;; Don't hide the menu-bar and tool-bar entries.
> (define-key map [menu-bar] (lookup-key global-map [menu-bar]))
> ! (define-key map [tool-bar]
> ! (or (cdr (assq 'tool-bar global-map))
> ! (lookup-key global-map [tool-bar])))
> map))
> (aref (catch 'read-key (read-key-sequence-vector prompt nil t)) 0))
> (cancel-timer timer)
This bug report was last modified 13 years and 24 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.