emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Need a predicate to tell whether a command was invoked from the menu


From: Drew Adams
Subject: RE: Need a predicate to tell whether a command was invoked from the menu-bar
Date: Tue, 28 Jun 2016 14:18:42 -0700 (PDT)

> Does anyone have a predicate function that determines whether or not
> a command was invoked from a menu-bar menu?

I use this:

(and (> (length (this-command-keys-vector)) 0)
     (equal '(menu-bar) (elt (this-command-keys-vector) 0))
     ;; Exclude uninterned symbols such as `menu-function-356'.
     (symbolp this-command)
     (intern-soft this-command))

(But please consider using plain-text mail, not HTML, for this
mailing list.)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]