1

After opening undo-tree-and-diff and enabling undo-tree-visualizer-toggle-diff by pressing d; I start to move in the history tree:

  • If I just press up or down cursore for few seconds ; undo-tree keeps moving on the history (on the direction I pressed the cursor) and I cannot stop it for a while like 5 to 10 seconds. Also each movement in the undo-tree is so slow.

I realize that using undo-tree-visualizer-toggle-diff was the main cause of this issue during moving on the undo-tree.

=> I am not sure is it the general behavior of undo-tree-visualizer-toggle-diff. Is there any way to fix it (make the process faster and stop the tree movement when cursor is not pressed) while keeping undo-tree-visualizer-toggle-diff enabled?


My configurations related to undo-tree:

(global-undo-tree-mode 1)
(setq undo-tree-auto-save-history t)
(setq undo-tree-history-directory-alist '(("." . "~/.emacs.d/undo")))

(defun my-undo-tree-save-history (undo-tree-save-history &rest args)
  (let ((message-log-max nil)
        (inhibit-message t))
    (apply undo-tree-save-history args)))

(advice-add 'undo-tree-save-history :around 'my-undo-tree-save-history)

(defun my-find-file-check-make-large-file-read-only-hook ()
  "If a file is over a given size, make the buffer read only."
  (when (> (buffer-size) (* 1024 1024))
    ; (setq buffer-read-only t)
    (buffer-disable-undo)
    (fundamental-mode)))

(setq undo-tree-show-minibuffer-help t)
(setq undo-tree-minibuffer-help-dynamic t)

(defun undo-tree-and-diff ()
  (interactive)
  (undo-tree-visualize)
  (undo-tree-visualizer-toggle-diff)) ;; d close toggle-diff

(global-set-key "\C-x\C-v" 'undo-tree-and-diff)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.