emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/wid-edit.el


From: Richard M . Stallman
Subject: [Emacs-diffs] Changes to emacs/lisp/wid-edit.el
Date: Thu, 03 Nov 2005 16:46:16 -0500

Index: emacs/lisp/wid-edit.el
diff -c emacs/lisp/wid-edit.el:1.153 emacs/lisp/wid-edit.el:1.154
*** emacs/lisp/wid-edit.el:1.153        Sun Oct 23 17:40:38 2005
--- emacs/lisp/wid-edit.el      Thu Nov  3 21:46:16 2005
***************
*** 3116,3122 ****
                       (interactive)
                       (lisp-complete-symbol 'boundp))
    :tag "Variable")
! 
  (defvar widget-coding-system-prompt-value-history nil
    "History of input to `widget-coding-system-prompt-value'.")
  
--- 3116,3122 ----
                       (interactive)
                       (lisp-complete-symbol 'boundp))
    :tag "Variable")
! 
  (defvar widget-coding-system-prompt-value-history nil
    "History of input to `widget-coding-system-prompt-value'.")
  
***************
*** 3158,3163 ****
--- 3158,3186 ----
      (widget-value-set widget answer)
      (widget-apply widget :notify widget event)
      (widget-setup)))
+ 
+ (defvar widget-key-sequence-prompt-value-history nil
+   "History of input to `widget-key-sequence-prompt-value'.")
+ 
+ ;; This mostly works, but I am pretty sure it needs more change
+ ;; to be 100% correct.  I don't know what the change should be -- rms.
+ 
+ (define-widget 'key-sequence 'restricted-sexp
+   "A Lisp function."
+   :prompt-value 'widget-field-prompt-value
+   :prompt-internal 'widget-symbol-prompt-internal
+   :prompt-match 'fboundp
+   :prompt-history 'widget-key-sequence-prompt-value-history
+   :action 'widget-field-action
+   :match-alternatives '(stringp vectorp)
+   :validate (lambda (widget)
+             (unless (or (stringp (widget-value widget))
+                         (vectorp (widget-value widget)))
+               (widget-put widget :error (format "Invalid key sequence: %S"
+                                                 (widget-value widget)))
+               widget))
+   :value 'ignore
+   :tag "Key sequence")
  
  (define-widget 'sexp 'editable-field
    "An arbitrary Lisp expression."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]