changeset 23243:b6c86c56e760

(widget-menu-max-shortcuts): New variable. (widget-choose): Don't use single-char shortcuts if # items exceeds that many. Use minibuffer instead.
author Karl Heuer <kwzh@gnu.org>
date Sun, 13 Sep 1998 03:36:27 +0000
parents 94ddde8e0c64
children 67e80974136e
files lisp/wid-edit.el
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/wid-edit.el	Sat Sep 12 13:58:46 1998 +0000
+++ b/lisp/wid-edit.el	Sun Sep 13 03:36:27 1998 +0000
@@ -176,7 +176,13 @@
   :group 'widgets
   :type 'integer)
 
-(defcustom widget-menu-minibuffer-flag (string-match "XEmacs" emacs-version)
+(defcustom widget-menu-max-shortcuts 40
+  "Largest number of items for which it works to choose one with a character.
+For a larger number of items, the minibuffer is used."
+  :group 'widgets
+  :type 'integer)
+
+(defcustom widget-menu-minibuffer-flag nil
   "*Control how to ask for a choice from the keyboard.
 Non-nil means use the minibuffer;
 nil means read a single character."
@@ -202,7 +208,8 @@
 	 ;; We are in Emacs-19, pressed by the mouse
 	 (x-popup-menu event
 		       (list title (cons "" items))))
-	(widget-menu-minibuffer-flag
+	((or widget-menu-minibuffer-flag
+	     (> (length items) widget-menu-max-shortcuts))
 	 ;; Read the choice of name from the minibuffer.
 	 (setq items (widget-remove-if 'stringp items))
 	 (let ((val (completing-read (concat title ": ") items nil t)))