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

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

[elpa] externals/undo-tree bb92692 093/195: Don't override diff-switches


From: Stefan Monnier
Subject: [elpa] externals/undo-tree bb92692 093/195: Don't override diff-switches customization option in visualizer diff display.
Date: Sat, 28 Nov 2020 13:41:29 -0500 (EST)

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

    Don't override diff-switches customization option in visualizer diff 
display.
    Fixed bug in diff display that threw and error when at root of undo tree.
    Delete diff header showing buffer name and tmp file name.
---
 undo-tree.el | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/undo-tree.el b/undo-tree.el
index 4c57e00..67a6eb3 100644
--- a/undo-tree.el
+++ b/undo-tree.el
@@ -475,6 +475,10 @@
 ;; selected state, i.e. it shows you the changes that will be applied if you
 ;; reset to the selected state.
 ;;
+;; (Note that the diff is generated by the Emacs `diff' command, and is
+;; displayed using `diff-mode'. See the corresponding customization groups if
+;; you want to customize the diff display.)
+;;
 ;; Finally, hitting "q" will quit the visualizer, leaving the parent buffer in
 ;; whatever state you ended at.
 ;;
@@ -3484,17 +3488,17 @@ at mouse event POS."
     ;; generate diff
     (let ((undo-tree-inhibit-kill-visualizer t)
          (current (undo-tree-current buffer-undo-tree)))
-      (undo-tree-set (or node (undo-tree-node-previous current)))
+      (undo-tree-set (or node (undo-tree-node-previous current) current))
       (setq tmpfile (diff-file-local-copy (current-buffer)))
       (undo-tree-set current))
     (setq buff (diff-no-select
-               (current-buffer) tmpfile "-u" 'noasync
+               (current-buffer) tmpfile nil 'noasync
                (get-buffer-create "*Diff") ;(concat " *undo-tree-diff*")
                ))
-    ;; delete process messages from diff buffer
+    ;; delete process messages and useless headers from diff buffer
     (with-current-buffer buff
       (goto-char (point-min))
-      (delete-region (point) (1+ (line-end-position)))
+      (delete-region (point) (1+ (line-end-position 3)))
       (goto-char (point-max))
       (forward-line -2)
       (delete-region (point) (point-max))



reply via email to

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