emacs - How can I get a variable's initial value in Elisp? -
emacs - How can I get a variable's initial value in Elisp? -
in emacs lisp, there function initial value of symbol initilized defvar
? some-function
shown below:
(defvar var "initial value") (setq var "changed value") (some-function 'var) => "inital value"
emacs doesn't remember initial value. if evaluate
(defvar var "initial value") (setq var "changed value")
in *scratch*
buffer, "initial value"
no longer available, total stop.
if defvar
performed in loaded file, emacs remembers it's loaded from; (symbol-file var 'defvar)
returns file name, , can original look variable initialized (but not original value), assuming file still around. available via command m-x find-variable.
emacs elisp
Comments
Post a Comment