Function: read-string-from-buffer
read-string-from-buffer is an autoloaded and byte-compiled function
defined in string-edit.el.gz.
Signature
(read-string-from-buffer PROMPT STRING)
Documentation
Switch to a new buffer to edit STRING in a recursive edit.
The user finishes editing with C-c C-c (string-edit-done), or aborts with C-c C-k (string-edit-abort)).
PROMPT will be inserted at the start of the buffer, but won't be included in the resulting string. If nil, no prompt will be inserted in the buffer.
When the user exits recursive edit, this function returns the edited STRING.
Also see string-edit.
Probably introduced at or before Emacs version 29.1.
Source Code
;; Defined in /usr/src/emacs/lisp/textmodes/string-edit.el.gz
;;;###autoload
(defun read-string-from-buffer (prompt string)
"Switch to a new buffer to edit STRING in a recursive edit.
The user finishes editing with \\<string-edit-mode-map>\\[string-edit-done], or aborts with \\<string-edit-mode-map>\\[string-edit-abort]).
PROMPT will be inserted at the start of the buffer, but won't be
included in the resulting string. If nil, no prompt will be
inserted in the buffer.
When the user exits recursive edit, this function returns the
edited STRING.
Also see `string-edit'."
(string-edit
prompt
string
(lambda (edited)
(setq string edited)
(exit-recursive-edit))
:abort-callback (lambda ()
(exit-recursive-edit)
(error "Aborted edit")))
(recursive-edit)
string)