emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] scratch/raeburn-startup bb26722 3/4: Save and restore defa


From: Ken Raeburn
Subject: [Emacs-diffs] scratch/raeburn-startup bb26722 3/4: Save and restore default values, and buffer-local setting.
Date: Thu, 2 Feb 2017 08:28:55 +0000 (UTC)

branch: scratch/raeburn-startup
commit bb2672214666dd8f1a4def600e31556c1ccc8a0a
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 482d6fa..6bc4833 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -499,7 +499,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
@@ -510,7 +510,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
@@ -536,6 +536,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]