New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Org links do not work between notes created in parent directories. #121
Comments
Can you please give me a sample directory structure to try this? You mean a link from a subdirectory to the parent directory?
This will require a change to I guess this depends on the directory structure, though I find the new prompt just as easy to use. For example, I have a |
Yes, for instance:
Or something like this with similar nesting.
I also think that the new behavior is better. I'm not suggesting modifying I don't think that using directories in the mentioned way is an unusual workflow. The link problem is the main issue and the suggested command is just for convenience, |
I cannot reproduce this. Maybe you are experiencing this problem in a "silo"?
It will be tricky to add it directly to denote.el as it will set a precedent for multiple styles of prompt. Though we can document it in the manual. Here is the idea: (defun denote-file-prompt-original (&optional initial-text)
"Prompt for file with identifier in variable `denote-directory'.
With optional INITIAL-TEXT, use it to prepopulate the minibuffer."
(read-file-name "Select note: " (denote-directory) nil nil initial-text
(lambda (f)
(or (denote-file-has-identifier-p f)
(file-directory-p f)))))
(defun my-denote-link ()
"Call `denote-link' but use the generic file prompt.
See `denote-file-prompt-original'."
(interactive)
(cl-letf (((symbol-function 'denote-file-prompt) #'denote-file-prompt-original))
(call-interactively #'denote-link))) |
You are probably right, I used to use the old (a few months ago) method of adding a Thanks for the code suggestion this what I was trying to do (unsuccessfully using let instead of |
Okay. I will keep this issue open until we have a clear picture.
You are welcome! I will add this as an example in the manual. |
This is my solution to a request made by Mirko Hernandez on the possible use of the old Denote file prompt. It is better not to introduce a user option for this case, nor to keep multiple variants of the 'denote-file-prompt' in denote.el, as we want to avoid confusing the users. Mirko's feedback was provided in issue 121 on the GitHub mirror: <#121>.
I can confirm that the links work as expected in a normal configuration. I had set up a The advantage of the mentioned setup is that a call to denote (or denote-link) inside any directory (using dired or in any buffer) creates the note in the expected place, otherwise the notes are created in the root dir (I believe this is the intended behavior but not ideal for a workflow in which, almost exclusively, notes are created inside directories) . With the suggested function I have everything I need to link between directories without any problem, thanks @protesilaos. For documentation purposes this is how everything is set:
|
I believe this is related to issue #114.
Creating notes in directories and then opening org links between them leads to an error
Wrong type argument: stringp, nil
(The links do not work towards a note in a parent directory).
My current workaround is to point
denote-directory
to a root directory in a function and use that instead of org-open-at-point.(also to open the link in the same window).
My previous solution involved applying the same to
denote-link-ol-follow
.On a related note, the 1.2.0 version includes a new version of
denote-link
using a differentdenote-file-prompt
. I really like the new version but would it be possible to have the old behavior as a new function ?. It was very convenient for linking notes in different directories.Also thanks a lot @protesilaos for the new signature features. I will be testing and using those a lot this week.
The text was updated successfully, but these errors were encountered: