diff options
| author | Karl Heuer | 1998-09-13 03:36:27 +0000 |
|---|---|---|
| committer | Karl Heuer | 1998-09-13 03:36:27 +0000 |
| commit | 703c3a110b339bda8a24ac69e81cabbaabf451b5 (patch) | |
| tree | 4aee0b3d8337de8678f97e2e73991f40d560575f | |
| parent | 65f2da7e910fb135e66f57b54c71d25dfc7718c1 (diff) | |
| download | emacs-703c3a110b339bda8a24ac69e81cabbaabf451b5.tar.gz emacs-703c3a110b339bda8a24ac69e81cabbaabf451b5.zip | |
(widget-menu-max-shortcuts): New variable.
(widget-choose): Don't use single-char shortcuts if # items
exceeds that many. Use minibuffer instead.
| -rw-r--r-- | lisp/wid-edit.el | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 583ab54fbc2..70d61a99d23 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el | |||
| @@ -176,7 +176,13 @@ Larger menus are read through the minibuffer." | |||
| 176 | :group 'widgets | 176 | :group 'widgets |
| 177 | :type 'integer) | 177 | :type 'integer) |
| 178 | 178 | ||
| 179 | (defcustom widget-menu-minibuffer-flag (string-match "XEmacs" emacs-version) | 179 | (defcustom widget-menu-max-shortcuts 40 |
| 180 | "Largest number of items for which it works to choose one with a character. | ||
| 181 | For a larger number of items, the minibuffer is used." | ||
| 182 | :group 'widgets | ||
| 183 | :type 'integer) | ||
| 184 | |||
| 185 | (defcustom widget-menu-minibuffer-flag nil | ||
| 180 | "*Control how to ask for a choice from the keyboard. | 186 | "*Control how to ask for a choice from the keyboard. |
| 181 | Non-nil means use the minibuffer; | 187 | Non-nil means use the minibuffer; |
| 182 | nil means read a single character." | 188 | nil means read a single character." |
| @@ -202,7 +208,8 @@ minibuffer." | |||
| 202 | ;; We are in Emacs-19, pressed by the mouse | 208 | ;; We are in Emacs-19, pressed by the mouse |
| 203 | (x-popup-menu event | 209 | (x-popup-menu event |
| 204 | (list title (cons "" items)))) | 210 | (list title (cons "" items)))) |
| 205 | (widget-menu-minibuffer-flag | 211 | ((or widget-menu-minibuffer-flag |
| 212 | (> (length items) widget-menu-max-shortcuts)) | ||
| 206 | ;; Read the choice of name from the minibuffer. | 213 | ;; Read the choice of name from the minibuffer. |
| 207 | (setq items (widget-remove-if 'stringp items)) | 214 | (setq items (widget-remove-if 'stringp items)) |
| 208 | (let ((val (completing-read (concat title ": ") items nil t))) | 215 | (let ((val (completing-read (concat title ": ") items nil t))) |