1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

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)
This commit is contained in:
Juri Linkov 2018-04-17 22:27:48 +03:00
parent d12800303f
commit 0c9e3df3c2
6 changed files with 88 additions and 77 deletions

View file

@ -540,9 +540,11 @@ SELECT is `quit', also quit the *xref* window."
Non-interactively, non-nil QUIT means to first quit the *xref*
buffer."
(interactive)
(let ((xref (or (xref--item-at-point)
(let ((buffer (current-buffer))
(xref (or (xref--item-at-point)
(user-error "No reference at point"))))
(xref--show-location (xref-item-location xref) (if quit 'quit t))))
(xref--show-location (xref-item-location xref) (if quit 'quit t))
(next-error-found buffer (current-buffer))))
(defun xref-quit-and-goto-xref ()
"Quit *xref* buffer, then jump to xref on current line."