summaryrefslogtreecommitdiff
path: root/lisp/vc/diff-mode.el
diff options
context:
space:
mode:
authorJuri Linkov <juri@linkov.net>2018-04-17 22:27:48 +0300
committerJuri Linkov <juri@linkov.net>2018-04-17 22:27:48 +0300
commit0c9e3df3c2088b61feb4b4e00d24419459962273 (patch)
tree9bfff6c4dc06dc3c64c1eeb3810e2b1c829d11f4 /lisp/vc/diff-mode.el
parentd12800303fc1f3f6c45806ee0b1e638d20478938 (diff)
downloademacs-0c9e3df3c2088b61feb4b4e00d24419459962273.tar.gz
emacs-0c9e3df3c2088b61feb4b4e00d24419459962273.tar.bz2
emacs-0c9e3df3c2088b61feb4b4e00d24419459962273.zip
Use next-error-found to set next-error-last-buffer.
https://lists.gnu.org/archive/html/emacs-devel/2018-04/msg00207.html * lisp/simple.el (next-error-buffer): New buffer-local variable instead of making buffer-local next-error-last-buffer. (Bug#20489) (next-error-found-function): New defcustom. (next-error-buffer-on-selected-frame): Use t for avoid-current arg of next-error-buffer-p. (next-error-find-buffer): Add second rule for using the current next-error-buffer if it's not visited by other navigation. (next-error, next-error-internal): Call next-error-found. (next-error-found): New function with body extracted mostly from next-error. * lisp/vc/add-log.el (change-log-goto-source-internal): New function with body from change-log-goto-source. (change-log-goto-source): Call change-log-goto-source-internal and next-error-found. (change-log-next-error): Call change-log-goto-source-internal instead of change-log-goto-source. (change-log-mode): Don't set next-error-last-buffer. (Bug#28864) * lisp/vc/diff-mode.el (diff-goto-source): Call next-error-found. * lisp/progmodes/xref.el (xref-goto-xref): Call next-error-found. * lisp/replace.el (occur-mode-goto-occurrence) (occur-mode-goto-occurrence-other-window) (occur-mode-display-occurrence): Call next-error-found. (occur-next-error): Remove unnecessary with-current-buffer. (Bug#27362, bug#30646)
Diffstat (limited to 'lisp/vc/diff-mode.el')
-rw-r--r--lisp/vc/diff-mode.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index ef13f55b931..1e2fbb97fcf 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -1874,11 +1874,13 @@ then `diff-jump-to-old-file' is also set, for the next invocations."
;; the old location, and else to the new (i.e. as if reverting).
;; This is a convenient detail when using smerge-diff.
(if event (posn-set-point (event-end event)))
- (let ((rev (not (save-excursion (beginning-of-line) (looking-at "[-<]")))))
+ (let ((buffer (when event (current-buffer)))
+ (rev (not (save-excursion (beginning-of-line) (looking-at "[-<]")))))
(pcase-let ((`(,buf ,line-offset ,pos ,src ,_dst ,switched)
(diff-find-source-location other-file rev)))
(pop-to-buffer buf)
(goto-char (+ (car pos) (cdr src)))
+ (when buffer (next-error-found buffer (current-buffer)))
(diff-hunk-status-msg line-offset (diff-xor rev switched) t))))