emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/ivy-hydra e7146dc 066/395: counsel.el (counsel--compila


From: Basil L. Contovounesios
Subject: [elpa] externals/ivy-hydra e7146dc 066/395: counsel.el (counsel--compilation-errors-buffer): Simplify
Date: Thu, 25 Feb 2021 08:31:33 -0500 (EST)

branch: externals/ivy-hydra
commit e7146dc160880099f24a002f7d542c5c996543c7
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>

    counsel.el (counsel--compilation-errors-buffer): Simplify
    
    Re #2299
---
 counsel.el | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/counsel.el b/counsel.el
index bdd400a..c401b4f 100644
--- a/counsel.el
+++ b/counsel.el
@@ -6243,17 +6243,18 @@ We update it in the callback with 
`ivy-update-candidates'."
   (with-current-buffer buf
     (let ((res nil)
           (pt (point-min)))
-      (while (setq pt (compilation-next-single-property-change
-                       pt 'compilation-message))
-        (let ((loc (get-text-property pt 'compilation-message)))
-          (when (and loc (setq loc (compilation--message->loc loc)))
-            (let* ((fs (compilation--loc->file-struct loc))
-                   (file-name (caar fs))
-                   (line-number (compilation--loc->line loc)))
-              (push (propertize
-                     (format "%d:%s" line-number file-name)
-                     'pt pt
-                     'buffer buf) res)))))
+      (save-excursion
+        (while (setq pt (compilation-next-single-property-change
+                         pt 'compilation-message))
+          (let ((loc (get-text-property pt 'compilation-message)))
+            (when (and loc (setq loc (compilation--message->loc loc)))
+              (goto-char pt)
+              (push
+               (propertize
+                (buffer-substring-no-properties pt (line-end-position))
+                'pt pt
+                'buffer buf)
+               res)))))
       (nreverse res))))
 
 (defun counsel-compilation-errors-cands ()



reply via email to

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