Function: combobulate-envelope-prompt

combobulate-envelope-prompt is a natively compiled function defined in combobulate-envelope.el.

Signature

(combobulate-envelope-prompt PROMPT DEFAULT-VALUE &optional BUFFER UPDATE-FN INITIAL-CONTENTS MAP)

Documentation

Insert text into fields using the minibuffer with PROMPT and DEFAULT-VALUE.

BUFFER if optionally the buffer (and its associated window) to use. If it is nil, then current-buffer is used.

UPDATE-FN is a function that is called after post-command-hook is triggered in the minibuffer. It is passed the current minibuffer contents.

INITIAL-CONTENTS is the initial contents of the minibuffer prompt.

MAP is the keymap to use for the minibuffer. It defaults to combobulate-envelope-prompt-map.

Source Code

;; Defined in /nix/store/b5fvrwzi3zvkabyzx0in6gw1cj963z46-emacs-packages-deps/share/emacs/site-lisp/combobulate-envelope.el
(defun combobulate-envelope-prompt (prompt default-value &optional buffer update-fn initial-contents map)
  "Insert text into fields using the minibuffer with PROMPT and DEFAULT-VALUE.

BUFFER if optionally the buffer (and its associated window) to use. If
it is nil, then `current-buffer' is used.

UPDATE-FN is a function that is called after `post-command-hook' is
triggered in the minibuffer. It is passed the current minibuffer
contents.

INITIAL-CONTENTS is the initial contents of the minibuffer prompt.

MAP is the keymap to use for the minibuffer. It defaults to
`combobulate-envelope-prompt-map'."
  (let ((win (when (eq (window-buffer) (or buffer (current-buffer)))
               (selected-window))))
    (minibuffer-with-setup-hook
        (lambda ()
          (setq combobulate-envelope-prompt-window win)
          ;; Required for things that set intangible properties on
          ;; text.
          (cursor-intangible-mode 1)
          ;; If INITIAL-CONTENTS is not empty then the point is placed
          ;; at the end of the text, which is probably not what people
          ;; want?
          (beginning-of-line)
          ;; not presently used.
          ;; (add-hook 'minibuffer-exit-hook #'combobulate-envelope-prompt-exit nil t)
          (add-hook 'post-command-hook update-fn nil t))
      (read-from-minibuffer
       (format-prompt
        (concat combobulate-sigil " " prompt)
        (or default-value (car combobulate-envelope-prompt-history) ""))
       initial-contents
       (or map combobulate-envelope-prompt-map)
       nil
       'combobulate-envelope-prompt-history
       (car combobulate-envelope-prompt-history)
       'inherit-input-method))))