How to use embark and denote-open-or-create to jump to a file in dired? #524
Replies: 4 comments 3 replies
-
|
What is the actual filesystem path you have there? The error here suggests it gets the wrong path, so this might give us a clue as to how to proceed: |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
By the way, I tried what you did with Embark and it worked as expected. |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
From: Alan Schmitt ***@***.***>
Date: Wed, 15 Jan 2025 06:43:45 -0800
Does it work as well when you change your current directory to something unrelated to the denote one?
It works when I am using consult-denote-mode, but otherwise I get the
problem you describe.
Does this change fix the issue on your end?
denote.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/denote.el b/denote.el
index 02d3374..e3b1061 100644
--- a/denote.el
+++ b/denote.el
@@ -1430,7 +1430,8 @@ (defun denote-file-prompt (&optional files-matching-regexp prompt-text no-requir
With optional NO-REQUIRE-MATCH, accept the given input as-is.
Return the absolute path to the matching file."
- (let* ((relative-files (mapcar #'denote-get-file-name-relative-to-denote-directory
+ (let* ((default-directory (denote-directory))
+ (relative-files (mapcar #'denote-get-file-name-relative-to-denote-directory
(denote-directory-files files-matching-regexp :omit-current)))
(prompt (format "%s in %s: "
(or prompt-text "Select FILE")
…--
Protesilaos Stavrou
https://protesilaos.com
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
brabalan
-
|
From: Alan Schmitt ***@***.***>
Date: Thu, 16 Jan 2025 00:48:23 -0800
It works, thanks a lot! (And I really need to look at consult-denote…)
I pushed the change. Thank you!
…--
Protesilaos Stavrou
https://protesilaos.com
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I wanted to reveal a file that I had searched for using
denote-open-or-create, so while it was selected (in vertico), I invokedembarkand the jump actionj. The problem is that it callsdired-jumpwith a file name that is relative todenote-directory, so it fails if the current directory is not that one. For instance, I am in some teaching directory and I want to open a note that is in a notes subdirectory of my denote-directory. But in this trace the denote-directory is not taken into account at all.Is there a way to use embark with files listed with
denote-open-or-create?Beta Was this translation helpful? Give feedback.
All reactions