Function: widget-prompt-value

widget-prompt-value is an autoloaded and byte-compiled function defined in wid-edit.el.gz.

Signature

(widget-prompt-value WIDGET PROMPT &optional VALUE UNBOUND)

Documentation

Prompt for a value matching WIDGET, using PROMPT.

The current value is assumed to be VALUE, unless UNBOUND is non-nil.

Source Code

;; Defined in /usr/src/emacs/lisp/wid-edit.el.gz
;;; Helper functions.
;;
;; These are widget specific.

;;;###autoload
(defun widget-prompt-value (widget prompt &optional value unbound)
  "Prompt for a value matching WIDGET, using PROMPT.
The current value is assumed to be VALUE, unless UNBOUND is non-nil."
  (setq widget (ensure-list widget))
  (setq prompt (format "[%s] %s" (widget-type widget) prompt))
  (setq widget (widget-convert widget))
  (let ((answer (widget-apply widget :prompt-value prompt value unbound)))
    (unless (widget-apply widget :match answer)
      (error "Value does not match %S type" (car widget)))
    answer))