From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Chong Yidong <cyd@gnu.org>
Cc: 9922@debbugs.gnu.org
Subject: bug#9922: 24.0.91; prompt by y-or-n-p changes tool bar on another frame
Date: Thu, 26 Apr 2012 21:01:40 -0400 [thread overview]
Message-ID: <jwv7gx2f0v0.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87397q8sa0.fsf@gnu.org> (Chong Yidong's message of "Thu, 26 Apr 2012 22:46:47 +0800")
> 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)
prev parent reply other threads:[~2012-04-27 1:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-31 18:24 bug#9922: 24.0.91; prompt by y-or-n-p changes tool bar on another frame Eli Zaretskii
2011-11-19 13:57 ` Eli Zaretskii
2012-04-26 14:46 ` Chong Yidong
2012-04-26 15:09 ` Eli Zaretskii
2012-04-27 1:01 ` Stefan Monnier [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwv7gx2f0v0.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=9922@debbugs.gnu.org \
--cc=cyd@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).