Skip to content
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

Path in denote-backlinks buffer is wrong (extra directory in the link) #283

Closed
brabalan opened this issue Mar 9, 2024 · 5 comments
Closed

Comments

@brabalan
Copy link
Contributor

brabalan commented Mar 9, 2024

When I run denote-backlinks on a note, I get a listing of the form

Backlinks to "Marine Ludo" (20240209T154753)
--------------------------------------------

notes/20210323T111850--mot-malin__boardgame.org
notes/20230605T171758--trio__boardgame.org
notes/20230609T161606--phantom-ink__boardgame.org
notes/20230929T171050--lets-summon-demons__boardgame.org
notes/20240209T154425--6-qui-prend__boardgame.org

The problem is the extra notes/ at the beginning of each link, as denote-directory already includes it.

I don’t understand how xref works, so I don’t know how to debug this…

If it matters, my notes live in ~/Document/Org/notes, ~/Documents/Org is under version control, and I use projectile (so the path to the current projectile project is ~/Documents/Org when looking at the notes).

@jeanphilippegg
Copy link
Contributor

jeanphilippegg commented Mar 9, 2024

@protesilaos This is caused by commit ac0c361. When removing the modules, we also removed project.el integration (and xref integration). The function that we need back is denote-project-find.

You can see the differences when you evaluate this :

(xref--analyze (xref-matches-in-files "20240309T105635" (denote-directory-files nil t t)))

vs

(let ((project-find-functions #'denote-project-find)) (xref--analyze (xref-matches-in-files "20240309T105635" (denote-directory-files nil t t))))

The group names are relative to the project's root, which may not be denote-directory.

The solution is to bring back denote-project-find from this commit (or the section on project.el integration).

@brabalan Until it is fixed, you can evaluate (setq xref-file-name-display 'abs). Your results will be in absolute form, but they will work.

@brabalan
Copy link
Contributor Author

Thank you very much for the explanation and for the workaround.

protesilaos added a commit that referenced this issue Mar 13, 2024
We had removed this in commit ac0c361, thinking it was not necessary,
though Alan Schmitt reported a case where we actually needed this
functionality. This was reported in issue 283:
<#283>.

Thanks to Jean-Philippe Gagné Guay for identifying the regression and
for taking the initiative to bring back the feature in pull request
286: <#286>. We cannot merge
that one because it includes other in-development snippets.
@protesilaos
Copy link
Owner

Hello folks! I just pushed this commit:

commit 3e7273953aed79bb8fc6c10652ebd4a8d8ae4f4c
Author: Protesilaos Stavrou <info@protesilaos.com>
Date:   Wed Mar 13 09:18:34 2024 +0200

  Reinstate denote-project-find function for project/xref to work properly
  
  We had removed this in commit ac0c361, thinking it was not necessary,
  though Alan Schmitt reported a case where we actually needed this
  functionality. This was reported in issue 283:
  <https://github.com/protesilaos/denote/issues/283>.
  
  Thanks to Jean-Philippe Gagné Guay for identifying the regression and
  for taking the initiative to bring back the feature in pull request
  286: <https://github.com/protesilaos/denote/pull/286>. We cannot merge
  that one because it includes other in-development snippets.

 denote.el | 31 +++++++++++++++++++++++++++++--
 1 file changed, 29 insertions(+), 2 deletions(-)

@brabalan Please check if this works for you.

Thanks again @jeanphilippegg for identifying the problem!

@brabalan
Copy link
Contributor Author

I confirm all is well now. Thanks a lot for the quick fix!

@protesilaos
Copy link
Owner

protesilaos commented Mar 13, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants