protesilaos / denote

Simple notes for Emacs with an efficient file-naming scheme
https://protesilaos.com/emacs/denote
GNU General Public License v3.0
545 stars 55 forks source link

Rework denote-link-return-links (fix issue #416) #419

Closed jeanphilippegg closed 3 months ago

jeanphilippegg commented 3 months ago

I have reworked denote-link-return-links to limit the use of with-temp-buffer to get what we need.

You will notice that I reverted your last change to denote-link-return-links because you added a new parameter to denote-link--expand-identifiers, but it is used in denote-org-extras.el. It must have broken something there. I have kept denote-link--expand-identifiers because it is used there, but maybe we can use denote-link-return-links instead and remove it.

denote-link-return-links should also be more efficient now. Previously, for each notes we looped through all links in the file.

This is ready to be merged. I will get to denote-link--prepare-backlinks tomorrow.

jeanphilippegg commented 3 months ago

I have reviewed denote-link--prepare-backlinks and I think it is fine. We only need the value of denote-directory because the buttons need it to rebuild the absolute path. There is the revert-buffer-function part that I do not understand, but I think it is ok as well.

I just pushed a commit to rewrite the comment. We can consider this issue closed!

protesilaos commented 3 months ago

Merged, thank you! I could not see the part related to denote-org-extras.el, but I will check again.

jeanphilippegg commented 3 months ago

Merged, thank you! I could not see the part related to denote-org-extras.el, but I will check again.

You're welcome! denote-link--expand-identifiers is used in denote-org-extras-dblock--get-missing-links

protesilaos commented 3 months ago

From: Jean-Philippe Gagné Guay @.***> Date: Sat, 31 Aug 2024 05:39:06 -0700

Merged, thank you! I could not see the part related to denote-org-extras.el, but I will check again.

You're welcome! denote-link--expand-identifiers is used in denote-org-extras-dblock--get-missing-links

Yes, this is fine. It does not use the FILES parameter.

-- Protesilaos Stavrou https://protesilaos.com

jeanphilippegg commented 2 months ago

Yes, this is fine. It does not use the FILES parameter.

That was the point. It does not use the FILES parameter, but this parameter was added in one of the latest commits. But it is all sorted now! :)

protesilaos commented 2 months ago

From: Jean-Philippe Gagné Guay @.***> Date: Sat, 31 Aug 2024 18:50:15 -0700

Yes, this is fine. It does not use the FILES parameter.

That was the point. It does not use the FILES parameter, but this parameter was added in one of the latest commits. But it is all sorted now! :)

Yeah, sorry! I don't remember what I was trying to do. Maybe it was some experiment and then I left it there...

-- Protesilaos Stavrou https://protesilaos.com