/[emacs]/emacs/lisp/wid-edit.el
ViewVC logotype

Diff of /emacs/lisp/wid-edit.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.153 by cyd, Sun Oct 23 17:40:38 2005 UTC revision 1.154 by rms, Thu Nov 3 21:46:16 2005 UTC
# Line 3116  It will read a directory name from the m Line 3116  It will read a directory name from the m
3116                         (interactive)                         (interactive)
3117                         (lisp-complete-symbol 'boundp))                         (lisp-complete-symbol 'boundp))
3118    :tag "Variable")    :tag "Variable")
3119    
3120  (defvar widget-coding-system-prompt-value-history nil  (defvar widget-coding-system-prompt-value-history nil
3121    "History of input to `widget-coding-system-prompt-value'.")    "History of input to `widget-coding-system-prompt-value'.")
3122    
# Line 3159  It will read a directory name from the m Line 3159  It will read a directory name from the m
3159      (widget-apply widget :notify widget event)      (widget-apply widget :notify widget event)
3160      (widget-setup)))      (widget-setup)))
3161    
3162    (defvar widget-key-sequence-prompt-value-history nil
3163      "History of input to `widget-key-sequence-prompt-value'.")
3164    
3165    ;; This mostly works, but I am pretty sure it needs more change
3166    ;; to be 100% correct.  I don't know what the change should be -- rms.
3167    
3168    (define-widget 'key-sequence 'restricted-sexp
3169      "A Lisp function."
3170      :prompt-value 'widget-field-prompt-value
3171      :prompt-internal 'widget-symbol-prompt-internal
3172      :prompt-match 'fboundp
3173      :prompt-history 'widget-key-sequence-prompt-value-history
3174      :action 'widget-field-action
3175      :match-alternatives '(stringp vectorp)
3176      :validate (lambda (widget)
3177                  (unless (or (stringp (widget-value widget))
3178                              (vectorp (widget-value widget)))
3179                    (widget-put widget :error (format "Invalid key sequence: %S"
3180                                                      (widget-value widget)))
3181                    widget))
3182      :value 'ignore
3183      :tag "Key sequence")
3184    
3185  (define-widget 'sexp 'editable-field  (define-widget 'sexp 'editable-field
3186    "An arbitrary Lisp expression."    "An arbitrary Lisp expression."
3187    :tag "Lisp expression"    :tag "Lisp expression"

Legend:
Removed from v.1.153  
changed lines
  Added in v.1.154

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26