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

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

[elpa] externals/embark b48412f62c 2/2: Merge pull request #643 from min


From: ELPA Syncer
Subject: [elpa] externals/embark b48412f62c 2/2: Merge pull request #643 from minad/fix-projectless
Date: Fri, 16 Jun 2023 18:58:15 -0400 (EDT)

branch: externals/embark
commit b48412f62c07e056425044e7d528a0aae2ee8d8b
Merge: c59e0284f0 5d560e2b3e
Author: Omar AntolĂ­n Camarena <omar.antolin@gmail.com>
Commit: GitHub <noreply@github.com>

    Merge pull request #643 from minad/fix-projectless
    
    Fix projectless search of Consult async commands
---
 embark-consult.el |  7 ++++---
 embark.el         | 22 +++++++++++++---------
 2 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/embark-consult.el b/embark-consult.el
index 549cd8427d..68105e0fe7 100644
--- a/embark-consult.el
+++ b/embark-consult.el
@@ -387,9 +387,10 @@ for any action that is a Consult async command."
 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))))
+  (if (embark--associated-directory target type)
+      (let (consult-project-function)
+        (apply run :target target :type type rest))
+    (apply run :target target :type type rest)))
 
 (map-keymap
  (lambda (_key cmd)
diff --git a/embark.el b/embark.el
index 2b7c769498..4db46adc56 100644
--- a/embark.el
+++ b/embark.el
@@ -3996,15 +3996,19 @@ the REST of the arguments."
   "Return directory associated to TARGET of given TYPE.
 The supported values of TYPE are file, buffer, bookmark and
 library, which have an obvious notion of associated directory."
-  (pcase type
-    ('file
-     (file-name-directory target))
-    ('buffer
-     (buffer-local-value 'default-directory (get-buffer target)))
-    ('bookmark
-     (file-name-directory (bookmark-location target)))
-    ('library
-     (file-name-directory (locate-library target)))))
+  (setq target (pcase type
+                 ('file
+                  target)
+                 ('buffer
+                  (buffer-local-value 'default-directory (get-buffer target)))
+                 ('bookmark
+                  (bookmark-location target))
+                 ('library
+                  (locate-library target))))
+  (when target
+    (if (file-directory-p target)
+        (file-name-as-directory target)
+      (file-name-directory target))))
 
 (autoload 'bookmark-location "bookmark")
 (cl-defun embark--cd (&rest rest &key run target type &allow-other-keys)



reply via email to

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