Function: help-fns-edit-variable

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

Signature

(help-fns-edit-variable)

Documentation

Edit the variable value at point in "*Help*" buffer.

This command only works if help-enable-variable-value-editing is non-nil.

To edit the value of a variable, use C-h v (describe-variable) followed by the name of a variable, to display a "*Help*" buffer, move point to the variable's value, usually after the text "Its value is", and type \e to invoke this command.

Values that aren't readable by the Emacs Lisp reader can't be edited by this command.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/help-fns.el.gz
(defun help-fns-edit-variable ()
  "Edit the variable value at point in \"*Help*\" buffer.
This command only works if `help-enable-variable-value-editing' is non-nil.

To edit the value of a variable, use \\[describe-variable] followed by the name
of a variable, to display a \"*Help*\" buffer, move point to
the variable's value, usually after the text \"Its value is\", and
type \\`e' to invoke this command.

Values that aren't readable by the Emacs Lisp reader can't be edited
by this command."
  (declare (completion ignore))
  (interactive)
  (let ((var (get-text-property (point) 'help-fns--edit-variable)))
    (unless var
      (error "No variable under point"))
    (string-edit
     (format ";; Edit the `%s' variable." (nth 0 var))
     (prin1-to-string (nth 1 var))
     (lambda (edited)
       (set (nth 0 var) edited)
       (exit-recursive-edit))
     :abort-callback
     (lambda ()
       (exit-recursive-edit)
       (error "Aborted edit, variable unchanged"))
     :major-mode-sym #'emacs-lisp-mode
     :read #'read)
    (recursive-edit)
    (revert-buffer)))