protesilaos / denote

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

Other fixes #351

Closed jeanphilippegg closed 1 month ago

jeanphilippegg commented 1 month ago

In this PR, I have addressed your comment in my previous PR and introduced a few more cleanups.

The changes will help with resolving #279 to allow renaming new notes that are still unsaved.

I also added checks to creation and renaming commands to avoid creating a note if the file already exists. This is not a concern for now because the id is unique and part of the file name, but we may want to make it optional eventually.

Just a comment regarding your last commit: The change is not only stylistic: re-search-forward behave differently whether NOERROR is t or any other non-nil value such as :no-error. Check its docstring. I have discovered this myself as well while working on the upcoming new fontification. Same thing with completing-read: t and :require-match do not have the same behaviors.

I have reverted your commit myself as it could conflict with a change I needed to make to address one of your comment on my previous pull request.

protesilaos commented 1 month ago

Merged, thank you!

I had not realised the subtleties of non-nil for re-search-forward and completing-read. Good to know!