diff options
| author | Dave Love | 2001-01-12 12:54:42 +0000 |
|---|---|---|
| committer | Dave Love | 2001-01-12 12:54:42 +0000 |
| commit | bd1f16ce5be34e17a4fda890720635414e6b0efd (patch) | |
| tree | ab1d3f8bc110a9f94dd99b3029234aac193b7c8a | |
| parent | 50a8310e770ba4c48038d825fda65972721fc401 (diff) | |
| download | emacs-bd1f16ce5be34e17a4fda890720635414e6b0efd.tar.gz emacs-bd1f16ce5be34e17a4fda890720635414e6b0efd.zip | |
(function): Add :match-alternatives.
(widget-color-action): Doc fix.
| -rw-r--r-- | lisp/wid-edit.el | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 34d9fb75a9d..fe58e1acf39 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el | |||
| @@ -2910,6 +2910,7 @@ It will read a file name from the minibuffer when invoked." | |||
| 2910 | ;;; (widget-setup) | 2910 | ;;; (widget-setup) |
| 2911 | ;;; (widget-apply widget :notify widget event))) | 2911 | ;;; (widget-apply widget :notify widget event))) |
| 2912 | 2912 | ||
| 2913 | ;; Fixme: use file-name-as-directory. | ||
| 2913 | (define-widget 'directory 'file | 2914 | (define-widget 'directory 'file |
| 2914 | "A directory widget. | 2915 | "A directory widget. |
| 2915 | It will read a directory name from the minibuffer when invoked." | 2916 | It will read a directory name from the minibuffer when invoked." |
| @@ -2960,6 +2961,7 @@ It will read a directory name from the minibuffer when invoked." | |||
| 2960 | :prompt-match 'fboundp | 2961 | :prompt-match 'fboundp |
| 2961 | :prompt-history 'widget-function-prompt-value-history | 2962 | :prompt-history 'widget-function-prompt-value-history |
| 2962 | :action 'widget-field-action | 2963 | :action 'widget-field-action |
| 2964 | :match-alternatives '(functionp) | ||
| 2963 | :validate (lambda (widget) | 2965 | :validate (lambda (widget) |
| 2964 | (unless (functionp (widget-value widget)) | 2966 | (unless (functionp (widget-value widget)) |
| 2965 | (widget-put widget :error (format "Invalid function: %S" | 2967 | (widget-put widget :error (format "Invalid function: %S" |
| @@ -2972,7 +2974,6 @@ It will read a directory name from the minibuffer when invoked." | |||
| 2972 | "History of input to `widget-variable-prompt-value'.") | 2974 | "History of input to `widget-variable-prompt-value'.") |
| 2973 | 2975 | ||
| 2974 | (define-widget 'variable 'symbol | 2976 | (define-widget 'variable 'symbol |
| 2975 | ;; Should complete on variables. | ||
| 2976 | "A Lisp variable." | 2977 | "A Lisp variable." |
| 2977 | :prompt-match 'boundp | 2978 | :prompt-match 'boundp |
| 2978 | :prompt-history 'widget-variable-prompt-value-history | 2979 | :prompt-history 'widget-variable-prompt-value-history |
| @@ -3346,6 +3347,7 @@ To use this type, you must define :match or :match-alternatives." | |||
| 3346 | 3347 | ||
| 3347 | ;;; The `color' Widget. | 3348 | ;;; The `color' Widget. |
| 3348 | 3349 | ||
| 3350 | ;; Fixme: match | ||
| 3349 | (define-widget 'color 'editable-field | 3351 | (define-widget 'color 'editable-field |
| 3350 | "Choose a color name (with sample)." | 3352 | "Choose a color name (with sample)." |
| 3351 | :format "%t: %v (%{sample%})\n" | 3353 | :format "%t: %v (%{sample%})\n" |
| @@ -3387,7 +3389,7 @@ To use this type, you must define :match or :match-alternatives." | |||
| 3387 | (error 'default)))) | 3389 | (error 'default)))) |
| 3388 | 3390 | ||
| 3389 | (defun widget-color-action (widget &optional event) | 3391 | (defun widget-color-action (widget &optional event) |
| 3390 | ;; Prompt for a color. | 3392 | "Prompt for a color." |
| 3391 | (let* ((tag (widget-apply widget :menu-tag-get)) | 3393 | (let* ((tag (widget-apply widget :menu-tag-get)) |
| 3392 | (prompt (concat tag ": ")) | 3394 | (prompt (concat tag ": ")) |
| 3393 | (value (widget-value widget)) | 3395 | (value (widget-value widget)) |