aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2017-11-06 23:40:31 +0200
committerJuri Linkov2017-11-06 23:40:31 +0200
commit9071ac63aecf96879ec9807257c7b0cae8e8b18e (patch)
treefe85f3320ca0b3b3485ab459a166850c4b88be19
parent1d8f8851a414fb75e05a048559c03e02c0df1c42 (diff)
downloademacs-9071ac63aecf96879ec9807257c7b0cae8e8b18e.tar.gz
emacs-9071ac63aecf96879ec9807257c7b0cae8e8b18e.zip
Override possible change of next-error-last-buffer in next-error-function
* lisp/simple.el (next-error, next-error-internal): Setq next-error-last-buffer after next-error-function call. (Bug#28864)
-rw-r--r--lisp/simple.el33
1 files changed, 19 insertions, 14 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index 372e153d626..375a79e7662 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -279,23 +279,28 @@ To control which errors are matched, customize the variable
279`compilation-error-regexp-alist'." 279`compilation-error-regexp-alist'."
280 (interactive "P") 280 (interactive "P")
281 (if (consp arg) (setq reset t arg nil)) 281 (if (consp arg) (setq reset t arg nil))
282 (when (setq next-error-last-buffer (next-error-find-buffer)) 282 (let ((buffer (next-error-find-buffer)))
283 ;; we know here that next-error-function is a valid symbol we can funcall 283 (when buffer
284 (with-current-buffer next-error-last-buffer 284 ;; We know here that next-error-function is a valid symbol we can funcall
285 (funcall next-error-function (prefix-numeric-value arg) reset) 285 (with-current-buffer buffer
286 (when next-error-recenter 286 (funcall next-error-function (prefix-numeric-value arg) reset)
287 (recenter next-error-recenter)) 287 ;; Override possible change of next-error-last-buffer in next-error-function
288 (run-hooks 'next-error-hook)))) 288 (setq next-error-last-buffer buffer)
289 (when next-error-recenter
290 (recenter next-error-recenter))
291 (run-hooks 'next-error-hook)))))
289 292
290(defun next-error-internal () 293(defun next-error-internal ()
291 "Visit the source code corresponding to the `next-error' message at point." 294 "Visit the source code corresponding to the `next-error' message at point."
292 (setq next-error-last-buffer (current-buffer)) 295 (let ((buffer (current-buffer)))
293 ;; we know here that next-error-function is a valid symbol we can funcall 296 ;; We know here that next-error-function is a valid symbol we can funcall
294 (with-current-buffer next-error-last-buffer 297 (with-current-buffer buffer
295 (funcall next-error-function 0 nil) 298 (funcall next-error-function 0 nil)
296 (when next-error-recenter 299 ;; Override possible change of next-error-last-buffer in next-error-function
297 (recenter next-error-recenter)) 300 (setq next-error-last-buffer buffer)
298 (run-hooks 'next-error-hook))) 301 (when next-error-recenter
302 (recenter next-error-recenter))
303 (run-hooks 'next-error-hook))))
299 304
300(defalias 'goto-next-locus 'next-error) 305(defalias 'goto-next-locus 'next-error)
301(defalias 'next-match 'next-error) 306(defalias 'next-match 'next-error)