emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r110951: * lisp/vc/diff-mode.el (diff


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110951: * lisp/vc/diff-mode.el (diff-hunk): Don't make useless timers.
Date: Mon, 19 Nov 2012 13:40:18 -0500
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110951
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Mon 2012-11-19 13:40:18 -0500
message:
  * lisp/vc/diff-mode.el (diff-hunk): Don't make useless timers.
modified:
  lisp/ChangeLog
  lisp/vc/diff-mode.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-11-19 18:27:25 +0000
+++ b/lisp/ChangeLog    2012-11-19 18:40:18 +0000
@@ -1,5 +1,7 @@
 2012-11-19  Stefan Monnier  <address@hidden>
 
+       * vc/diff-mode.el (diff-hunk): Don't make useless timers.
+
        * files.el (load-file): Require match in minibuffer selection, as was
        the case in Emacs-20 before we changed the spec to allow .elc files
        (bug#12935).

=== modified file 'lisp/vc/diff-mode.el'
--- a/lisp/vc/diff-mode.el      2012-11-08 17:31:53 +0000
+++ b/lisp/vc/diff-mode.el      2012-11-19 18:40:18 +0000
@@ -575,19 +575,21 @@
 (easy-mmode-define-navigation
  diff-hunk diff-hunk-header-re "hunk" diff-end-of-hunk diff-restrict-view
  (when diff-auto-refine-mode
-   (setq diff--auto-refine-data (cons (current-buffer) (point-marker)))
-   (run-at-time 0.0 nil
-                (lambda ()
-                  (when diff--auto-refine-data
-                    (let ((buffer (car diff--auto-refine-data))
-                          (point (cdr diff--auto-refine-data)))
-                      (setq diff--auto-refine-data nil)
-                      (with-local-quit
-                        (when (buffer-live-p buffer)
-                          (with-current-buffer buffer
-                            (save-excursion
-                              (goto-char point)
-                              (diff-refine-hunk)))))))))))
+   (unless (prog1 diff--auto-refine-data
+             (setq diff--auto-refine-data
+                   (cons (current-buffer) (point-marker))))
+     (run-at-time 0.0 nil
+                  (lambda ()
+                    (when diff--auto-refine-data
+                      (let ((buffer (car diff--auto-refine-data))
+                            (point (cdr diff--auto-refine-data)))
+                        (setq diff--auto-refine-data nil)
+                        (with-local-quit
+                          (when (buffer-live-p buffer)
+                            (with-current-buffer buffer
+                              (save-excursion
+                                (goto-char point)
+                                (diff-refine-hunk))))))))))))
 
 (easy-mmode-define-navigation
  diff-file diff-file-header-re "file" diff-end-of-file)


reply via email to

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