I would like to add an alternative answer to the thread How do I force re-evaluation of a defvar? Before doing so, however, I would like to learn how to eliminate the single-quote to prevent evaluation of the argument INPUT to the new function defvar-reevaluate
. Perhaps I need a macro instead of a function ....?
BEFORE:
(defun defvar-reevaluate (input)
"Force revelaution of a defvar."
(let* ((string (prin1-to-string input))
(form (read string))
(form (elisp--eval-defun-1 (macroexpand form))))
(eval form)))
(defvar-reevaluate
'(defvar undo-auto--this-command-amalgamating "hello-world"
"My new doc-string"))
AFTER -- without the single quote.
(defvar-reevaluate
(defvar undo-auto--this-command-amalgamating "hello-world"
"My new doc-string"))