diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index a70598bb6c9..b712be1986b 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -282,16 +282,20 @@ widget-choose If ITEMS has simple item definitions, then this function returns the VALUE of the chosen element. If ITEMS is a keymap, then the return value is the symbol in the key vector, as in the argument of `define-key'." - ;; Apply quote substitution to customize choice menu item text, + ;; Apply quote substitution to choice menu title and item text, ;; whether it occurs in a widget buffer or in a popup menu. (let ((items (mapc (lambda (x) - (when (consp x) - (dotimes (i (1- (length x))) - (when (stringp (nth i x)) - (setcar (nthcdr i x) - (substitute-command-keys - (car (nthcdr i x)))))))) - items))) + (if (proper-list-p x) + (dotimes (i (1- (length x))) + (when (stringp (nth i x)) + (setcar (nthcdr i x) + (substitute-command-keys + (car (nthcdr i x)))))) + ;; ITEMS has simple item definitions. + (when (and (consp x) (stringp (car x))) + (setcar x (substitute-command-keys (car x)))))) + items)) + (title (substitute-command-keys title))) (cond ((and (< (length items) widget-menu-max-size) event (display-popup-menus-p)) ;; Mouse click.