Function: help-fns-edit-mode-done

help-fns-edit-mode-done is an interactive and byte-compiled function defined in help-fns.el.gz.

Signature

(help-fns-edit-mode-done &optional KILL)

Documentation

Update the value of the variable being edited and kill the edit buffer.

If KILL (the prefix), don't update the value, but just kill the current buffer.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/help-fns.el.gz
(defun help-fns-edit-mode-done (&optional kill)
  "Update the value of the variable being edited and kill the edit buffer.
If KILL (the prefix), don't update the value, but just kill the
current buffer."
  (interactive "P" help-fns--edit-value-mode)
  (unless help-fns--edit-variable
    (error "Invalid buffer"))
  (goto-char (point-min))
  (cl-destructuring-bind (variable _ buffer help-buffer)
      help-fns--edit-variable
    (unless (buffer-live-p buffer)
      (error "Original buffer is gone; can't update"))
    (unless kill
      (let ((value (read (current-buffer))))
        (with-current-buffer buffer
          (set variable value))))
    (kill-buffer (current-buffer))
    (when (buffer-live-p help-buffer)
      (with-current-buffer help-buffer
        (revert-buffer)))))