From: Lars Ingebrigtsen Date: Thu, 15 Oct 2020 07:17:45 +0000 (+0200) Subject: Fix problem with next-error-message-highlight in *Occur* X-Git-Tag: emacs-28.0.90~5630 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=730ea4c370826277501ff3e364a5e5e92387bd5d;p=emacs.git Fix problem with next-error-message-highlight in *Occur* * lisp/simple.el (next-error-message-highlight): This function is called directly, so clean up the code a bit (bug#32676). (next-error-found): Pass in the error buffer. --- diff --git a/lisp/simple.el b/lisp/simple.el index a24f2844aa3..bd19969341f 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -393,7 +393,7 @@ and TO-BUFFER is a target buffer." (when next-error-recenter (recenter next-error-recenter)) (funcall next-error-found-function from-buffer to-buffer) - (next-error-message-highlight) + (next-error-message-highlight from-buffer) (run-hooks 'next-error-hook)) (defun next-error-select-buffer (buffer) @@ -478,20 +478,18 @@ buffer causes automatic display of the corresponding source code location." (next-error-no-select 0)) (error t)))) -(defun next-error-message-highlight () +(defun next-error-message-highlight (error-buffer) "Highlight the current error message in the ‘next-error’ buffer." (when next-error-message-highlight - (with-current-buffer next-error-last-buffer + (with-current-buffer error-buffer (when next-error--message-highlight-overlay (delete-overlay next-error--message-highlight-overlay)) - (save-excursion - (goto-char compilation-current-error) - (let ((ol (make-overlay (line-beginning-position) (line-end-position)))) - ;; do not override region highlighting - (overlay-put ol 'priority -50) - (overlay-put ol 'face 'next-error-message) - (overlay-put ol 'window (get-buffer-window)) - (setf next-error--message-highlight-overlay ol)))))) + (let ((ol (make-overlay (line-beginning-position) (line-end-position)))) + ;; do not override region highlighting + (overlay-put ol 'priority -50) + (overlay-put ol 'face 'next-error-message) + (overlay-put ol 'window (get-buffer-window)) + (setf next-error--message-highlight-overlay ol))))) ;;;