[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: kill-emacs-query-functions problem with y-or-n-p
From: |
Drew Adams |
Subject: |
RE: kill-emacs-query-functions problem with y-or-n-p |
Date: |
Mon, 20 Jun 2005 14:05:16 -0700 |
(defun foo () (y-or-n-p "foo? "))
(defun bar () (y-or-n-p "bar? "))
(setq kill-emacs-query-functions '(foo bar))
2. Use the menu-bar File > Exit Emacs.
The question "foo? " correctly appears in a popup menu y/n.
3. Respond `n' to "foo? ".
4. The question "bar? " should be asked via a popup menu
also, but it
appears instead in the minibuffer.
This is controlled by last-nonmenu-event. At C level, it is
last_nonmenu_event. Can you determine where and how it gets altered
when foo asks its question?
Sorry, I don't have much time to debug this.
I did run through the debugger (debug-on-entry foo), checking
last-nonmenu-event at each step. The value remained `(menu-bar)' throughout,
right up through debugger-reenable in run-hooks(post-command-hook). However,
after run-hooks(post-command-hook), the value was nil, so it was nil when
run-hooks(activate-menubar-hook) was run.