aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2012-11-19 13:40:18 -0500
committerStefan Monnier2012-11-19 13:40:18 -0500
commit1000d89524f28cc33341ae00c60ecc6994503f23 (patch)
tree2b9edd4e12307ca38244a8d5047830bea808d872
parentac5392dcfda42b26767ae966a8b290142c00bff7 (diff)
downloademacs-1000d89524f28cc33341ae00c60ecc6994503f23.tar.gz
emacs-1000d89524f28cc33341ae00c60ecc6994503f23.zip
* lisp/vc/diff-mode.el (diff-hunk): Don't make useless timers.
-rw-r--r--lisp/ChangeLog2
-rw-r--r--lisp/vc/diff-mode.el28
2 files changed, 17 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 50effda7a48..df0b8bd422f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,7 @@
12012-11-19 Stefan Monnier <monnier@iro.umontreal.ca> 12012-11-19 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * vc/diff-mode.el (diff-hunk): Don't make useless timers.
4
3 * files.el (load-file): Require match in minibuffer selection, as was 5 * files.el (load-file): Require match in minibuffer selection, as was
4 the case in Emacs-20 before we changed the spec to allow .elc files 6 the case in Emacs-20 before we changed the spec to allow .elc files
5 (bug#12935). 7 (bug#12935).
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index 26c64ce2ad3..0c023b0f7f4 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -575,19 +575,21 @@ next hunk if TRY-HARDER is non-nil; otherwise signal an error."
575(easy-mmode-define-navigation 575(easy-mmode-define-navigation
576 diff-hunk diff-hunk-header-re "hunk" diff-end-of-hunk diff-restrict-view 576 diff-hunk diff-hunk-header-re "hunk" diff-end-of-hunk diff-restrict-view
577 (when diff-auto-refine-mode 577 (when diff-auto-refine-mode
578 (setq diff--auto-refine-data (cons (current-buffer) (point-marker))) 578 (unless (prog1 diff--auto-refine-data
579 (run-at-time 0.0 nil 579 (setq diff--auto-refine-data
580 (lambda () 580 (cons (current-buffer) (point-marker))))
581 (when diff--auto-refine-data 581 (run-at-time 0.0 nil
582 (let ((buffer (car diff--auto-refine-data)) 582 (lambda ()
583 (point (cdr diff--auto-refine-data))) 583 (when diff--auto-refine-data
584 (setq diff--auto-refine-data nil) 584 (let ((buffer (car diff--auto-refine-data))
585 (with-local-quit 585 (point (cdr diff--auto-refine-data)))
586 (when (buffer-live-p buffer) 586 (setq diff--auto-refine-data nil)
587 (with-current-buffer buffer 587 (with-local-quit
588 (save-excursion 588 (when (buffer-live-p buffer)
589 (goto-char point) 589 (with-current-buffer buffer
590 (diff-refine-hunk))))))))))) 590 (save-excursion
591 (goto-char point)
592 (diff-refine-hunk))))))))))))
591 593
592(easy-mmode-define-navigation 594(easy-mmode-define-navigation
593 diff-file diff-file-header-re "file" diff-end-of-file) 595 diff-file diff-file-header-re "file" diff-end-of-file)