> How about showing what the lookup-key output looks like before and after your patch when a menu is involved?
Sure,
(define-key map "a" '("Foo function" . foo))
This is the behavior from before (the second sets the new optional arg to nil)
(lookup-key map "a") => foo
(lookup-key map "a" nil nil) => foo
With the new last argument set to t,
(lookup-key map "a" nil t) => ("Foo function" . foo)
The motivation for this patch was to be able to easily retrieve ("Foo function" . foo) in a case like this.
Best,
Justin