emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] scratch/raeburn-startup 4a6ef22 12/43: Save and restore de


From: Ken Raeburn
Subject: [Emacs-diffs] scratch/raeburn-startup 4a6ef22 12/43: Save and restore default values, and buffer-local setting.
Date: Mon, 31 Jul 2017 02:11:00 -0400 (EDT)

branch: scratch/raeburn-startup
commit 4a6ef227e9e02785d66abd1600e88fa1ec01ba2b
Author: Ken Raeburn <address@hidden>
Commit: Ken Raeburn <address@hidden>

    Save and restore default values, and buffer-local setting.
    
    * lisp/loadup.el: When dumping symbol values, write out the default
    value, not the current value.  If the variable is marked as
    local-if-set, emit a make-variable-buffer-local call.
---
 lisp/loadup.el | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/lisp/loadup.el b/lisp/loadup.el
index 9c1f866..cb328dd 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -507,7 +507,7 @@ lost after dumping")))
                    nil
                  (push `(fset ',s ,(macroexp-quote (symbol-function s)))
                        cmds))))
-           (when (and (boundp s)
+           (when (and (default-boundp s)
                       (not (macroexp--const-symbol-p s 'any-value))
                       ;; I think we don't need/want these!
                       (not (memq s '(terminal-frame obarray
@@ -518,7 +518,7 @@ lost after dumping")))
                                      process-environment
                                      command-line-args noninteractive))))
              ;; FIXME: Handle varaliases!
-             (let ((v (symbol-value s)))
+             (let ((v (default-value s)))
                (push `(set-default
                        ',s
                        ,(cond
@@ -539,6 +539,14 @@ lost after dumping")))
                              ol))
                          (v (macroexp-quote v))))
                      cmds)
+               ;; Local variables: make-variable-buffer-local,
+               ;; make-local-variable, and make-variable-frame-local.
+               ;;
+               ;; We may need better introspection facilities to get
+               ;; this right.  For now, assume only the first kind is
+               ;; in use during loadup.
+               (if (local-variable-if-set-p s)
+                   (push `(make-variable-buffer-local ',s) cmds))
                (if (special-variable-p s)
                    ;; A dummy initializer is needed for defvar to mark
                    ;; the variable as special.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]