branch: externals/consult
commit 56ba0b9b5e3799a53564c32462164f09063d0c52
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>

    Revert "consult-compile: Add g narrow key for grep locations"
    
    This reverts commit eae64815fbfa74327dcda9de3cb1b9a725d59b2d.
---
 README.org         |  4 ++--
 consult-compile.el | 15 ++++++++-------
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/README.org b/README.org
index 01a111fab7..f6b30ac78a 100644
--- a/README.org
+++ b/README.org
@@ -287,8 +287,8 @@ their descriptions.
 #+findex: consult-compile-error
 #+findex: consult-flymake
 #+findex: consult-xref
-- =consult-compile-error=: Jump to a compilation error or grep search result.
-  Supports live preview narrowing and recursive editing.
+- =consult-compile-error=: Jump to a compilation error. Supports live preview
+  narrowing and recursive editing.
 - =consult-flymake=: Jump to Flymake diagnostic. Supports live preview and
   recursive editing. The command supports narrowing. Press =e SPC=, =w SPC=, 
=n SPC=
   to only show errors, warnings and notes respectively.
diff --git a/consult-compile.el b/consult-compile.el
index 3486b62b6d..6b1f8aae26 100644
--- a/consult-compile.el
+++ b/consult-compile.el
@@ -31,8 +31,7 @@
 (defvar consult-compile--history nil)
 
 (defconst consult-compile--narrow
-  '((?g . "Grep")
-    (?e . "Error")
+  '((?e . "Error")
     (?w . "Warning")
     (?i . "Info")))
 
@@ -50,7 +49,6 @@
   "Return alist of errors and positions in BUFFER, a compilation buffer."
   (with-current-buffer buffer
     (let ((candidates)
-          (grep (and (derived-mode-p 'grep-mode 'grep-edit-mode) ?g))
           (pos (point-min)))
       (save-excursion
         (while (setq pos (compilation-next-single-property-change pos 
'compilation-message))
@@ -59,8 +57,10 @@
             (goto-char pos)
             (push (propertize
                    (consult-compile--font-lock (consult--buffer-substring pos 
(pos-eol)))
-                   'consult--type (or grep (pcase (compilation--message->type 
msg)
-                                             (0 ?i) (1 ?w) (_ ?e)))
+                   'consult--type (pcase (compilation--message->type msg)
+                                    (0 ?i)
+                                    (1 ?w)
+                                    (_ ?e))
                    'consult--candidate (point-marker))
                   candidates))))
       (nreverse candidates))))
@@ -82,8 +82,9 @@
   (consult--buffer-query
    :sort 'alpha :predicate
    (lambda (buffer)
-     (and (buffer-local-value 'compilation-locs buffer)
-          (file-in-directory-p file (buffer-local-value 'default-directory 
buffer))))))
+     (with-current-buffer buffer
+       (and (compilation-buffer-internal-p)
+            (file-in-directory-p file default-directory))))))
 
 (defun consult-compile--state ()
   "Like `consult--jump-state', also setting the current compilation error."

Reply via email to