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

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

[elpa] externals/embark f313f6323a: When target has a directory, set con


From: ELPA Syncer
Subject: [elpa] externals/embark f313f6323a: When target has a directory, set consult-project-function=nil
Date: Tue, 13 Jun 2023 00:57:48 -0400 (EDT)

branch: externals/embark
commit f313f6323a37bd6090f88960a6650d5d1ec55054
Author: Omar Antolín Camarena <omar.antolin@gmail.com>
Commit: Omar Antolín Camarena <omar.antolin@gmail.com>

    When target has a directory, set consult-project-function=nil
    
    This fixes #641.
---
 embark-consult.el | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/embark-consult.el b/embark-consult.el
index 704826c08a..8d8f58bf39 100644
--- a/embark-consult.el
+++ b/embark-consult.el
@@ -214,6 +214,19 @@ This function is meant to be added to 
`embark-collect-mode-hook'."
 (setf (alist-get 'consult-grep embark-exporters-alist)
       #'embark-consult-export-grep)
 
+(cl-defun embark-consult--projectless
+    (&rest rest &key run target type &allow-other-keys)
+  "Run action with nil `consult-project-function', if TARGET has an directory.
+The values of TYPE which are considered to have an associated
+directory are: file, buffer, bookmark and library.  The REST of
+the arguments are also passed to RUN."
+  (when (embark--associated-directory target type)
+    (let (consult-project-function)
+      (apply run :target target :type type rest))))
+
+(cl-pushnew #'embark-consult--projectless
+            (alist-get 'consult-grep embark-around-action-hooks))
+
 ;;; Support for consult-xref
 
 (declare-function xref--show-xref-buffer "ext:xref")



reply via email to

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