diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index a70598bb6c9..40d7b5b902c 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -285,12 +285,17 @@ widget-choose ;; Apply quote substitution to customize choice menu 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)))))))) + (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)) + (stringp (cdr x))) + (setcar x (substitute-command-keys (car x))) + (setcdr x (substitute-command-keys (cdr x)))))) items))) (cond ((and (< (length items) widget-menu-max-size) event (display-popup-menus-p))