Function: calendar-read-sexp

calendar-read-sexp is a byte-compiled function defined in calendar.el.gz.

Signature

(calendar-read-sexp PROMPT PREDICATE &optional DEFAULT &rest ARGS)

Documentation

Return an object read from the minibuffer.

Passes PROMPT, DEFAULT, and ARGS to format-prompt to build the actual prompt. PREDICATE is called with a single value (the object the user entered) and it should return non-nil if that value is a valid choice. DEFAULT is the default value to use.

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/calendar.el.gz
(defun calendar-read-sexp (prompt predicate &optional default &rest args)
  "Return an object read from the minibuffer.
Passes PROMPT, DEFAULT, and ARGS to `format-prompt' to build
the actual prompt.  PREDICATE is called with a single value (the object
the user entered) and it should return non-nil if that value is a valid choice.
DEFAULT is the default value to use."
  (unless (stringp default) (setq default (format "%S" default)))
  (named-let query ()
    ;; The call to `read-from-minibuffer' is copied from `read-minibuffer',
    ;; except it's changed to use the DEFAULT arg instead of INITIAL-CONTENTS.
    (let ((value (read-from-minibuffer
                  (apply #'format-prompt prompt default args)
                  nil minibuffer-local-map t 'minibuffer-history default)))
      (if (funcall predicate value)
          value
        (query)))))