Function: auth-source-format-prompt

auth-source-format-prompt is a byte-compiled function defined in auth-source.el.gz.

Signature

(auth-source-format-prompt PROMPT ALIST)

Documentation

Format PROMPT using %x (for any character x) specifiers in ALIST.

Remove trailing ": ".

Source Code

;; Defined in /usr/src/emacs/lisp/auth-source.el.gz
(defun auth-source-format-prompt (prompt alist)
  "Format PROMPT using %x (for any character x) specifiers in ALIST.
Remove trailing \": \"."
  (setq prompt (replace-regexp-in-string ":\\s-*$" "" prompt))
  (dolist (cell alist)
    (let ((c (nth 0 cell))
          (v (nth 1 cell)))
      (when (and c v)
        (setq prompt (replace-regexp-in-string (format "%%%c" c)
                                               (format "%s" v)
                                               prompt nil t)))))
  prompt)