emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 730ea4c: Fix problem with next-error-message-highlight in *Occur*


From: Lars Ingebrigtsen
Subject: master 730ea4c: Fix problem with next-error-message-highlight in *Occur*
Date: Thu, 15 Oct 2020 03:17:53 -0400 (EDT)

branch: master
commit 730ea4c370826277501ff3e364a5e5e92387bd5d
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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.
---
 lisp/simple.el | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/lisp/simple.el b/lisp/simple.el
index a24f284..bd19969 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)))))
 
 
 ;;;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]