[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
RE: Need a predicate to tell whether a command was invoked from the menu-bar
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'.
(But please consider using plain-text mail, not HTML, for this