* How to tell if a command was called from a menu?
@ 2009-08-15 14:04 Joost Kremers
2009-08-15 15:07 ` Lennart Borgman
[not found] ` <mailman.4631.1250348865.2239.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 3+ messages in thread
From: Joost Kremers @ 2009-08-15 14:04 UTC (permalink / raw)
To: help-gnu-emacs
hi all,
is there a reliable way to tell in elisp if a command was called from a menu?
commands such as find-file and y-or-n-p behave differently when called from a
menu (they use a popup window instead of the minibuffer) but it seems that the
relevant check is done in the C part of the source...
TIA
--
Joost Kremers joostkremers@yahoo.com
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: How to tell if a command was called from a menu?
2009-08-15 14:04 How to tell if a command was called from a menu? Joost Kremers
@ 2009-08-15 15:07 ` Lennart Borgman
[not found] ` <mailman.4631.1250348865.2239.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 3+ messages in thread
From: Lennart Borgman @ 2009-08-15 15:07 UTC (permalink / raw)
To: Joost Kremers; +Cc: help-gnu-emacs
On Sat, Aug 15, 2009 at 4:04 PM, Joost Kremers<joostkremers@yahoo.com> wrote:
> hi all,
>
> is there a reliable way to tell in elisp if a command was called from a menu?
> commands such as find-file and y-or-n-p behave differently when called from a
> menu (they use a popup window instead of the minibuffer) but it seems that the
> relevant check is done in the C part of the source...
I believe you can do it the same way it is done in
ourcomments-M-x-menu-mode. It is in the file ourcomments-util.el in
nXhtml repository.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: How to tell if a command was called from a menu?
[not found] ` <mailman.4631.1250348865.2239.help-gnu-emacs@gnu.org>
@ 2009-08-17 8:52 ` Joost Kremers
0 siblings, 0 replies; 3+ messages in thread
From: Joost Kremers @ 2009-08-17 8:52 UTC (permalink / raw)
To: help-gnu-emacs
Lennart Borgman wrote:
> I believe you can do it the same way it is done in
> ourcomments-M-x-menu-mode. It is in the file ourcomments-util.el in
> nXhtml repository.
cool, thanks! i had found (member 'menu-bar last-nonmenu-event) myself, but i
suspect your way is better. (in fact, judging by the documentation, i think
last-nonmenu-event should be nil when a command is called from a menu, but
instead it seems to have the value (menu-bar)...)
--
Joost Kremers joostkremers@yahoo.com
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-08-17 8:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-15 14:04 How to tell if a command was called from a menu? Joost Kremers
2009-08-15 15:07 ` Lennart Borgman
[not found] ` <mailman.4631.1250348865.2239.help-gnu-emacs@gnu.org>
2009-08-17 8:52 ` Joost Kremers
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).