diff options
| author | Dave Love | 2000-09-04 09:40:27 +0000 |
|---|---|---|
| committer | Dave Love | 2000-09-04 09:40:27 +0000 |
| commit | 1d8696347369a4fc53e82efd4e2e597ecb0bdefb (patch) | |
| tree | a64f519bc18f16585d14685f87d2909da102c20f | |
| parent | 14473664b8532c58469a74b2f6503d543e195b88 (diff) | |
| download | emacs-1d8696347369a4fc53e82efd4e2e597ecb0bdefb.tar.gz emacs-1d8696347369a4fc53e82efd4e2e597ecb0bdefb.zip | |
(widget-sexp-validate): Fix garbled code.
| -rw-r--r-- | lisp/wid-edit.el | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 0f50956654a..edc1ef68560 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el | |||
| @@ -1635,7 +1635,7 @@ If END is omitted, it defaults to the length of LIST." | |||
| 1635 | :action 'widget-field-action | 1635 | :action 'widget-field-action |
| 1636 | :validate 'widget-field-validate | 1636 | :validate 'widget-field-validate |
| 1637 | :valid-regexp "" | 1637 | :valid-regexp "" |
| 1638 | :error "No match" | 1638 | :error "Field's value doesn't match allowed form" |
| 1639 | :value-create 'widget-field-value-create | 1639 | :value-create 'widget-field-value-create |
| 1640 | :value-delete 'widget-field-value-delete | 1640 | :value-delete 'widget-field-value-delete |
| 1641 | :value-get 'widget-field-value-get | 1641 | :value-get 'widget-field-value-get |
| @@ -2998,26 +2998,27 @@ It will read a directory name from the minibuffer when invoked." | |||
| 2998 | (with-temp-buffer | 2998 | (with-temp-buffer |
| 2999 | (insert (widget-apply widget :value-get)) | 2999 | (insert (widget-apply widget :value-get)) |
| 3000 | (goto-char (point-min)) | 3000 | (goto-char (point-min)) |
| 3001 | (condition-case data | 3001 | (let (err) |
| 3002 | (progn | 3002 | (condition-case data |
| 3003 | ;; Avoid a confusing end-of-file error. | 3003 | (progn |
| 3004 | (skip-syntax-forward "\\s-") | 3004 | ;; Avoid a confusing end-of-file error. |
| 3005 | (if (eobp) | 3005 | (skip-syntax-forward "\\s-") |
| 3006 | (error "Empty sexp -- use `nil'?")) | 3006 | (if (eobp) |
| 3007 | (if (eobp) | 3007 | (setq err "Empty sexp -- use `nil'?") |
| 3008 | (unless (widget-apply widget :match (read (current-buffer))) | 3008 | (unless (widget-apply widget :match (read (current-buffer))) |
| 3009 | (widget-put widget :error (widget-get widget :type-error)) | 3009 | (setq err (widget-get widget :type-error)))) |
| 3010 | widget) | 3010 | (if (and (not (eobp)) |
| 3011 | (widget-put widget | 3011 | (not err)) |
| 3012 | :error (format "Junk at end of expression: %s" | 3012 | (setq err (format "Junk at end of expression: %s" |
| 3013 | (buffer-substring (point) | 3013 | (buffer-substring (point) |
| 3014 | (point-max)))) | 3014 | (point-max)))))) |
| 3015 | widget)) | 3015 | (end-of-file ; Avoid confusing error message. |
| 3016 | (end-of-file ; Avoid confusing error message. | 3016 | (setq err "Unbalanced sexp")) |
| 3017 | (widget-put widget :error "Unbalanced sexp") | 3017 | (error (setq err (error-message-string data)))) |
| 3018 | widget) | 3018 | (if (not err) |
| 3019 | (error (widget-put widget :error (error-message-string data)) | 3019 | nil |
| 3020 | widget)))) | 3020 | (widget-put widget :error err) |
| 3021 | widget)))) | ||
| 3021 | 3022 | ||
| 3022 | (defvar widget-sexp-prompt-value-history nil | 3023 | (defvar widget-sexp-prompt-value-history nil |
| 3023 | "History of input to `widget-sexp-prompt-value'.") | 3024 | "History of input to `widget-sexp-prompt-value'.") |