emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/undo-tree 35a438bee8 3/9: Fix how undo-tree-viualizer-t


From: Stefan Monnier
Subject: [elpa] externals/undo-tree 35a438bee8 3/9: Fix how undo-tree-viualizer-timestamps|diff are set buffer-local.
Date: Sat, 12 Mar 2022 18:02:55 -0500 (EST)

branch: externals/undo-tree
commit 35a438bee8222247aa1e173456d0fb3fac30994d
Author: Toby S. Cubitt <toby-undo-tree@dr-qubit.org>
Commit: Toby S. Cubitt <toby-undo-tree@dr-qubit.org>

    Fix how undo-tree-viualizer-timestamps|diff are set buffer-local.
    
    Major-mode fundctions call `kill-all-local-variables' at start, so these 
need
    to be made buffer-local *after* setting the major-mode to
    undo-tree-visualizer-mode, not before. We now set them buffer-local in
    undo-tree-visualizer-mode, which seems the appropriate place.
    
    (Thanks to Martin Joerg for flagging this.)
---
 undo-tree.el | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/undo-tree.el b/undo-tree.el
index 82ae5f7023..f4ee23f455 100644
--- a/undo-tree.el
+++ b/undo-tree.el
@@ -3564,11 +3564,8 @@ Note this will overwrite any existing undo history."
     (setq undo-tree-visualizer-initial-node (undo-tree-current undo-tree))
     (setq undo-tree-visualizer-spacing
          (undo-tree-visualizer-calculate-spacing))
-    (make-local-variable 'undo-tree-visualizer-timestamps)
-    (make-local-variable 'undo-tree-visualizer-diff)
     (setq buffer-undo-tree undo-tree)
     (undo-tree-visualizer-mode)
-    ;; FIXME; don't know why `undo-tree-visualizer-mode' clears this
     (setq buffer-undo-tree undo-tree)
     (set (make-local-variable 'undo-tree-visualizer-lazy-drawing)
         (or (eq undo-tree-visualizer-lazy-drawing t)
@@ -4201,7 +4198,9 @@ Within the undo-tree visualizer, the following keys are 
available:
   :abbrev-table nil
   (setq truncate-lines t)
   (setq cursor-type nil)
-  (setq undo-tree-visualizer-selected-node nil))
+  (setq undo-tree-visualizer-selected-node nil)
+  (make-local-variable 'undo-tree-visualizer-timestamps)
+  (make-local-variable 'undo-tree-visualizer-diff))
 
 
 (define-minor-mode undo-tree-visualizer-selection-mode



reply via email to

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