mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-30 12:21:25 -08:00
Avoid prompting when creating a restricted-sexp widget
* lisp/wid-edit.el (restricted-sexp): Turn value into a string before reading. (widget-field-value-create): Guard against value being nil, so the field can be created even if the widget has a bad default value. (Bug#59937)
This commit is contained in:
parent
a403e2832d
commit
a9210e8efd
1 changed files with 5 additions and 2 deletions
|
|
@ -2127,7 +2127,8 @@ the earlier input."
|
|||
;; `widget-setup' is called.
|
||||
(overlay (cons (make-marker) (make-marker))))
|
||||
(widget-put widget :field-overlay overlay)
|
||||
(insert value)
|
||||
(when value
|
||||
(insert value))
|
||||
(and size
|
||||
(< (length value) size)
|
||||
(insert-char ?\s (- size (length value))))
|
||||
|
|
@ -3655,7 +3656,9 @@ match-alternatives: %S"
|
|||
value
|
||||
(widget-get widget :match)
|
||||
(widget-get widget :match-alternatives))
|
||||
:warning))
|
||||
:warning)
|
||||
;; Make sure we will `read' a string.
|
||||
(setq value (prin1-to-string value)))
|
||||
(read value)))
|
||||
|
||||
(defun widget-restricted-sexp-match (widget value)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue