aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1997-07-06 23:12:14 +0000
committerRichard M. Stallman1997-07-06 23:12:14 +0000
commitcfc198e540dac946e528477c421f395c56d0cc05 (patch)
treefb3af7b661d4b14663de36628d8a4fc6dceee72e
parentdbe82e018651d1ced23d3bf9158ce17c6c27c47e (diff)
downloademacs-cfc198e540dac946e528477c421f395c56d0cc05.tar.gz
emacs-cfc198e540dac946e528477c421f395c56d0cc05.zip
(widget-field-use-before-change): Reenable for Emacs 20.
(widget-choose): Using keyboard, if all choices are diabled, just report an error.
-rw-r--r--lisp/wid-edit.el10
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index 31b8be64ddd..ba431611815 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -300,6 +300,7 @@ minibuffer."
300 (let* ((overriding-terminal-local-map 300 (let* ((overriding-terminal-local-map
301 (make-sparse-keymap)) 301 (make-sparse-keymap))
302 map choice (next-digit ?0) 302 map choice (next-digit ?0)
303 some-choice-enabled
303 value) 304 value)
304 ;; Define SPC as a prefix char to get to this menu. 305 ;; Define SPC as a prefix char to get to this menu.
305 (define-key overriding-terminal-local-map " " 306 (define-key overriding-terminal-local-map " "
@@ -314,11 +315,14 @@ minibuffer."
314 (let* ((name (car choice)) 315 (let* ((name (car choice))
315 (function (cdr choice))) 316 (function (cdr choice)))
316 (insert (format "%c = %s\n" next-digit name)) 317 (insert (format "%c = %s\n" next-digit name))
317 (define-key map (vector next-digit) function))) 318 (define-key map (vector next-digit) function)
319 (setq some-choice-enabled t)))
318 ;; Allocate digits to disabled alternatives 320 ;; Allocate digits to disabled alternatives
319 ;; so that the digit of a given alternative never varies. 321 ;; so that the digit of a given alternative never varies.
320 (setq next-digit (1+ next-digit))) 322 (setq next-digit (1+ next-digit)))
321 (insert "\nC-g = Quit")) 323 (insert "\nC-g = Quit"))
324 (or some-choice-enabled
325 (error "None of the choices is currently meaningful"))
322 (define-key map [?\C-g] 'keyboard-quit) 326 (define-key map [?\C-g] 'keyboard-quit)
323 (define-key map [t] 'keyboard-quit) 327 (define-key map [t] 'keyboard-quit)
324 (setcdr map (nreverse (cdr map))) 328 (setcdr map (nreverse (cdr map)))
@@ -375,10 +379,10 @@ size field."
375 379
376(defcustom widget-field-use-before-change 380(defcustom widget-field-use-before-change
377 (or (> emacs-minor-version 34) 381 (or (> emacs-minor-version 34)
378 (> emacs-major-version 20) 382 (>= emacs-major-version 20)
379 (string-match "XEmacs" emacs-version)) 383 (string-match "XEmacs" emacs-version))
380 "Non-nil means use `before-change-functions' to track editable fields. 384 "Non-nil means use `before-change-functions' to track editable fields.
381This enables the use of undo, but doesn'f work on Emacs 19.34 and earlier. 385This enables the use of undo, but doesn't work on Emacs 19.34 and earlier.
382Using before hooks also means that the :notify function can't know the 386Using before hooks also means that the :notify function can't know the
383new value." 387new value."
384 :type 'boolean 388 :type 'boolean