CHANGELOG.org (203268B)
1 #+title: Change log of Denote 2 #+author: Protesilaos Stavrou 3 #+email: info@protesilaos.com 4 #+language: en 5 #+options: ':t toc:nil author:t email:t num:t 6 #+startup: content 7 8 This document contains the release notes for each tagged commit on the 9 project's main git repository: <https://github.com/protesilaos/denote>. 10 11 The newest release is at the top. For further details, please consult 12 the manual: <https://protesilaos.com/emacs/denote>. 13 14 #+toc: headlines 1 insert TOC here, with one headline level 15 16 * Version 2.3.0 on 2024-03-24 17 :PROPERTIES: 18 :CUSTOM_ID: h:e9d3ebdb-8a69-47a9-a5a2-619abc44b7d2 19 :END: 20 21 This release brings a host of user-facing refinements to an already 22 stable base, as well as some impressive new features. There is a lot 23 to cover, so take your time reading these notes. 24 25 Special thanks to Jean-Philippe Gagné Guay for the numerous 26 refinements to parts of the code base. Some of these are not directly 27 visible to users, but are critical regardless. In the interest of 28 brevity, I will not be covering the most technical parts here. I 29 mention Jean-Philippe's contributions at the outset for this reason. 30 Though the Git commit log is there for interested parties to study 31 things further. 32 33 ** Check out the ~denote-explore~ package by Peter Prevos 34 :PROPERTIES: 35 :CUSTOM_ID: h:3e49dd9d-59db-40e5-9116-ce678231b08d 36 :END: 37 38 This package provides several neat extensions that help you make 39 better sense of your knowledge base, while keeping it in good order. 40 The ~denote-explore~ package has commands to summarise the usage of 41 keywords, visualise connections between notes, spot infrequently used 42 keywords, and jump to previous historical entries. 43 44 - Git repository: <https://github.com/pprevos/denote-explore>. 45 - Documentation: <https://lucidmanager.org/productivity/denote-explore>. 46 47 Now on to Denote version =2.3.0=! 48 49 ** Link to a heading inside a Denote Org file 50 :PROPERTIES: 51 :CUSTOM_ID: h:ca7baf4f-04af-4467-a1e6-20403357280f 52 :END: 53 54 Denote creates links to files by using their unique identifier. As Org 55 provides the =CUSTOM_ID= property for per-heading identifiers, we now 56 leverage this infrastructure to compose links that point to a file and 57 then to a heading therein. This only works for Org, as no other plain 58 text major mode has a concept of heading identifiers (and it is not 59 Denote's job to create such a feature). 60 61 I demonstrated the functionality in a video: 62 <https://protesilaos.com/codelog/2024-01-20-emacs-denote-link-org-headings/> 63 64 Technically, the =denote:= link type has the same implementation 65 details as Org's standard =file:= and has always had this potential to 66 jump to a section inside the given file. 67 68 *** The ~denote-org-store-link-to-heading~ user option 69 :PROPERTIES: 70 :CUSTOM_ID: h:a7864660-5b4c-4467-a252-9140baedeb1a 71 :END: 72 73 The user option ~denote-org-store-link-to-heading~ determines whether 74 ~org-store-link~ links to the current Org heading (such links are 75 merely "stored" and need to be inserted afterwards with the command 76 ~org-insert-link~). Note that the ~org-capture~ command uses the 77 ~org-link~ internally if it has to store a link. 78 79 When its value is non-nil, ~org-store-link~ stores a link to the 80 current Org heading inside the Denote Org file. If the heading does 81 not have a =CUSTOM_ID=, it creates it and includes it in the heading's 82 =PROPERTIES= drawer. If a =CUSTOM_ID= exists, ~org-store-link~ use it 83 as-is. 84 85 This makes the resulting link a combination of the =denote:= link type, 86 pointing to the identifier of the current file, plus the value of the 87 heading's =CUSTOM_ID=, such as: 88 89 - =[[denote:20240118T060608][Some test]]= 90 - =[[denote:20240118T060608::#h:eed0fb8e-4cc7-478f-acb6-f0aa1a8bffcd][Some test::Heading text]]= 91 92 Both lead to the same Denote file, but the latter jumps to the heading 93 with the given =CUSTOM_ID=. Notice that the link to the heading also 94 has a different description, which includes the heading text. 95 96 The value of the =CUSTOM_ID= is determined by the Org user option 97 ~org-id-method~. The sample shown above uses the default UUID 98 infrastructure. 99 100 If ~denote-org-store-link-to-heading~ is set to a nil value, the 101 command ~org-store-link~ only stores links to the Denote file (using 102 its identifier), but not to the given heading. This is what Denote was 103 doing in all versions prior to =2.3.0=. 104 105 Thanks to Kristoffer Balintona for discussing with me how 106 ~org-capture~ interfaces with ~org-store-link~. I updated the 107 documentation accordingly. This was done in issue 267: 108 <https://github.com/protesilaos/denote/issues/267>. 109 110 *** Insert link to an Org file with a further pointer to a heading 111 :PROPERTIES: 112 :CUSTOM_ID: h:dd054536-8d20-4251-b23d-77fec7d7d036 113 :END: 114 115 As part of the optional =denote-org-extras.el= extension that comes 116 with the ~denote~ package, the command ~denote-org-extras-link-to-heading~ 117 prompts for a link to an Org file and then asks for a heading therein, 118 using minibuffer completion. Once the user provides input at the two 119 prompts, the command inserts a link at point which has the following 120 pattern: =[[denote:IDENTIFIER::#ORG-HEADING-CUSTOM-ID]][Description::Heading text]]=. 121 122 Because only Org files can have links to individual headings, the 123 command ~denote-org-extras-link-to-heading~ prompts only for Org files 124 (i.e. files which include the =.org= extension). Remember that Denote 125 works with many file types. 126 127 This feature is similar to the concept of the aforementioned user 128 option ~denote-org-store-link-to-heading~. It is, however, interactive 129 and differs in the directionality of the action. With that user 130 option, the command ~org-store-link~ will generate a =CUSTOM_ID= for 131 the current heading (or capture the value of one as-is), giving the 132 user the option to then call ~org-insert-link~ wherever they see fit. 133 By contrast, the command ~denote-org-extras-link-to-heading~ prompts 134 for a file, then a heading, and inserts the link at point. 135 136 ** Refinements galore to minibuffer prompts 137 :PROPERTIES: 138 :CUSTOM_ID: h:e509402b-a58f-4a10-b364-b158b31d1ee5 139 :END: 140 141 *** All commands that affect file names conform with ~denote-prompts~ 142 :PROPERTIES: 143 :CUSTOM_ID: h:11f0fc1e-552b-4a02-bf01-9d8508ce68c8 144 :END: 145 146 The scope of the ~denote-prompts~ user option is broadened to make it 147 more useful. In the past, this variable would only affect the 148 behaviour of the ~denote~ command. For example, the user would make 149 the command prompt for a subdirectory, then keywords, then a title. 150 But all other commands were not following this setting, as they were 151 hardcoding the prompts for title and keywords. 152 153 Take the ~denote-subdirectory~ command as an example. It would first 154 prompt for a subdirectory to place the new note in, then for a title, 155 and then for keywords. Whereas now, it prepends the =subdirectory= 156 prompt to the list of ~denote-prompts~. So if the user has configured 157 their ~denote-prompts~ to, for example, ask for a signature and a file 158 type, the ~denote-subdirectory~ will do just that with the addition of 159 the =subdirectory= prompt. 160 161 Same idea for all commands that either create or modify file names, 162 wherever conformity with ~denote-prompts~ makes sense. For example, 163 the ~denote-rename-file~ will never ask for a =subdirectory= because 164 our renaming policy is to always rename in place (to avoid 165 mistakes---you can always move the file afterwards). 166 167 This also means that the ~denote-rename-file~ and its multi-file 168 counterpart, ~denote-dired-rename-files~, will only prompt for a 169 signature if it is part of the ~denote-prompts~. Whereas in the 170 previous version this was unconditional, thus burdening users who do 171 not need the =SIGNATURE= file name component (more about renaming 172 further into the release notes). 173 174 Lots of Git commits went into this redesign, per my initiave in issue 175 247: <https://github.com/protesilaos/denote/issues/247>. Thanks to 176 Vedang Manerikar for the changes to the convenience wrappers of the 177 ~denote~ command (like ~denote-subdirectory~), which were done in pull 178 request 248: <https://github.com/protesilaos/denote/pull/248>. 179 180 Vedang has assigned copyright to the Free Software Foundation. 181 182 Also thanks to Max Brieiev for joining the technical discussion 183 therein. 184 185 The renaming commands are more intuitive now, which addresses a 186 discussion point raised by user babusri in issue 204: 187 <https://github.com/protesilaos/denote/issues/204>. 188 189 *** A simple tweak for more informative minibuffer prompts 190 :PROPERTIES: 191 :CUSTOM_ID: h:a502217d-8eff-4a6f-b66a-33e5e7ecda9d 192 :END: 193 194 The text of each prompt now has all capital letters for the word 195 referencing its scope of its application, like =TITLE=, =KEYWORDS=, 196 =SIGNATURE=. The idea is to make it easier to quickly scan the text, 197 especially while working through multiple prompts. For example, the 198 prompt for a title now reads: 199 200 : New file TITLE: 201 202 This paradigm is followed by all prompts. It is a small yet effective 203 tweak to get a better sense of context. 204 205 *** The file prompt uses relative names once again 206 :PROPERTIES: 207 :CUSTOM_ID: h:8f182ad3-c97f-45dc-a451-c552f2a7957c 208 :END: 209 210 In previous versions of Denote, the minibuffer prompt to pick a file 211 (such as a file to link to) would show relative file names: the name 212 without the full file system path. The functionality depended on the 213 built-in =project.el= library, which did not allow us to do everything 214 we wanted with our prompts, such as to have a dedicated minibuffer 215 history or to easily enable the workflow of commands like 216 ~denote-open-or-create~. 217 218 In the previous version, I made the decision to remove the 219 =project.el= dependency and the concomitant presentation of relative 220 names in order to add the functionality we want. I did it with the 221 intention to find a better solution down the line. Et voilá! Relative 222 file names are back. We now have all the functionality we need. Sorry 223 if in the meantime you had to deal with those longer names! It was a 224 necessary intermediate arrangement for the greater good. 225 226 For the technicalities, refer to the source code of the function 227 ~denote-title-prompt~. 228 229 *** Completion using previous inputs is now optional 230 :PROPERTIES: 231 :CUSTOM_ID: h:bcf382e4-bd00-49f3-859a-3f86e9770b77 232 :END: 233 234 All our minibuffer prompts have their dedicated history (you can 235 persist histories with the built-in ~savehist-mode~). They store 236 previous values, giving the user easy access to their past input 237 values. Some of our commands not only record a history, but also 238 leverage it to provide completion. These commands are named in the 239 variable ~denote-prompts-with-history-as-completion~. As of this 240 writing, they are: 241 242 - ~denote-title-prompt~ 243 - ~denote-signature-prompt~ 244 - ~denote-files-matching-regexp-prompt~ 245 246 Users who do not want to use completion for those can set the new user 247 option ~denote-history-completion-in-prompts~ to a nil value. 248 249 ** Renaming files got better all-round 250 :PROPERTIES: 251 :CUSTOM_ID: h:747e126a-b966-4ac8-a8ec-cf900012e37e 252 :END: 253 254 One of the pillars of the ~denote~ package is its ability to rename 255 any file to use the efficient Denote file-naming scheme (makes file 256 names predictable and easy to retrieve even with rudimentary tools). 257 To this end, we provide several commands that affect file names, 258 beside the commands that create new files. 259 260 As noted above, the commands which rename files to follow the Denote 261 file-naming scheme now conform with the user option ~denote-prompts~, 262 but there is more! 263 264 *** A broadened scope for the ~denote-rename-no-confirm~ option 265 :PROPERTIES: 266 :CUSTOM_ID: h:f93b8075-de2d-416e-9275-7225d03678ad 267 :END: 268 269 The implementation of this user option is redone (i) to save the 270 underlying buffer outright if the user does not want to provide their 271 confirmation for a rename each time and (ii) to cover all relevant 272 commands that perform a rename operation. The assumption is that the 273 user who opts in to this feature is familiar with the Denote renaming 274 modalities and knows they are reliable. 275 276 The default is still the same: Denote always asks for confirmation 277 before renaming a file, showing the difference between the old and new 278 names, as well as any changes to the file's contents. In this light, 279 buffers are not saved to give the user the chance to further inspect 280 the changes (such as by running ~diff-buffer-with-file~). 281 282 Commands that will now skip all confirmation prompts to rename the file 283 and, where relevant, save the corresponding buffer outright: 284 285 - ~denote-rename-file~ 286 - ~denote-dired-rename-files~ 287 - ~denote-dired-rename-marked-files-with-keywords~ 288 - ~denote-rename-file-using-front-matter~ 289 - ~denote-rename-add-keywords~ 290 - ~denote-rename-remove-keywords~ 291 - ~denote-rename-add-signature~ (new, more below) 292 - ~denote-rename-remove-signature~ (new, more below) 293 294 *** Rename a file by adding or removing a =SIGNATURE= component 295 :PROPERTIES: 296 :CUSTOM_ID: h:01ab0277-b4d4-433e-bd25-b9a0357412f6 297 :END: 298 299 The =SIGNATURE= is an optional free-form field that is part of a 300 Denote file name. A common use-case is to write sequence notes with 301 it, though Denote does not enforce any particular convention (you may 302 prefer to have it as a special kind of keyword for certain files that 303 simply stands out more due to its placement). 304 305 [ Besides, the ~denote-sort-dired~ command lets you filter and sort 306 files while putting them in a fully fledged Dired buffer, so 307 manually sequencing notes via their signature may not be needed. ] 308 309 We now provide two commands to add or remove a signature from file 310 names: 311 312 - The ~denote-rename-add-signature~ prompts for a file and a 313 signature. The default value for the file prompt is the file of the 314 currently open buffer or the file-at-point in a Dired buffer. The 315 signature is an ordinary string, defaulting to the selected file's 316 signature, if any. 317 318 - The ~denote-rename-remove-signature~ uses the same file prompt as 319 above. It performs its action only if the selected file has a 320 signature. Otherwise, it does nothing. 321 322 Files that do not have a Denote file name are renamed accordingly. 323 Though for such cases it is better to use ~denote-rename-file~ or 324 ~denote-dired-rename-files~ as they are more general. 325 326 *** Use the ~denote-after-rename-file-hook~ for optional post-rename operations 327 :PROPERTIES: 328 :CUSTOM_ID: h:57f4f60c-7873-4542-a7a5-5c997cdbd137 329 :END: 330 331 All renaming commands run the ~denote-after-rename-file-hook~ after a 332 successful operation. This is meant for users who want to do something 333 specific after the renaming is done. 334 335 ** More optional features of the =denote-org-extras.el= 336 :PROPERTIES: 337 :CUSTOM_ID: h:a0a2753e-5be9-4776-9f3f-e3b7556c13c1 338 :END: 339 340 I already covered the ~denote-org-extras-link-to-heading~, though the 341 file =denote-org-extras.el= has some more optional goodies for those 342 who work with Org files. 343 344 *** Create a note from the current Org subtree 345 :PROPERTIES: 346 :CUSTOM_ID: h:fbf1e574-e9aa-4c67-8034-27341d7a5536 347 :END: 348 349 In Org parlance, an entry with all its subheadings and other contents 350 is a "subtree". Denote can operate on the subtree to extract it from 351 the current file and create a new file out of it. One such workflow is 352 to collect thoughts in a single document and produce longer standalone 353 notes out of them upon review. 354 355 The command ~denote-org-extras-extract-org-subtree~ (part of the 356 optional =denote-org-extras.el= extension) is used for this purpose. 357 It creates a new Denote note using the current Org subtree. In doing 358 so, it removes the subtree from its current file and moves its 359 contents into a new file. 360 361 The text of the subtree's heading becomes the =#+title= of the new 362 note. Everything else is inserted as-is. 363 364 Read the documentation string of ~denote-org-extras-extract-org-subtree~ 365 or consult the manual for further details. 366 367 *** Convert =denote:= links to =file:= links 368 :PROPERTIES: 369 :CUSTOM_ID: h:042e26e8-e3e0-4c57-9855-6b363671ae9a 370 :END: 371 372 Sometimes the user needs to translate all =denote:= link types to 373 their =file:= equivalent. This may be because some other tool does not 374 recognise =denote:= links (or other custom links types---which are a 375 standard feature of Org, by the way). The user thus needs to (i) 376 either make a copy of their Denote note or edit the existing one, and 377 (ii) convert all links to the generic =file:= link type that 378 external/other programs understand. 379 380 The optional extension =denote-org-extras.el= contains two commands 381 that are relevant for this use-case: 382 383 + Convert =denote:= links to =file:= links :: The command 384 ~denote-org-extras-convert-links-to-file-type~ goes through the 385 buffer to find all =denote:= links. It gets the identifier of the 386 link and resolves it to the actual file system path. It then 387 replaces the match so that the link is written with the =file:= type 388 and then the file system path. The optional search terms and/or link 389 description are preserved. 390 391 + Convert =file:= links to =denote:= links :: The command 392 ~denote-org-extras-convert-links-to-denote-type~ behaves like the 393 one above. The difference is that it finds the file system path and 394 converts it into its identifier. 395 396 *** The Denote Org dynamic blocks are now in =denote-org-extras.el= 397 :PROPERTIES: 398 :CUSTOM_ID: h:51d72c47-d434-4954-98d6-2db7a7ea6812 399 :END: 400 401 As part of this version, all our dynamic blocks are defined in the 402 file =denote-org-extras.el=. The file which once contained these block 403 definitions, =denote-org-dblock.el=, now only has aliases for the new 404 function names and dipslays a warning about its deprecation. 405 406 There is no need to ~require~ the ~denote-org-extras~ feature because 407 all of Denote's Org dynamic blocks are autoloaded (meaning that they 408 work as soon as they are used). For backward compatibility, all 409 dynamic blocks retain their original names as an alias for the newer 410 one. 411 412 We will not remove =denote-org-dblock.el= anytime soon to avoid any 413 potential breakage with people's existing notes. Though if you are new 414 to this functionality, you better avoid the deprecated symbols. 415 416 *** Org dynamic block to only insert missing links 417 :PROPERTIES: 418 :CUSTOM_ID: h:45176e63-c609-40f6-a11d-1cc0c28460dd 419 :END: 420 421 The =denote-missing-links= block is available with the command 422 ~denote-org-extras-dblock-insert-missing-links~. It is like the 423 =denote-links= block (documented at length in the manual), except it 424 only lists links to files that are not present in the current buffer. 425 The parameters are otherwise the same: 426 427 : #+BEGIN: denote-missing-links :regexp "YOUR REGEXP HERE" :sort-by-component nil :reverse-sort nil :id-only nil 428 : 429 : #+END: 430 431 Remember to type =C-c C-x C-u= (~org-dblock-update~) with point on the 432 =#+BEGIN= line to update the block. 433 434 This brings back a feature that was deprecated in version 2.2.0, but 435 makes changes to it so that (i) it is more limited in scope and (ii) 436 available as a standalone Org dynamic block. 437 438 Thanks to Stephen R. Kifer, Peter Prevos, and Elias Storms for the 439 discussion which made it clear to me that users do have a need for 440 such functionality. This was done in the now-defunct mailing list: 441 <https://lists.sr.ht/~protesilaos/denote/%3C1db2104e-70bd-47f9-a7ed-b8d4bb370a7f%40app.fastmail.com%3E>. 442 443 Also thanks to Vedang Manerikar for fixing an edge case bug. This was 444 done in pull request 260: <https://github.com/protesilaos/denote/pull/260>. 445 446 Org dynamic blocks are a powerful feature which also showcases how far 447 we can go with Denote's efficient file-naming scheme. 448 449 ** Quality-of-life improvements 450 :PROPERTIES: 451 :CUSTOM_ID: h:08f27f36-0ed2-4a5e-b02b-f0075c6e904f 452 :END: 453 454 Here I include other changes we made to existing functionality. 455 456 *** BREAKING User-defined sluggification of file name components 457 :PROPERTIES: 458 :CUSTOM_ID: h:240b80e7-242c-46fb-83d2-1ba36bdcaf66 459 :END: 460 461 In the previous version, we introduced the user option 462 ~denote-file-name-letter-casing~. This was used to control the letter 463 casing of file name components, but was ultimately not flexible enough 464 for our purposes. We are thus retiring it and replacing it with the 465 more powerful, but also more advanced, user option 466 ~denote-file-name-slug-functions~. 467 468 For existing users of the deprecated functionality, you can still 469 preserve the input of a prompt verbatim with something like this: 470 471 #+begin_src emacs-lisp 472 (setq denote-file-name-slug-functions 473 '((title . denote-sluggify-title) 474 (keyword . identity) 475 (signature . denote-sluggify-signature))) 476 #+end_src 477 478 The manual explains the details and shows ready-to-use code samples. 479 480 Remember that deviating from the default file-naming scheme of Denote 481 will make things harder to use in the future, as files will have 482 permutations that create uncertainty. The sluggification scheme and 483 concomitant restrictions we impose by default are there for a very 484 good reason: they are the distillation of years of experience. Here we 485 give you what you wish, but bear in mind it may not be what you need. 486 You have been warned. 487 488 Thanks to Jean-Philippe Gagné Guay for introducing this variable, 489 among other tweaks, in pull request 217: <https://github.com/protesilaos/denote/pull/217>. 490 Jean-Philippe has assigned copyright to the Free Software Foundation. 491 492 *** Option to automatically save the buffer of a new note 493 :PROPERTIES: 494 :CUSTOM_ID: h:3e1249f1-ac26-4187-9ddd-7391b4e5131f 495 :END: 496 497 The user option ~denote-save-buffer-after-creation~ controls whether 498 commands that create new notes save their buffer right away. 499 500 The default behaviour of commands such as ~denote~ (or related) is to 501 not save the buffer they create. This gives the user the chance to 502 review the text before writing it to a file. The user may choose to 503 delete the unsaved buffer, thus not creating a new file on disk. 504 505 If ~denote-save-buffer-after-creation~ is set to a non-nil value, such 506 buffers are saved automatically and so the file is written to disk. 507 508 *** The ~denote-menu-bar-mode~ and the placement of the Denote submenu 509 :PROPERTIES: 510 :CUSTOM_ID: h:c8336927-cf6b-4770-b041-123bf9186e57 511 :END: 512 513 The command ~denote-menu-bar-mode~ toggles the inclusion of the 514 submenu with the Denote entries in the Emacs menu bar (which is on 515 display when ~menu-bar-mode~ is enabled). 516 517 This submenu is now shown after the =Tools= entry. 518 519 Thanks to Joseph Turner for sending me the relevant patches. Joseph 520 has assigned copyright to the Free Software Foundation. 521 522 *** The =C-c C-o= works in ~markdown-mode~ for Denote links 523 :PROPERTIES: 524 :CUSTOM_ID: h:1c884b19-7ab7-4eb5-a332-815d25f7373c 525 :END: 526 527 In files whose major mode is ~markdown-mode~, the default key binding 528 =C-c C-o= (which calls the command ~markdown-follow-thing-at-point~) 529 correctly resolves =denote:= links. This method works in addition to 530 the =RET= key, which is made available by the buttonization that we 531 also provide. Interested users can refer to the function 532 ~denote-link-markdown-follow~ for the implementation details. 533 534 Thanks to user pmenair for noting a case where this was breaking 535 general Markdown linking functionality. This was done in issue 290: 536 <https://github.com/protesilaos/denote/issues/290>. 537 538 *** More fine-grained control of Denote faces for dates/identifiers 539 :PROPERTIES: 540 :CUSTOM_ID: h:c6f739ef-ea26-41b8-84e6-c87c4622cdba 541 :END: 542 543 We now define more faces for fine-grained control of the identifier in 544 Dired. Thanks to mentalisttraceur for suggesting the idea in issue 545 276: <https://github.com/protesilaos/denote/issues/276>. 546 547 Before you ask, no, none of my themes will cover those faces because 548 extra colouration is something only the user can decide if they want 549 or not. In the above link I provide a sample with a screenshot (apart 550 from the ~modus-themes~, my ~ef-themes~ and ~standard-themes~ have 551 similar functionality): 552 553 #+begin_src emacs-lisp 554 (defun my-modus-themes-denote-faces (&rest _) 555 (modus-themes-with-colors 556 (custom-set-faces 557 `(denote-faces-year ((,c :foreground ,cyan))) 558 `(denote-faces-month ((,c :foreground ,magenta-warmer))) 559 `(denote-faces-day ((,c :foreground ,cyan))) 560 `(denote-faces-time-delimiter ((,c :foreground ,fg-main))) 561 `(denote-faces-hour ((,c :foreground ,magenta-warmer))) 562 `(denote-faces-minute ((,c :foreground ,cyan))) 563 `(denote-faces-second ((,c :foreground ,magenta-warmer)))))) 564 565 (add-hook 'modus-themes-post-load-hook #'my-modus-themes-denote-faces) 566 #+end_src 567 568 *** New convenience command for users of the optional =denote-journal-extras.el= 569 :PROPERTIES: 570 :CUSTOM_ID: h:9e7bff88-a6ad-45e7-b802-0493153e0e20 571 :END: 572 573 The command ~denote-journal-extras-link-or-create-entry~ links to the 574 journal entry for today or creates it in the background, if missing, 575 and then links to it from the current file. If there are multiple 576 journal entries for the same day, it prompts to select one among them 577 and then links to it. When called with an optional prefix argument 578 (such as =C-u= with default key bindings), the command prompts for a 579 date and then performs the aforementioned. With a double prefix 580 argument (=C-u C-u=), it also produces a link whose description 581 includes just the file's identifier. 582 583 Thanks to Alan Schmitt for contributing this command, based on 584 previous discussions. It was done in pull request 243: 585 <https://github.com/protesilaos/denote/pull/243>. 586 587 ** For developers or advanced users 588 :PROPERTIES: 589 :CUSTOM_ID: h:03778c8c-60aa-449c-96df-7e41916668a6 590 :END: 591 592 These has new parameters or are new symbols altogether. Please read 593 their respective doc string for the details. 594 595 + Function ~denote-convert-file-name-keywords-to-crm~. 596 + Function ~denote-valid-date-p~. 597 + Function ~denote-parse-date~. 598 + Function ~denote-retrieve-title-or-filename~. 599 + Function ~denote-get-identifier~. 600 + Function ~denote-signature-prompt~. 601 + Function ~denote-file-prompt~. 602 + Function ~denote-keywords-prompt~. 603 + Function ~denote-title-prompt~. 604 + Function ~denote-rewrite-front-matter~. 605 + Function ~denote-rewrite-keywords~. 606 + Function ~denote-update-dired-buffers~. 607 + Function ~denote-format-string-for-org-front-matter~. 608 + Function ~denote-format-string-for-md-front-matter~. 609 + Variable ~denote-link-signature-format~. 610 + Function ~denote-link-description-with-signature-and-title~. 611 + Variable ~denote-link-description-function~. 612 613 ** Miscellaneous 614 :PROPERTIES: 615 :CUSTOM_ID: h:040f2678-674d-4e99-b428-659cd3a3b7c3 616 :END: 617 618 - The ~denote-sort-dired~ function no longer errors out when there is 619 no match for the given search terms. Thanks to Vedang Manerikar for 620 the initial patch! This was done in the now-defunct mailing list: 621 <https://lists.sr.ht/~protesilaos/denote/patches/47625>. Further 622 changes by me. 623 624 - The ~denote-keywords-sort~ function no longer tries to sort keywords 625 that are not a list. Thanks to Ashton Wiersdorf for the patch. The 626 change is small. As such, Ashton does not need to assign copyright 627 to the Free Software Foundation. 628 629 - Documented in the manual that custom convenience commands can be 630 accessed by the ~denote-command-prompt~. Thanks to Glenna D. for 631 clarifying the language. 632 633 - The ~denote-user-enforced-denote-directory~ is obsolete. Those who 634 used it in their custom code can simply ~let~ bind the value of the 635 variable ~denote-directory~. Thanks to Jean-Philippe Gagné Guay for 636 making the relevant changes (the Git history is not direct here and 637 I cannot quickly find the pull request---the commit is =a48a1da=). 638 639 - The ~denote-link-return-links~ no longer keeps buffers around. 640 Thanks to Matteo Cavada for the patch. This was done in pull request 641 252: <https://github.com/protesilaos/denote/pull/252>. The change is 642 small and so Matteo does not need to assign copyright to the Free 643 Software Foundation. 644 645 - Thanks to user jarofromel (recorded in Git as "random" author) for 646 fixing a mismatched parenthesis in ~denote-parse-date~. This was 647 done in pull request 258: <https://github.com/protesilaos/denote/pull/258>. 648 649 - The ~denote-rename-buffer-mode~ now works as expected with 650 non-editable files, like PDFs. Thanks to Alan Schmitt for bringing 651 this matter to my attention and then refining the implementation 652 details in pull request 268: <https://github.com/protesilaos/denote/pull/268>. 653 654 - All the Denote linking functions can be used from any file outside 655 the ~denote-directory~ (links are still resolved to files inside the 656 ~denote-directory~). Thanks to Jean-Philippe Gagné Guay for the 657 contribution in pull request 236: <https://github.com/protesilaos/denote/pull/236>. 658 659 - We removed all glue code that integrated Denote with the built-in 660 ~ffap~, ~xref~, and ~project~ libraries. We may reconsider how best 661 to organise such features in the future. Thanks to Noboru Ota 662 (nobiot), who originally contributed those extensions, for 663 suggesting their removal from our code base. We did this by 664 evaluating all use-cases. The discussion with Noboru happened in 665 issue 264: <https://github.com/protesilaos/denote/issues/264>. Also 666 thanks to Jean-Philippe Gagné Guay and Alan Schnmitt for checking 667 the impact of this on how we generate backlinks. The latest 668 iteration of this was done in pull request 294, by Jean-Philippe: 669 <https://github.com/protesilaos/denote/pull/294>. 670 671 - While renaming files, signatures no longer lose consecutive spaces. 672 Thanks to Wesley Harvey for the contribution in pull request 207: 673 <https://github.com/protesilaos/denote/pull/207>. The change is 674 within the ~15 line limit and so Wesley does not need to assign 675 copyright to the Free Software Foundation. 676 677 - All of the above and lots more are documented at length in the 678 manual. This is a big task in its own right (as are release notes, 679 by the way), though it ensures we keep a high standard for the 680 entire package and can communicate all our knowledge to the user. 681 682 ** No more SourceHut 683 :PROPERTIES: 684 :CUSTOM_ID: h:9a0d6afc-95e0-490e-a573-5a50fe7bdf28 685 :END: 686 687 Development continues on GitHub with GitLab as a mirror. I explained 688 my reasons here: <https://protesilaos.com/codelog/2024-01-27-sourcehut-no-more/>. 689 690 This is a change that affects all my Emacs packages. 691 692 ** Forward guidance for Denote version 3.0.0 693 :PROPERTIES: 694 :CUSTOM_ID: h:61fb340e-5c7c-4a4b-927c-63faf4759a09 695 :END: 696 697 We will not any new features until mid-April or a bit later if 698 necessary. This gives users enough time to report any potential issues 699 with version =2.3.0=. If there are any bugs, they will be fixed right 700 away and new minor releases will be introduced (though without release 701 notes). 702 703 Once we are done with this release cycle, we want to prepare for the 704 next major version of Denote. The plan is to make the placement of 705 file name components entirely customisable, among many other power 706 user features. Though the defaults will remain intact. 707 708 For the immediate future, please prioritise bug reports/fixes. Then 709 see you around for another round of hacking. The Denote code base is a 710 pleasure to work with due to how composable everything is. I happy to 711 make it even better for developers and users alike. 712 713 ** Git commits 714 :PROPERTIES: 715 :CUSTOM_ID: h:a6fd8e16-ded9-49cf-afbb-6e1373c3c43d 716 :END: 717 718 Just an overview of what we did. Thanks again to everyone involved. 719 720 #+begin_src sh 721 ~/Git/Projects/denote $ git shortlog 2.2.0..2.3.0 --summary --numbered 722 246 Protesilaos Stavrou 723 46 Jean-Philippe Gagné Guay 724 6 Vedang Manerikar 725 3 Joseph Turner 726 2 Alan Schmitt 727 2 Max 728 2 Peter Prevos 729 1 Ashton Wiersdorf 730 1 Glenna D. 731 1 Matteo Cavada 732 1 mattyonweb 733 1 random 734 1 wlharvey4 735 #+end_src 736 737 ** All contributions are valuable 738 :PROPERTIES: 739 :CUSTOM_ID: h:967372fa-933b-40d2-b1a8-546d1a50d35d 740 :END: 741 742 I encourage you to provide feedback on any of the functionality of the 743 Denote package. You do not need to be a developer or indeed an expert 744 in Emacs. When you have an idea in mind on how you use Denote, or you 745 think something could be done differently, please speak your mind. I 746 do listen to feedback and am interested in further improving this 747 package. Everybody is welcome! 748 749 * Version 2.2.0 on 2023-12-10 750 :PROPERTIES: 751 :CUSTOM_ID: h:8efed390-cfa0-420d-b300-0cb76bf2c9f9 752 :END: 753 754 The present version covers four broad themes: 755 756 1. Denote rename commands are more user-friendly and featureful. 757 2. An optional sorting facility makes it possible to produce a 758 filtered and sorted Dired buffer with Denote files. 759 3. The optional Denote Org dynamic blocks have received a lot of attention. 760 4. Bug fixes and internal refinements. 761 762 [ Remember that you do not need to be a programmer to contribute to 763 Denote. Report a bug, make a suggestion, or just describe how you 764 want to use this package. Every idea counts and we may implement it 765 if we can. ] 766 767 ** The rename commands can remove a Denote file name component 768 :PROPERTIES: 769 :CUSTOM_ID: h:54d803d8-4863-4160-bb2f-3302fb8bff23 770 :END: 771 772 The commands we provide to rename files using the Denote file-naming 773 scheme---~denote-rename-file~, ~denote-dired-rename-files~, and 774 ~denote-dired-rename-marked-files-with-keywords~---can now remove 775 Denote file name components. This is done by providing an empty string 776 at the relevant prompt. 777 778 For example, to remove the =TITLE= component from a file called 779 =20231209T110322==sig--title__keywords.ext= we provide an empty string 780 at the title prompt. The end result will look something like this: 781 =20231209T110322==sig__keywords.ext=. 782 783 All prompts now include a hint that leaving them empty will ignore the 784 given field if it does not exist or remove it if it does exist. 785 786 Note that you must *check how to input an empty string* with your 787 minibuffer user interface of choice. For instance, with the ~vertico~ 788 package you can do that with the =M-RET= key binding or by selecting 789 the prompt line directly (notice the counter showing something like 790 =*/5= instead of =1/5=). Please make sure to consult the documentation 791 of the package you are using as this behaviour is not controlled by 792 Denote. Vertico, and others like it, selects the first candidate if 793 you type =RET= without any input, which is not the same as an empty 794 string---it is the first candidate. 795 796 Also read the Denote manual on the matter of [[https://protesilaos.com/emacs/denote#h:532e8e2a-9b7d-41c0-8f4b-3c5cbb7d4dca][Renaming files]]. In short, 797 we use this facility to name all our files, regardless of file type, 798 in a consistent way that makes them easier to find (I do this with my 799 videos, for example, and I do it across my filesystem for all personal 800 files). 801 802 ** The file-to-be-renamed is easier to read in the minibuffer 803 :PROPERTIES: 804 :CUSTOM_ID: h:69d85d3b-0200-4cc1-baff-9d59aa0ff57b 805 :END: 806 807 The commands ~denote-rename-file~ and ~denote-dired-rename-files~ 808 show the name of the file they are operating on in the minibuffer 809 prompt. This is now produced relative to the current directory, 810 meaning that instead of =/some/rather/long/path/to/file-name.txt= 811 Denote only displays =file-name.txt=. 812 813 Our rename commands never move files to another directory, anyway, so 814 we do not need to remind the user of the entire file system path. 815 816 To make things easier for users/themes, file names highlighted in 817 Denote prompts are fontified with either of following faces, 818 depending on the specifics of the case: 819 820 - ~denote-faces-prompt-old-name~ 821 - ~denote-faces-prompt-new-name~ 822 - ~denote-faces-prompt-current-name~ 823 824 These faces inherit the attributes of basic faces, so they should look 825 decent without further tweaks across all themes. 826 827 ** Prompts for title, keywords, and signature accept an empty string 828 :PROPERTIES: 829 :CUSTOM_ID: h:5897bcc1-4637-4268-8518-8404d939b4b9 830 :END: 831 832 The prompts defined by Denote that apply to file name components all 833 accept an empty string. This has the effect of skipping the given 834 component. For example, we can create a file without a title and 835 keywords, with the following sequence of actions (I assume you are 836 using ~vertico~ for the minibuffer user interface): 837 838 - Type =M-x denote=. 839 - Type =M-RET= at the title prompt to input an empty string. 840 - Now type =M-RET= at the keywords prompt for another empty string. 841 842 The resulting file name is something like =20231209T110950.org=. 843 844 ** Dired with sorting and filtering 845 :PROPERTIES: 846 :CUSTOM_ID: h:05aa437b-2fc8-4e01-ac38-ab77baad83af 847 :END: 848 849 The new optional =denote-sort.el= library provides facilities to sort 850 Denote files by any of their file name components. Users can benefit 851 from this facility to produce a filtered and sorted listing of Denote 852 files with the command ~denote-sort-dired~. 853 854 ~denote-sort-dired~ produces a fully fledged Dired buffer. It asks for a 855 regular expression that matches file names in the ~denote-directory~. 856 It then prompts for a sort key and finally checks with the user 857 whether to reverse the order or not. 858 859 [ Do not be discouraged by the term "regular expression". Ordinary 860 words work fine. Plus, with Denote's file-naming scheme we have 861 semantics such as =_keyword=, =-title=, ~=signature~, as explained 862 in the manual. This is the whole point of using a thoughtful naming 863 scheme. ] 864 865 The resulting Dired listing is flat, meaning that files inside of 866 subdirectories are bundled together with those present at the root of 867 the ~denote-directory~. In this case, files inside of a subdirectory 868 include the directory component as a prefix. So we have something like 869 this: 870 871 #+begin_example 872 test-subdir/20230320T105950--a-new-note__testing.txt 873 20231202T095629--rename-works-as-intended__one_test_two.org 874 #+end_example 875 876 I think this is a killer feature, as the fully fledged Dired buffer 877 allows us to perform all supported operations on our Denote 878 sorted+filtered files (e.g. change file permissions, move files to 879 another directory, or open them in an external application). 880 881 I recorded a video to show how this works: 882 <https://protesilaos.com/codelog/2023-12-04-emacs-denote-sort-mechanism/>. 883 884 [ Remember that we can rename any file using the Denote file-naming 885 scheme, meaning that our files can include stuff like PDFs and 886 videos. Combine this with the concept of "silos", which is covered 887 in the Denote manual, to organise your long-term storage and 888 retrieve it efficiently. ] 889 890 ** Combine contents of files with an Org dynamic block 891 :PROPERTIES: 892 :CUSTOM_ID: h:d41009c1-9833-4b28-8240-9666bfd26559 893 :END: 894 895 The new =denote-files= Org dynamic block produces a continuous stream 896 of file contents. It joins together the contents of files inside the 897 ~denote-directory~ whose name matches the given regular expression. 898 Optional parameters control whether to include links to those files, 899 omit their front matter, sort by a given file name component, or tweak 900 the separator between each file's contents. 901 902 I produced a video to demonstrate the functionality: 903 <https://protesilaos.com/codelog/2023-11-25-emacs-denote-org-dynamic-blocks/>. 904 905 Use the command ~denote-org-dblock-insert-files~ to insert such a 906 block directly at point. Read the Denote manual for the 907 technicalities: [[https://protesilaos.com/emacs/denote#h:f15fa143-5036-416f-9bff-1bcabbb03456][Org dynamic block to insert file contents]]. 908 909 [ Videos I do will eventually be out-of-date. The manual is the source 910 of truth. ] 911 912 Bear in mind that this feature is not "transclusion". We are simply 913 printing a copy of the contents of the files in the current buffer. 914 Changes made to this copy are not reflected in the original files. 915 916 The =denote-files= Org dynamic block is an excellent way to quickly 917 collect your thoughts on a given topic. Although dynamic blocks are a 918 feature of Org, the contents of the files do not need to be in Org 919 syntax (I write most of my notes in plain text (=.txt=)). 920 921 Thanks to Claudiu Tănăselia for proposing this idea and discussing it 922 with me. This was done via a private channel and the information is 923 shared with permission. 924 925 ** Sort parameters are used in all Denote Org dynamic blocks 926 :PROPERTIES: 927 :CUSTOM_ID: h:7b51fe38-302e-488d-9816-7015a8071ddb 928 :END: 929 930 All Denote Org dynamic blocks make use of =denote-sort.el= (described 931 further above). It powers the =:sort-by-component= and =:reverse-sort= 932 parameters. 933 934 Thanks to Glenna D. for suggesting this feature and discussing it with 935 me. This was done via a private channel and the information is shared 936 with permission. It is what inspired me to start work on 937 =denote-sort.el=, which I then extended to cover Dired, as noted 938 above. 939 940 ** The =:missing-only= parameter is removed from Org dynamic blocks 941 :PROPERTIES: 942 :CUSTOM_ID: h:2bd26aef-70ad-4d83-a4ab-c75a893a733a 943 :END: 944 945 I am removing it because the underlying functionality of 946 ~denote-add-missing-links~ was not always reliable. 947 948 ** Files with signature are linked appropriately in Org dynamic blocks 949 :PROPERTIES: 950 :CUSTOM_ID: h:144436eb-e674-4052-ac0a-d582b6aa2f53 951 :END: 952 953 In general, we provide the command ~denote-link-with-signature~ to let 954 the user pick a file that has a signature and link to it. The 955 description of such a link contains the signature text as well as the 956 file title. The ~denote-link-with-signature~ is distinct from the 957 standard ~denote-link~, as it allows the user to express intent about 958 the inclusion of the signature. 959 960 In Org dynamic blocks for links/backlinks, we make this happen 961 automatically since there can be no manual intervention to express 962 intent on a link-by-link basis. 963 964 ** Fontification in Dired can now extend to subdirectories 965 :PROPERTIES: 966 :CUSTOM_ID: h:46e08576-4c17-4b1e-a268-e0223250e7c1 967 :END: 968 969 The user option ~denote-dired-directories~ activates the 970 ~denote-dired-mode~ in the specified list of directories when the user 971 sets this in their init file: 972 973 #+begin_src emacs-lisp 974 (add-hook 'dired-mode-hook #'denote-dired-mode-in-directories) 975 #+end_src 976 977 The new user option ~denote-dired-directories-include-subdirectories~ 978 extends the reach of this feature to all subdirectories thereof. 979 980 Thanks to Henrik Hörmann for discussing this with me and contributing 981 a patch. This was originally done in pull request 191 on the GitHub 982 mirror: <https://github.com/protesilaos/denote/pull/191>. Subsequent 983 refinements by me. 984 985 ** Signatures are sluggified as intended 986 :PROPERTIES: 987 :CUSTOM_ID: h:73e1efaa-2c22-48ee-be46-072b55177c99 988 :END: 989 990 The file name signature component is now sluggified properly. This 991 means that multiple words are separated by the equals sign, in 992 accordance with the Denote file-naming scheme where a word separator 993 is the same as the given field separator (this is the low-tech feature 994 that makes Denote files so easy to retrieve without fancy extras). 995 996 Vedang Manerikar fixed two relevant bugs in the "rename" commands, 997 while I rewrote internal functions and tests in the interest of consistency. Vedang's patches: <https://lists.sr.ht/~protesilaos/denote/patches/46790>. 998 999 [ The "signature" is a free form component of the file name. Users can 1000 add anything they want there, such as to use it as a "category" that 1001 is different from "tags/keywords", or to introduce sequences in 1002 their notes, or to just have an extra marker for files they need to 1003 spot quickly. ] 1004 1005 ** For developers 1006 :PROPERTIES: 1007 :CUSTOM_ID: h:79f2fd7e-d5a7-4c78-bce7-f8d21e86e32c 1008 :END: 1009 1010 There is a section in the manual titled "For developers or advanced 1011 users". There we document functions or variables that are 1012 public-facing, meaning that we test and document their behaviour and 1013 encourage others to use them for code they write on top of Denote. 1014 Refer to this section if you are looking to extend Denote. Though you 1015 can also just check the source code, which is designed to be readable 1016 and hackable. 1017 1018 - The ~denote-directory-files~ function gains new functionality that 1019 subsumes that of the now-deprecated functions 1020 ~denote-directory-files-matching-regexp~, ~denote-all-files~, 1021 ~denote-directory-text-only-files~. Thanks to Jean-Philippe Gagné 1022 Guay for the contribution, which was done in pull request 195 on the 1023 GitHub mirror: <https://github.com/protesilaos/denote/pull/195>. 1024 1025 - The font-lock keywords we define are consolidated into a single 1026 variable: ~denote-faces-file-name-keywords~ instead of being split 1027 into two variables. This means that we cover all our fontification 1028 needs in the backlinks buffer as well as the ~denote-dired-mode~ 1029 with this one point of entry. It also works for ~denote-sort-dired~, 1030 which can include files with their subdirectory component in the 1031 same flat listing. 1032 1033 - Use the function ~denote-retrieve-filename-keywords~ to extract 1034 keywords from the file name alone, without going into the file 1035 contents. 1036 1037 - The ~denote-retrieve-filename-title~ function now returns an empty 1038 string if no title is present. Its behaviour is thus consistent with 1039 ~denote-retrieve-filename-keywords~ and ~denote-retrieve-filename-signature~. 1040 1041 - The ~denote-retrieve-filename-title~ will now use the 1042 ~file-name-base~ function as a fallback subject to a non-nil 1043 optional argument. This case come into effect when the file does not 1044 have a title component. The new optional argument allows the caller 1045 to handle such cases as they see fit. 1046 1047 - The ~denote-signature-prompt~ and ~denote-title-prompt~ functions 1048 accept an optional =DEFAULT-SIGNATURE= or =DEFAULT-TITLE= argument. 1049 Internally, this is used as the =INITIAL-INPUT= of ~completing-read~ 1050 instead of the =DEF= argument. This matters because we want the 1051 prompt to return an empty string if there is no input, whereas the 1052 presence of =DEF= means that =DEF= is returned when the prompt is 1053 empty. 1054 1055 - All our functions that interactively match file names with a regular 1056 expression now use the ~denote-files-matching-regexp-prompt~ 1057 function. When called from Lisp, it takes a =REGEXP= argument as 1058 well as an optional =PROMPT-TEXT=. 1059 1060 For the purposes of this release cycle, I am not documenting the 1061 points of entry provided by =denote-sort.el=. It is a new feature that 1062 I may eventually incorporate in =denote.el=. If you are interested in 1063 the functionality (e.g. to have more elaborate sorting algorithms), 1064 please take a look at the source code and then let us discuss the 1065 implementation details. 1066 1067 ** Miscellaneous 1068 :PROPERTIES: 1069 :CUSTOM_ID: h:ce5c7865-9ec1-49ba-9388-5a251ab56735 1070 :END: 1071 1072 - Rewrote the manual on the topic of Org dynamic blocks. Same idea for 1073 practically the entirety of =denote-org-dblock.el=. 1074 1075 - Marked the interactive specification of a few commands with the 1076 major mode they belong to. This means that =M-X= (note the capital 1077 X), which calls ~execute-extended-command-for-buffer~ by default, 1078 will only show those commands in the relevant context. 1079 1080 - Made internal refinements and simplified the implementation of a few 1081 functions. This is important work to keep the code base clean and 1082 easy to read/maintain. Thanks to Jean-Philippe Gagné Guay for the 1083 contribution. It was done in pull request 193 on the GitHub mirror: 1084 <https://github.com/protesilaos/denote/pull/193>. 1085 1086 - Improved the doc string of the ~denote-format-file-name~ function. 1087 Also introduced a unit test for it to be sure it does what we expect 1088 (I eventually want to have tests for everything we do, but this is a 1089 long-term project). 1090 1091 ** Git commits 1092 :PROPERTIES: 1093 :CUSTOM_ID: h:6830d3f3-130c-4346-b3ca-a3d4b0e9f974 1094 :END: 1095 1096 Just an overview of what we did. Thanks again to everyone involved. 1097 1098 #+begin_src sh 1099 ~/Git/Projects/denote $ git shortlog 2.1.0..2.2.0 --summary --numbered 1100 125 Protesilaos Stavrou 1101 17 Jean-Philippe Gagné Guay 1102 2 Vedang Manerikar 1103 1 Henrik Hörmann 1104 #+end_src 1105 1106 ** Policy for the next development cycle 1107 :PROPERTIES: 1108 :CUSTOM_ID: h:cb0cae4f-c9a1-40b3-98ae-781a57270d4e 1109 :END: 1110 1111 I will give a ~1 week pause on Denote development before making any 1112 feature changes. This is to ensure that we catch possible bugs and 1113 push fixes right away. If there are other changes in place, it is not 1114 possible to make point updates of this sort, as we must first wait for 1115 the new features to be tested in real-world scenaria. 1116 1117 * Version 2.1.0 on 2023-11-12 1118 :PROPERTIES: 1119 :CUSTOM_ID: h:167beb8f-14be-40de-a1f2-d13910924c00 1120 :END: 1121 1122 The general theme of this release is improvements to the quality of 1123 life with Denote. While these release notes and the overall 1124 documentation are comprehensive, make no mistake: Denote can be used 1125 with =M-x denote=, =M-x denote-link=, =M-x denote-backlinks=, =M-x 1126 denote-rename-file=. These have been rock solid from the beginning. 1127 Everything else is for more specialised workflows. 1128 1129 I hope to produce a companion video to this changelog in the coming 1130 days. Though I am still reeling from the injury to my left hand (I 1131 wrote all this to not delay the package any longer). Please check back 1132 in my website's coding blog section to find the follow-up video: 1133 <https://protesilaos.com/codelog>. 1134 1135 [ Remember to consult the manual whenever you have a question about 1136 Denote. It is comprehensive and, in my opinion, a paradigm of how 1137 free software should be done for the benefit of users. I document 1138 everything in detail and am eager to continue this way. If something 1139 is unclear, contact me in person, use the mailing list, or open an 1140 issue on the GitHub/GitLab mirror. I do not check other fora or 1141 media and will thus not help you there. If you are writing custom 1142 code, remember to read the doc strings. I write them for you too. ] 1143 1144 ** Deprecated the ~denote-allow-multi-word-keywords~ 1145 :PROPERTIES: 1146 :CUSTOM_ID: h:a086d1d2-adb3-4151-a7af-813d79b4b3dc 1147 :END: 1148 1149 This user option enabled the use of keywords that consisted of 1150 multiple words. Those would be separated by hyphens. Such keywords do 1151 not work as Org =#+filetags= and also mess up with the neat search 1152 semantics of Denote's file-naming scheme where a hyphen prefix 1153 anchors the query to the =TITLE= component of the name. 1154 1155 Users who absolutely need multi-word keywords are encouraged to use 1156 the new ~denote-file-name-letter-casing~ option. More below. 1157 1158 ** Control the letter casing of file name components 1159 :PROPERTIES: 1160 :CUSTOM_ID: h:29319b8a-698b-4a1c-bab4-7b106a623de8 1161 :END: 1162 1163 By default, Denote downcases all components of the file name. The user 1164 option ~denote-file-name-letter-casing~ provides granular control over 1165 this behaviour. 1166 1167 The value it accepts is an alist where each element is a cons cell of 1168 the form =(COMPONENT . METHOD)=. The manual, or the variable's doc 1169 string, cover the details. The gist is that we can now instruct Denote 1170 to accept input verbatim, such as because we want to apply a 1171 =camelCase= convention or variants thereof. 1172 1173 Here is an example, where we downcase the title, but preserve the 1174 letter casing of the signature and keyword components with this: 1175 1176 #+begin_src emacs-lisp 1177 (setq denote-file-name-letter-casing 1178 '((title . downcase) 1179 (signature . verbatim) 1180 (keywords . verbatim) 1181 (t . downcase))) 1182 #+end_src 1183 1184 Users of the now-deprecated ~denote-allow-multi-word-keywords~ are 1185 encouraged to implement a letter casing convention with the help of 1186 this new user option. 1187 1188 Relevant sections in the manual: 1189 1190 - The file-naming scheme: 1191 <https://protesilaos.com/emacs/denote#h:4e9c7512-84dc-4dfb-9fa9-e15d51178e5d>. 1192 - Contol the letter casing of file names: 1193 <https://protesilaos.com/emacs/denote#h:6ae1ab8c-5e36-4216-8e93-f37f4447582c> 1194 1195 ** The ~denote-dired-mode~ should now work while toggling ~wdired~ 1196 :PROPERTIES: 1197 :CUSTOM_ID: h:18a3b515-9306-4911-ba2d-73e36efbdd32 1198 :END: 1199 1200 The writable version of Dired would break the colouration applied by 1201 ~denote-dired-mode~. I have arranged for this to not happen anymore, 1202 although it means that I had to add an advice to relevant wdired 1203 symbols because no proper hook is on offer. 1204 1205 ** The "do or create" commands are more intuitive to use 1206 :PROPERTIES: 1207 :CUSTOM_ID: h:5bcdc4b8-ecba-44d7-accc-0b26657aa29b 1208 :END: 1209 1210 Denote provides several commands with a "do or create" logic. For 1211 example, the ~denote-open-or-create~ prompts for a file to visit: if 1212 something matches the user's input, it is visited in a buffer, 1213 otherwise a new note is created with the given input. Same for 1214 ~denote-link-or-create~, mutatis mutandis. 1215 1216 Before, the "... or create" step did not make it obvious how the 1217 previous search terms could be reused. Whereas now those are set as 1218 the default minibuffer value at the title prompt, meaning that typing 1219 =RET= at the empty prompt will use that value, while =M-n= 1220 (~next-history-element~ with default settings) will put the text into 1221 the prompt for further editing. 1222 1223 I will answer this because I get asked about it: we still refrain from 1224 creating the new note outright because the search terms are not 1225 necessarily suitable for a new title. Remember that Denote's file name 1226 is optimised for searching: =-word= is specific to the title, =_word= 1227 to the keywords, and ==word= to the signature. Combine this with the 1228 ~orderless~ package and you frequently type something like =_jou -he= 1229 to match a file with the =journal= keyword and the word =hesitation= 1230 in its title. 1231 1232 *IMPORTANT NOTE:* some minibuffer completion User Interfaces preselect 1233 the first completion candidate, which is not always the same as the 1234 default value. Check with your UI of choice how to pass a default 1235 value and/or provide an empty input. For example, with the ~vertico~ 1236 package one can move up from the first candidate to select the prompt 1237 itself (the counter switches from =1/N= to =*/N=). 1238 1239 Relevant sections in the manual: 1240 1241 - Open an existing note or create it if missing: 1242 <https://protesilaos.com/emacs/denote#h:ad91ca39-cf10-4e16-b224-fdf78f093883>. 1243 - Link to a note or create it if missing: 1244 <https://protesilaos.com/emacs/denote#h:9e41e7df-2aac-4835-94c5-659b6111e6de>. 1245 1246 *** New "... or create with command" features for more flexibility 1247 :PROPERTIES: 1248 :CUSTOM_ID: h:6f475151-9d64-4dfb-8c59-694c93d56ce8 1249 :END: 1250 1251 As part of the wider "do or create" feature set, Denote provides the 1252 option to run a specific note-creating command instead of just using 1253 the standard ~denote~ one. For example, it is possible to call the 1254 ~denote-subdirectory~ command to pick a subdirectory of the 1255 ~denote-directory~ for the new note. Commands providing this facility 1256 are ~denote-open-or-create-with-command~ and ~denote-link-after-creating-with-command~. 1257 1258 Thanks to Vedang Manerikar for fixing a broken ~if~ clause during 1259 development: <https://lists.sr.ht/~protesilaos/denote/patches/46087>. 1260 1261 ** The title and signature prompts use minibuffer completion 1262 :PROPERTIES: 1263 :CUSTOM_ID: h:429847c8-ebf4-4b23-a597-5276309ef61a 1264 :END: 1265 1266 All Denote minibuffer prompts come with their own history. This means 1267 that =M-p= (~previous-history-element~) and =M-n= 1268 (~next-history-element~) always return relevant input. 1269 1270 The title and signature prompts now reuse their input history to 1271 provide completion. This means that the user can quickly access 1272 previous inputs, either to pass them directly or edit them further 1273 before inputting them. 1274 1275 [ Use the built-in ~savehist-mode~ to persist histories across sessions. ] 1276 1277 Remember to check with your minibuffer UI on how to input empty 1278 values at the prompt, should you ever need to do so. 1279 1280 For posterity, I first implemented this in commit =0d855bb=. However, 1281 it did not work with the default minibuffer because the =SPC= key 1282 performs completion (popping up the Completions buffer). So users 1283 could not easily input an arbitrary string for the title/signature. I 1284 thus reverted that commit in =9f692cb=. 1285 1286 [ The bug was reported by Suhail Singh on the mailing list: 1287 <https://lists.sr.ht/~protesilaos/denote/%3C652d82c0.c80a0220.e6282.dc47%40mx.google.com%3E#%3C65392fa6.050a0220.da61c.0ac8@mx.google.com%3E>. ] 1288 1289 Stefan Monnier suggested the use of the ~minibuffer-with-setup-hook~, 1290 which lets us disable =SPC= completion for the purposes of these 1291 functions. This is most welcome as the functionality is nice to have. 1292 Stefan's feedback was provided on the emacs-devel mailing list: 1293 <https://lists.gnu.org/archive/html/emacs-devel/2023-10/msg00631.html>. 1294 1295 ** Create a note with the region's contents 1296 :PROPERTIES: 1297 :CUSTOM_ID: h:ae798d1f-6fa2-4d99-91c9-0d5eb18b1bb0 1298 :END: 1299 1300 The command ~denote-region~ takes the contents of the active region 1301 and then prompts for a title and keywords. Once a new note is 1302 created, it inserts the contents of the region therein. This is 1303 useful to quickly elaborate on some snippet of text or capture it for 1304 future reference. 1305 1306 It also provides the ~denote-region-after-new-note-functions~ abnormal 1307 hook. Read the manual for more: 1308 <https://protesilaos.com/emacs/denote#h:2f8090f1-50af-4965-9771-d5a91a0a87bd>. 1309 1310 ** Comprehensive refinements to the ~denote-rename-buffer-mode~ 1311 :PROPERTIES: 1312 :CUSTOM_ID: h:91b3ba9f-8b10-4f1c-a08b-70f5e7140923 1313 :END: 1314 1315 This is an opt-in feature that automatically renames the buffer of 1316 newly visited Denote files according to the user's preferences. Not to 1317 be confused with renaming files: buffers are internal to Emacs. Enable 1318 it at startup by adding this to your configuration file: 1319 1320 #+begin_src emacs-lisp 1321 (denote-rename-buffer-mode 1) 1322 #+end_src 1323 1324 Relevant entries in the manual: 1325 1326 - Automatically rename Denote buffers: 1327 <https://protesilaos.com/emacs/denote#h:3ca4db16-8f26-4d7d-b748-bac48ae32d69>. 1328 - The ~denote-rename-buffer-format~ option: 1329 <https://protesilaos.com/emacs/denote#h:35507c18-35b1-41b9-9d80-52f54fcef3cb>. 1330 1331 *** The ~denote-rename-buffer-format~ option 1332 :PROPERTIES: 1333 :CUSTOM_ID: h:beeafe57-f110-4c11-87e7-10f682ca2386 1334 :END: 1335 1336 The user option ~denote-rename-buffer-format~ controls how the 1337 function ~denote-rename-buffer~ chooses the name of the 1338 buffer-to-be-renamed. This function is the one used by the 1339 ~denote-rename-buffer-mode~. 1340 1341 Users may want, for example, to include some text that makes Denote 1342 buffers stand out, such as a =[D]= prefix. Examples: 1343 1344 #+begin_src emacs-lisp 1345 ;; Use the title (default) 1346 (setq denote-rename-buffer-format "%t") 1347 1348 ;; Use the title and keywords with some emoji in between. 1349 (setq denote-rename-buffer-format "%t 🤨 %k") 1350 1351 ;; Use the title with a literal "[D]" before it 1352 (setq denote-rename-buffer-format "[D] %t") 1353 #+end_src 1354 1355 Users who need yet more flexibility are best served by writing their 1356 own function and assigning it to the ~denote-rename-buffer-function~ 1357 (in such a case, please contact me as I am curious to know what the 1358 underlying need is). 1359 1360 The manual or doc string of ~denote-rename-buffer-format~ cover the 1361 technicalities of the available format specifiers. 1362 1363 Thanks to Jean-Philippe Gagné Guay for intermediately refining parts 1364 of the code. This was done in pull request 177 on the GitHub mirror: 1365 <https://github.com/protesilaos/denote/pull/177>. 1366 1367 Thanks to Vedang Manerikar for ensuring that the string of the buffer 1368 is trimmed so that it never starts with an empty space (those buffers 1369 count as "internal" to Emacs and are not shown to the user): 1370 <https://lists.sr.ht/~protesilaos/denote/patches/46243>. 1371 1372 *** The ~denote-rename-buffer-mode~ also works with unsaved buffers 1373 :PROPERTIES: 1374 :CUSTOM_ID: h:e65bb546-af22-45fb-a918-d0e621b0e415 1375 :END: 1376 1377 Internal refinements to a Denote Lisp macro make this minor mode also 1378 work with new and unsaved Denote buffers. Whereas before only the 1379 buffers of existing files would be renamed. 1380 1381 ** Denote's renaming facilities are better than ever 1382 :PROPERTIES: 1383 :CUSTOM_ID: h:703b9021-f917-4b3f-9406-14992b2a4fe8 1384 :END: 1385 1386 Denote's value proposition is its efficient file-naming scheme that 1387 makes it easier to retrieve files even with rudimentary search tools. 1388 We provide several commands to rename existing files according to this 1389 scheme. The underlying file type does not matter (e.g. I use Denote to 1390 name my video files). 1391 1392 Relevant sections in the manual: 1393 1394 - Renaming files: 1395 <https://protesilaos.com/emacs/denote#h:532e8e2a-9b7d-41c0-8f4b-3c5cbb7d4dca>. 1396 - Front matter: 1397 <https://protesilaos.com/emacs/denote#h:13218826-56a5-482a-9b91-5b6de4f14261>. 1398 1399 *** Rename like an expert with ~denote-rename-no-confirm~ 1400 :PROPERTIES: 1401 :CUSTOM_ID: h:8798dd8c-819d-4fda-9865-77d9734da28c 1402 :END: 1403 1404 By default, the ~denote-rename-file~ command asks for a final 1405 confirmation before carrying out its function. The new user option 1406 ~denote-rename-no-confirm~ can be bound to a non-nil value to skip 1407 that step. 1408 1409 This only applies to ~denote-rename-file~. Other commands that rename 1410 files in bulk never prompt for such confirmation (it would make them 1411 cumbersome to use, plus it is assumed that the user who performs a 1412 batch operation understands the implications). 1413 1414 *** The ~denote-rename-file~ command prompts for a signature 1415 :PROPERTIES: 1416 :CUSTOM_ID: h:e4e7e3d8-40e3-4f58-a19f-df34ccbfdbbd 1417 :END: 1418 1419 This command used to only ask for a title and keywords. Now it allows 1420 to use a signature as well. An empty input means that the signature is 1421 ignored. AGAIN, please check with your minibuffer completion UI on how 1422 to input an empty value, otherwise you will not get what you expect. 1423 1424 *** Rename mutliple files sequentially with ~denote-dired-rename-files~ 1425 :PROPERTIES: 1426 :CUSTOM_ID: h:dcb623aa-fc4d-4d84-80e4-a540b6dbb144 1427 :END: 1428 1429 This provides the same interface as ~denote-rename-file~, only it 1430 works over a list of marked Dired files. 1431 1432 Internally, the prompts for title, keywords, and signature are 1433 improved to display the underlying file that is affected by the 1434 current operation. As the user renames files, the prompts reflect 1435 which one is current. 1436 1437 *** The name of ~denote-dired-rename-marked-files~ has changed 1438 :PROPERTIES: 1439 :CUSTOM_ID: h:f9a16fc1-840d-400f-a5ae-a7791fac441f 1440 :END: 1441 1442 It is now called ~denote-dired-rename-marked-files-with-keywords~ to 1443 better communicate what it does. In short, this is a quick way to add 1444 the given keywords to a list of files, converting them to the Denote 1445 file-naming scheme in case they are not already using it. For the full 1446 interactive power, use the aforementioned ~denote-dired-rename-files~. 1447 1448 *** The ~denote-rename-file-using-front-matter~ can be used without saving its buffer 1449 :PROPERTIES: 1450 :CUSTOM_ID: h:bfc194c2-5980-482a-aa1c-feb4ced992d1 1451 :END: 1452 1453 This is now possible because of changes to underlying functions (a 1454 Denote Lisp macro---not to bother you with technicalities). 1455 1456 Same principle for ~denote-rename-file-using-front-matter~. 1457 1458 *** The name of ~denote-change-file-type~ has changed 1459 :PROPERTIES: 1460 :CUSTOM_ID: h:3bf4b6c4-8399-4d5d-8df1-6495f5bfc579 1461 :END: 1462 1463 It is now called ~denote-change-file-type-and-front-matter~ to avoid 1464 confusion as to whether Denote converts files from one format to 1465 another (there are specialised tools for that). 1466 1467 *** Renaming a file returns the new file path for programmatic use 1468 :PROPERTIES: 1469 :CUSTOM_ID: h:1d7bffd1-e422-420d-b453-9a36dd8508f7 1470 :END: 1471 1472 Thanks to mentalisttraceur for requesting this feature in issue 183 on 1473 the GitHub mirror: <https://github.com/protesilaos/denote/issues/183>. 1474 1475 ** Link to a file with a signature 1476 :PROPERTIES: 1477 :CUSTOM_ID: h:b154ef64-c3b4-4e15-b533-c59d5b2ebf6b 1478 :END: 1479 1480 The ~denote-link-with-signature~ command prompts for a file that has a 1481 =SIGNATURE= component and links to it. The link's description includes 1482 the text of the signature as well as the title. 1483 1484 Thanks to Mark Olson for mentioning this idea. It was done in issue 1485 167 on the GitHub mirror: <https://github.com/protesilaos/denote/issues/167>. 1486 1487 I implemented it live, while also refactoring relevant parts of the 1488 code to be more abstract/reusable: 1489 <https://protesilaos.com/codelog/2023-09-25-emacs-live-mostly-denote/>. 1490 1491 Thanks to Alan Schmitt for spotting and fixing a regression caused by 1492 the above: 1493 <https://lists.sr.ht/~protesilaos/denote/%3Cm2cyy5rt68.fsf%40mac-03220211.irisa.fr%3E>. 1494 1495 ** Renaming GPG or Age encrypted file works as expected 1496 :PROPERTIES: 1497 :CUSTOM_ID: h:9ceaf432-797c-46e5-aaf8-d7180ad66689 1498 :END: 1499 1500 Emacs can seamlessly visit a =.gpg= or =.age= file. Denote has nothing 1501 to do with encryption, though it takes care to recognise the 1502 underlying file type and to perform its work accordingly. However, 1503 prior versions of Denote contained a bug in how file extensions were 1504 handled: it would keep the encryption extension but remove the file 1505 type extension before it (so ".org.gpg" would wrongly become ".gpg"). 1506 1507 Thanks to Jens Östlund for reporting a bug with ~denote-keywords-add~ 1508 on an encrypted file, which prompted me to investigate this further 1509 and fix the issue holistically. This was done in issue 172 on the 1510 GitHub mirror: <https://github.com/protesilaos/denote/issues/172>. 1511 1512 Interested parties are advised to check the two new public functions, 1513 ~denote-get-file-extension~ and ~denote-get-file-extension-sans-encryption~, 1514 for the implementation details. In short, we had a problem with all 1515 operations that needed to retrieve the file extension when that 1516 included an encryption component. 1517 1518 ** The optional ~denote-journal-extras~ 1519 :PROPERTIES: 1520 :CUSTOM_ID: h:54723661-31f8-4cab-9be5-4cab19e44dc7 1521 :END: 1522 1523 The manual of Denote has long provided code samples to achieve 1524 particularised results. Among those were snippets to streamline the 1525 use of Denote for journaling. 1526 1527 To make things even easier for users, we now have the 1528 =denote-journal-extras.el=. It consolidates the rich corpus of 1529 documented snippets into an easy-to-use and formally maintained 1530 package. Thanks to Vedang Manerikar for providing the impetus for this 1531 process. This was done on the mailing list: 1532 <https://lists.sr.ht/~protesilaos/denote/patches/43255#%3C20230803170935.60833-2-ved.manerikar@gmail.com%3E>. 1533 1534 The new file is optional. It can be loaded thus: 1535 1536 #+begin_src emacs-lisp 1537 (require 'denote-journal-extras) 1538 #+end_src 1539 1540 The main idea is to quickly create journal entries. Check the manual 1541 for the details, including the commands to use and the variables to 1542 configure: <https://protesilaos.com/emacs/denote#h:4a6d92dd-19eb-4fcc-a7b5-05ce04da3a92>. 1543 1544 Thanks to Kostas Andreadis for working on a comment I had included in 1545 a working state of the code about the inclusion of templates. Kostas 1546 made it possible to use the Denote template prompt (per the 1547 ~denote-templates~ user option) as part of the creation of a new 1548 journal entry. This was done in pull request 173 on the GitHub mirror: 1549 <https://github.com/protesilaos/denote/pull/173>. The change is less 1550 than 15 lines and thus Kostas does not need to assign copyright to the 1551 Free Software Foundation. 1552 1553 Also thanks to TJ Stankus for reporting a case where 1554 ~denote-journal-extras-title-format~ did not accept a ~nil~ value (as 1555 it should). This was done in issue 176 on the GitHub mirror: 1556 <https://github.com/protesilaos/denote/issues/176>. 1557 1558 ** The optional ~denote-silo-extras~ 1559 :PROPERTIES: 1560 :CUSTOM_ID: h:618495d2-0c5b-48b4-af88-56f3d969697c 1561 :END: 1562 1563 This is the same idea as with the =denote-journal-extras.el=: we had 1564 the code in the manual and are now formally distributing it. Thanks 1565 again to Vedang Manerikar for initiating this process. It was done on 1566 the mailing list: 1567 <https://lists.sr.ht/~protesilaos/denote/patches/43255>. 1568 1569 Use this optional feature with: 1570 1571 #+begin_src emacs-lisp 1572 (require 'denote-silo-extras) 1573 #+end_src 1574 1575 Consult the manual for the details: 1576 <https://protesilaos.com/emacs/denote#h:e43baf95-f201-4fec-8620-c0eb5eaa1c85>. 1577 1578 ** The infrastructure for unique identifiers is more robust 1579 :PROPERTIES: 1580 :CUSTOM_ID: h:1d538d7f-52e6-4653-b057-c62606752934 1581 :END: 1582 1583 For Denote version =2.0.0= I introduced a general scheme intended to 1584 avoid scenaria where duplicate identifiers could be created (thus 1585 breaking a premise of Denote). Jean-Philippe Gagné Guay iterated over 1586 the code to make it more robust and to fix some of the cases I had not 1587 accounted for. This was done in pull request 159 on the GitHub mirror: 1588 <https://github.com/protesilaos/denote/pull/159>. Same idea in pull 1589 request 187: <https://github.com/protesilaos/denote/pull/187>. 1590 1591 ** For developers or advanced users 1592 :PROPERTIES: 1593 :CUSTOM_ID: h:9031dc82-ab75-438c-a2c8-a1250ae48671 1594 :END: 1595 1596 Denote has a clean code base with small and composable functions. This 1597 encourages hackability. Each definition in the source is documented, 1598 while the manual provides an overview of every public symbol. 1599 1600 - Added :: ~denote-get-file-extension~, 1601 ~denote-get-file-extension-sans-encryption~, 1602 ~denote-keywords-combine~, 1603 ~denote-retrieve-keywords-value-as-string~, 1604 ~denote-title-prompt-current-default~, ~denote-command-prompt~. 1605 1606 - Refactored :: ~denote-all-files~, ~denote-signature-prompt~, 1607 ~denote-file-prompt~, ~denote-title-prompt~, 1608 ~denote-rewrite-front-matter~. 1609 1610 Please read their documentation strings for the details. Or check the 1611 manual: <https://protesilaos.com/emacs/denote#h:c916d8c5-540a-409f-b780-6ccbd90e088e>. 1612 1613 ** Check out the ~denote-explore~ package by Peter Prevos 1614 :PROPERTIES: 1615 :CUSTOM_ID: h:759d0276-17e8-4461-9ee4-b4d07840dd7a 1616 :END: 1617 1618 Peter posted this on the mailing list and I asked if it was okay to 1619 mention it in the release notes of Denote. If you have a relevant 1620 announcement to make, consider sending it to our mailing list. 1621 1622 #+begin_quote 1623 Hi folks, 1624 1625 I have just updated the denote-explore package: 1626 https://github.com/pprevos/denote-explore 1627 1628 It does three things: 1629 1630 1. Summary statistics: Count and visualise keywords and note types 1631 2. Random walks: Generate new ideas using serendipity 1632 3. Network visualisation: Visualise your Denote network of links 1633 1634 It contains a rudimentary network visualisation function, relying 1635 on the R language. I will need some D3.js expertise to improve the 1636 visualisation. 1637 1638 There should be a way to generate the basic network structure just 1639 using Elisp and feeding a JSON to D3.js. 1640 1641 Regards 1642 1643 P:) 1644 #+end_quote 1645 1646 ** Miscellaneous 1647 :PROPERTIES: 1648 :CUSTOM_ID: h:01dc6bb0-53ac-43e1-b12e-484c99a6c2a7 1649 :END: 1650 1651 - During this release cycle, I made lots of changes that in one way or 1652 another related to the ~denote-file-prompt~. It was relying on a 1653 =project.el= mechanism that did not allow us to do everything we 1654 needed. I have thus arranged for it to use the standard 1655 ~completing-read~ mechanism. There are subtle differences in 1656 behaviour, though the core idea is the same. This change fixes a few 1657 not-so-obvious bugs. Interested parties are advised to refer to the 1658 message in commit =50d1bbdf1e8ffe0f449f2f5da02f9b70322fff7d=. 1659 1660 - All commands that use the ~denote~ function internally (i.e. 1661 anything that creates a new note) call the 1662 ~denote-after-new-note-hook~ as part of their work. This hook is 1663 mostly intended for advanced users who want to do something after a 1664 new note is produced. 1665 1666 - The ~menu-bar-mode~ submenu of Denote is now positioned where it 1667 should be after the "Tools". Thanks to Noboru Ota for the patch: 1668 <https://lists.sr.ht/~protesilaos/denote/patches/44738>. 1669 1670 - The ~menu-bar-mode~ entry of Denote includes the new commands. This 1671 is a nice way to discover more of what Denote can do. 1672 1673 - The commands ~denote-backlinks-prev~ and ~denote-backlinks-next~ are 1674 only meant to be used inside the Denote backlinks buffer. As such, 1675 they now produce an error when called elsewhere (I wish I could hide 1676 them from =M-x= altogether). 1677 1678 - The ~denote-extract-keywords-from-front-matter~ always returns a 1679 list, thus avoiding an erroneous case. Thanks to Vedang Manerikar 1680 for fixing the bug: <https://lists.sr.ht/~protesilaos/denote/patches/46420>. 1681 1682 - The =T= in the Denote identifier component now has its own face: 1683 ~denote-faces-time-delimiter~. This is used by the backlinks buffer 1684 and the ~denote-dired-mode~. The idea is to introduce a subtle 1685 distinction between the date and time constituents of the 1686 identifier. Those who want the =T= to be the same colour as the rest 1687 of the identifier, can make the ~denote-faces-time-delimiter~ 1688 inherit the ~denote-faces-date~. For example: 1689 1690 #+begin_src emacs-lisp 1691 (set-face-attribute 'denote-faces-time-delimiter nil :inherit 'denote-faces-date) 1692 #+end_src 1693 1694 Thanks to Jean-Charles Bagneris for sending this patch: 1695 <https://lists.sr.ht/~protesilaos/denote/patches/43072>. 1696 1697 - Fixed a ~nil~ file expansion in the function 1698 ~denote--extract-title-from-file-history~. Thanks to ezchi for 1699 bringing this matter to my attention. It was done in issue 166 on 1700 the GitHub mirror: 1701 <https://github.com/protesilaos/denote/issues/166>. 1702 1703 - A link can be created from inside an ~org-capture~ buffer. This 1704 means that we can call ~denote-link~ (and related) while capturing a 1705 new note with ~org-capture~. Thanks to Peter Smith for reporting the 1706 bug in issue 186 on the GitHub mirror: 1707 <https://github.com/protesilaos/denote/issues/186>. 1708 1709 - We stopped using ~vc-rename-file~ to rename files. The reason is 1710 that it requires the buffer to be saved, but we do not want that 1711 after modifying the front matter because we want to give the user a 1712 chance to confirm what happened. Thanks to Frédéric Willem for 1713 reporting the problem in issue 185 on the GitHub mirror: 1714 <https://github.com/protesilaos/denote/issues/185>. 1715 1716 - Thanks to Ivan Sokolov for removing a double negative logic in a 1717 snippet. This was done in pull request 162 on the GitHub mirror: 1718 <https://github.com/protesilaos/denote/pull/162>. 1719 1720 ** Git commits 1721 :PROPERTIES: 1722 :CUSTOM_ID: h:d8f30943-70dd-45fe-8cf1-4c3918152aeb 1723 :END: 1724 1725 Just an overview of what we did. Every contribution matters. 1726 1727 #+begin_src 1728 ~/Git/Projects/denote $ git shortlog 2.0.0..2.1.0 --summary --numbered 1729 153 Protesilaos Stavrou 1730 15 Jean-Philippe Gagné Guay 1731 5 Vedang Manerikar 1732 1 Alan Schmitt 1733 1 Ivan Sokolov 1734 1 Jean-Charles Bagneris 1735 1 Kostas Andreadis 1736 1 Noboru Ota 1737 1 Peter Prevos 1738 #+end_src 1739 1740 * Version 2.0.0 on 2023-07-21 1741 :PROPERTIES: 1742 :CUSTOM_ID: h:3f17bf03-4c47-4410-abf8-1db4a0ac7775 1743 :END: 1744 1745 This is the second major version of Denote, close to one year after 1746 its initial release. The video demo I did back then remains relevant, 1747 even though lots of details have changed. 1748 1749 ** Notes have a new optional SIGNATURE field 1750 :PROPERTIES: 1751 :CUSTOM_ID: h:a3a9e14d-4132-47c0-a23c-cb008a141668 1752 :END: 1753 1754 It is now possible to create notes that include a =SIGNATURE= field in 1755 their file name. Either use the convenience command ~denote-signature~ 1756 or configure the user option ~denote-prompts~ to affect what the ~denote~ 1757 command should prompt for. 1758 1759 Signatures are arbitrary strings of characters that enable the user to 1760 further qualify their documents. One possible workflow is to write 1761 relational notes, such that =1a1= is the first extension of another 1762 note with a =1a= signature. 1763 1764 The design of the =SIGNATURE= field is consistent with the Denote 1765 file-naming scheme. The field separator is the double equals sign 1766 (~==~), while words that comprise the signature are joined together by 1767 a single equals sign. As such, the user can prefix a search with an 1768 equals sign to match words in the =SIGNATURE=, just as they would use 1769 dashes for the =TITLE= and underscores for the =KEYWORDS=. 1770 1771 [ Read the manual for the technicalities of the Denote file-naming 1772 scheme. This is not limited to "notes": any file can be named 1773 accordingly (I do it with my videos, for example). ] 1774 1775 Signatures are not included in a file's front matter. This is a 1776 strategic decision to preserve backward compatibility, while not 1777 introducing a feature that has not enjoyed widespread usage. I want 1778 to make signatures behave the same as the rest of the file name 1779 fields, though I am interested to learn how users employ them in their 1780 workflow. 1781 1782 The signature extension was discussed at length on the GitHub mirror 1783 in issue 115: <https://github.com/protesilaos/denote/issues/115>. 1784 Thanks to Stefan Thesing, Mirko Hernandez, Noboru Ota (nobiot), 1785 Xiaoxing Hu, nbehrnd, Elias Storms, and 101scholar for helping me 1786 reason about this feature, understand its scope, and prototype its 1787 implementation. 1788 1789 Also thanks to Alfredo Borrás and Jeremy Friesen for discussing with 1790 me the field delimiter of signatures on the mailing list: 1791 <https://lists.sr.ht/~protesilaos/denote/%3C2A597B4E-5F18-4D97-9457-B3C859DAA020%40zoho.eu%3E>. 1792 Thanks to Kai von Fintel for doing the same on the GitHub mirror in 1793 issue 147: <https://github.com/protesilaos/denote/issues/147>. 1794 1795 Read the original announcement: 1796 <https://protesilaos.com/codelog/2023-03-20-emacs-denote-signature-feature/>. 1797 1798 As part of the development, I fixed a case where 1799 ~denote-rename-file-using-front-matter~ would fail if it could not 1800 find a signature 1801 1802 The idea is that we want the command to behave the way it always did 1803 when the file has no signature and to preserve the signature when it 1804 is present. 1805 1806 Thanks to relict for reporting the issue on the mailing list: 1807 <https://lists.sr.ht/~protesilaos/denote/%3C87zg86lru9.fsf%40kotlak.com%3E>. 1808 1809 ** The rename commands avoid creating duplicate identifiers 1810 :PROPERTIES: 1811 :CUSTOM_ID: h:d24645a3-ad02-450c-b3d7-af7802aa0b26 1812 :END: 1813 1814 Denote provides commands to rename an existing file to one that 1815 follows the Denote file-naming scheme (videos, PDFs, other text 1816 documents, ...). Check, for example, the ~denote-rename-file~ and 1817 ~denote-dired-rename-marked-files~. The idea is to make everything 1818 easier to search. 1819 1820 In prior versions, these commands could produce duplicate identifiers 1821 if the modification date of the underlying files was the same. Such a 1822 scenario occurs when the files are modified programmatically, as with 1823 the =touch= command or the various =git= operations. 1824 1825 Denote will now take care to increment the identifier until it becomes 1826 unique within the current scope. 1827 1828 Thanks to Felipe Balbi for reporting this bug in issue 105 on the 1829 GitHub mirror: <https://github.com/protesilaos/denote/issues/105>. 1830 1831 Thanks to Vedang Manerikar and Jean-Charles Bagneris for commenting on 1832 this feature on the mailing list: 1833 <https://lists.sr.ht/~protesilaos/denote/%3C87v8emeus0.fsf%40protesilaos.com%3E>. 1834 1835 Thanks to Ashton Wiersdorf for noticing a mistake I made that caused a 1836 regression in ~denote-rename-file~: 1837 <https://lists.sr.ht/~protesilaos/denote/%3Cm2lefbbzl1.fsf%40wiersdorfmail.net%3E>. 1838 1839 *** Optional arguments affect ~denote-dired-rename-marked-files~ 1840 :PROPERTIES: 1841 :CUSTOM_ID: h:6ea998be-83dd-4c67-945c-11011372818f 1842 :END: 1843 1844 The ~denote-dired-rename-marked-files~ now accepts two optional 1845 arguments. When called interactively, these are interpreted as a 1846 single or double universal prefix argument (=C-u= by default, though 1847 do =M-x where-is= and search for ~universal-argument~). 1848 1849 The first argument, named =SKIP-FRONT-MATTER-PROMPT=, skips the "yes 1850 or no" prompt requested at the outset of the operation, passing to it 1851 an affirmative response. Thanks to Jay Rajput for asking the question 1852 that inspired me to implement this. It was done in issue 155 on the 1853 GitHub mirror: <https://github.com/protesilaos/denote/issues/155>. 1854 1855 The second argument, named =NO-UNIQUE-ID-CHECK=, will not perform any 1856 checks for potential duplicate identifiers. The default is to check 1857 for duplicates and increment them such that they become unique. The 1858 reason this optional argument exists is for those who want to speed up 1859 the process, perhaps because they know ahead of time all identifiers 1860 will be unique or do not care about them. 1861 1862 Thanks to Bruno Boal for refining how the prefix argument is 1863 processed. The patch was sent via a private channel. The change is 1864 small and thus does not require copyright assignment to the Free 1865 Software Foundation. 1866 1867 ** Menu entries help users discover Denote 1868 :PROPERTIES: 1869 :CUSTOM_ID: h:651e5561-f9ce-41f6-bad3-d54ce2dcff04 1870 :END: 1871 1872 Users of ~menu-bar-mode~ and/or ~context-menu-mode~ will now find a 1873 submenu with points of entry to Denote. Refer to the publication I 1874 made on my website, as it includes a picture: 1875 <https://protesilaos.com/codelog/2023-03-31-emacs-denote-menu/>. I 1876 will save the thousand words for the following sections. 🙃 1877 1878 There is a known issue where the ~menu-bar-mode~ entry is positioned 1879 before the =File= submenu. Apparently, there exists an inelegant way 1880 to place the menu elsewhere, but I am not willing to maintain hacks 1881 for missing functionality. If someone knows a clear way to put the 1882 submenu elsewhere, please contact me: I want it to be after =Tools=. 1883 1884 Thanks to Kai von Fintel and Noboru Ota (nobiot) for discussing the 1885 placement of the submenu: 1886 <https://lists.sr.ht/~protesilaos/denote/%3C2B60992C-0FC9-42CC-B669-69A544450FEF%40mit.edu%3E>. 1887 1888 ** "Link" commands have simpler names 1889 :PROPERTIES: 1890 :CUSTOM_ID: h:acf95a79-3c45-423d-a88f-d6eed7fa5387 1891 :END: 1892 1893 Originally, Denote was organised as a collection of several files, 1894 each of which had its own prefix like =denote-dired.el=, and 1895 =denote-link.el=. This arrangement was deemed surplus to requirements 1896 and all core code was consolidated in =denote.el=. An artefact of 1897 that design was the presence of symbols that retained their admittedly 1898 awkward names, like the command ~denote-link-backlinks~ or 1899 ~denote-link-add-missing-links~. 1900 1901 All such commands are deprecated. They are replaced with more 1902 discoverable names. The deprecation is done in such a way that the 1903 old names are aliases for the new ones, but the user is warned not to 1904 rely on them. 1905 1906 The new names in detail: 1907 1908 | Old name 🤨 | New name 🤩 | 1909 |-------------------------------------+---------------------------------------------------------------| 1910 | ~denote-link-add-links~ | ~denote-add-links~ | 1911 | ~denote-link-add-missing-links~ | ~denote-add-missing-links~ | 1912 | ~denote-link-backlinks~ | ~denote-backlinks~ | 1913 | ~denote-link-find-file~ | ~denote-find-link~ | 1914 | ~denote-link-insert-link~ | ~denote-insert-link~ (alias for ~denote-link~) | 1915 | ~denote-link-show-backlinks-buffer~ | ~denote-show-backlinks-buffer~ (alias for ~denote-backlinks~) | 1916 1917 ** Denote buffers can have shorter names 1918 :PROPERTIES: 1919 :CUSTOM_ID: h:98f6b10a-ea29-49d1-8d3f-e2f0409f4c8f 1920 :END: 1921 1922 The Denote file-naming scheme is designed to be a low-tech way of 1923 embedding information in files, making them easier to find. A 1924 downside is that the names are longer than =blah.txt= and so the 1925 default Emacs behaviour is to derive a buffer name from the file name. 1926 1927 The new optional =denote-rename-buffer.el= provides a minor mode to 1928 automatically rename the buffer of an existing file, such that it 1929 reflects the file's =TITLE= field. Users must enable 1930 ~denote-rename-buffer-mode~. 1931 1932 The renaming procedure is controlled by the user option 1933 ~denote-rename-buffer-function~. By default, it provides the means to 1934 rename using (i) the title, (ii) the identifier, or (iii) a custom 1935 function that returns a string. Experienced users can refer to 1936 ~denote-rename-buffer-with-title~ to draw inspiration on the design of 1937 such a function. 1938 1939 Thanks to Morgan Davidson for asking a question that inspired me to 1940 implement this feature. The discussion took place in issue 151 on the 1941 GitHub mirror <https://github.com/protesilaos/denote/issues/151>. 1942 1943 ** Silos work as directory trees 1944 :PROPERTIES: 1945 :CUSTOM_ID: h:113820c4-7a6f-4126-9a44-92bfa59744e2 1946 :END: 1947 1948 Denote provides a feature to isolate files in to their own silos, each 1949 of which functions as its own ~denote-directory~ variable. The 1950 technicalities are explained in the manual. Silos have proven to be a 1951 valuable aspect of file management and I have thus expanded their 1952 scope to work as fully fledged directory trees. This means that we no 1953 longer assume a silo to be a flat directory listing, but instead 1954 recognise any subdirectories inside of it. 1955 1956 Thanks to relict007, Hilde Rhyne, Mirko Hernández, Noboru Ota 1957 (nobiot), Alan Schmitt, hapst3r, and Hilde Rhyne for their 1958 participation in the relevant discussions: 1959 1960 - <https://lists.sr.ht/~protesilaos/denote/%3C87fsb72nge.fsf%40protesilaos.com%3E> 1961 - <https://lists.sr.ht/~protesilaos/denote/%3C80CBB671-D812-4EA8-8C80-85F9F4144051%40disroot.org%3E> 1962 - <https://lists.sr.ht/~protesilaos/denote/%3C87pma6t59i.fsf%40kotlak.com%3E> 1963 - <https://github.com/protesilaos/denote/issues/129> (GitHub mirror) 1964 - <https://lists.sr.ht/~protesilaos/denote/%3CB124A5AF-9968-4F7E-9F4B-2BC763E0BFCF@disroot.org%3E#%3Cm0sff0nnhb.fsf@disroot.org%3E>. 1965 1966 ** Keywords do not accept multiple words by default 1967 :PROPERTIES: 1968 :CUSTOM_ID: h:08f23806-9570-4031-86e4-810b3e93be81 1969 :END: 1970 1971 The idea is to have short keywords and then use more than one, if 1972 necessary. We do not want to encourage the habit of long keywords 1973 that become overly specific, while we want to avoid the use of 1974 dashes as delimited in the file name's =KEYWORDS= field. 1975 1976 Technically, this changes the default value of the user option 1977 ~denote-allow-multi-word-keywords~. Users who preferred the old 1978 behaviour can simply toggle it on. 1979 1980 ** Pass arguments to Org capture 1981 :PROPERTIES: 1982 :CUSTOM_ID: h:58ff6dd3-693a-4437-9217-8e876d92c975 1983 :END: 1984 1985 Denote is not an extension of Org mode, though it can integrate with 1986 ~org-capture~. I now make it possible to design a capture template 1987 that uses specific prompts. Consult the section in the manual titled 1988 "Create note with specific prompts using Org capture". 1989 1990 Thanks to Aditya Yadav for asking about this in issue 132 on the 1991 GitHub mirror: <https://github.com/protesilaos/denote/issues/132>. 1992 1993 ** Change an existing note's file type 1994 :PROPERTIES: 1995 :CUSTOM_ID: h:e1e874e3-d8ad-4685-aa62-59ad07078db2 1996 :END: 1997 1998 The command ~denote-change-file-type~ changes the file type of an 1999 existing note. The available options are those among 2000 ~denote-file-type~. Thanks to Jean-Philippe Gagné Guay for the 2001 contribution, which was done in pull request 137 on the GitHub mirror: 2002 <https://github.com/protesilaos/denote/pull/137>. 2003 2004 ** Denote dynamic blocks can now parse ~rx~ notation 2005 :PROPERTIES: 2006 :CUSTOM_ID: h:fe595ee7-8ba6-4ca3-aa66-35aa4e5ca0f5 2007 :END: 2008 2009 Denote can leverage the Org feature of "dynamic blocks" to produce 2010 lists of links/backlinks. This is especially useful for metanotes 2011 (read the Denote manual---I document everything for a reason). 2012 2013 Before, regular expressions were implemented only as strings while now 2014 they can also be written using the ~rx~ notation. Thanks to Mirko 2015 Hernandez for proposing this feature and discussing it with me in 2016 issue 122 on the GitHub mirror: 2017 <https://github.com/protesilaos/denote/issues/122>. 2018 2019 Thanks to Elias Storms, the author of =denote-org-dblock.el=, for 2020 iterating on this functionality. This was done in pull request 130 on 2021 the GitHub mirror: <https://github.com/protesilaos/denote/pull/130>. 2022 2023 ** Made links to non-note files works as intended 2024 :PROPERTIES: 2025 :CUSTOM_ID: h:431a8952-0d71-4ba6-b6ae-85e5f7d520b9 2026 :END: 2027 2028 The function ~denote-get-path-by-id~ is refactored to accept any file 2029 with an identifier. This always was its intended purpose. The user 2030 was always able to create =denote:= Org link types to, for example, 2031 =jpg= files but ~denote-get-path-by-id~ was refusing to resolve the 2032 otherwise valid path. Thanks to user relict007 for reporting the 2033 problem and discussing it with me in issue 135 on the GitHub mirror: 2034 <https://github.com/protesilaos/denote/issues/135>. 2035 2036 The change was not trivial. It was followed up by a patch from Noboru 2037 Ota (nobiot) which elaborated on the conditionality. Quoting from 2038 commit =9ce9a24=: 2039 2040 #+begin_quote 2041 fix(denote-get-path-by-id): #135 2042 2043 Reference: https://github.com/protesilaos/denote/issues/135 2044 2045 This patch change function 'denote-get-path-by-id' to allow for the following: 2046 2047 - A single ID points to multiple files with different extensions 2048 - Denote needs to find a single file out of the multiple files 2049 - This is not necessarily a user error (export an Org file to an HTML) 2050 - Denote should let user decide their "primary" file extension 2051 2052 The case the patch is intended to fix goes something like this: 2053 2054 - You have 20230216__mynotes--tag.org. 2055 - You export it to 20230216__mynotes--tag.html. 2056 - Both files are in denote-directory 2057 - This means you have two files with the same ID with different 2058 extensions denote-link-find-file, denote-link-find-backlink, and xref 2059 integration might find the html file INSTEAD OF the .org file 2060 2061 This is because html is earlier in the alphabetical order than 2062 org. Because the function uses seq-find, it will find the .html file 2063 first and returns it. 2064 #+end_quote 2065 2066 ** The ~denote-rename-file-using-front-matter~ works with empty keywords 2067 :PROPERTIES: 2068 :CUSTOM_ID: h:b00f228d-7f84-4d84-8d5f-ac90ea6b1065 2069 :END: 2070 2071 Keywords are an optional field in the Denote file-naming scheme. 2072 However, an earlier version of the command mentioned in this heading 2073 was considering them mandatory and would refuse to proceed if the 2074 keywords were nil. Thanks to Eduardo Grajeda for fixing this: 2075 <https://lists.sr.ht/~protesilaos/denote/patches/39896>. 2076 2077 The change is within the ~15 line limit and does not require copyright 2078 assignment to the Free Software Foundation. 2079 2080 ** The ~denote-title-prompt~ has its own history 2081 :PROPERTIES: 2082 :CUSTOM_ID: h:91f370f4-9fd1-461b-8ba4-fd9ba2d9c7a8 2083 :END: 2084 2085 Denote implements minibuffer histories for all its relevant functions. 2086 This makes it easier for users to retrieve their previous inputs and 2087 to not get irrelevant ones. 2088 2089 Before, the ~denote-title-prompt~ was not using its own history but 2090 was instead relying on another one that was intended only for file 2091 paths, thus mixing unrelated inputs. 2092 2093 Thanks to Jonathan Sahar for bringing this matter to my attention. 2094 This was done in issue 144 on the GitHub mirror: 2095 <https://github.com/protesilaos/denote/issues/144>. 2096 2097 ** For developers or advanced users 2098 :PROPERTIES: 2099 :CUSTOM_ID: h:dcc52671-2127-47e0-9167-003f40ca3a54 2100 :END: 2101 2102 *** Made it possible to add predicates for recursive file listing 2103 :PROPERTIES: 2104 :CUSTOM_ID: h:62546ec1-6ec8-41c7-9a18-10a531b534ce 2105 :END: 2106 2107 The helper function ~denote--directory-all-files-recursively~ accepts 2108 predicates to help speed up its work. 2109 2110 Thanks to Wade Mealing for reporting the issue about the performance 2111 of the built-in function ~directory-files-recursively~ in large, 2112 nested directories. And thanks to Graham Marlow for the patch, which 2113 was prepared as part of an extended discussion with me: 2114 2115 - <https://lists.sr.ht/~protesilaos/denote/patches/40370> 2116 - <https://lists.sr.ht/~protesilaos/denote/%3C20230414000311.1981-1-graham%40mgmarlow.com%3E#%3C76ed9fe2-d597-f7b9-5e59-717aeb77c3c3@mgmarlow.com%3E> 2117 - <https://lists.sr.ht/~protesilaos/denote/patches/40384> 2118 - <https://lists.sr.ht/~protesilaos/denote/%3C87edonhvy0.fsf%40protesilaos.com%3E> 2119 - <https://lists.sr.ht/~protesilaos/denote/%3C76ed9fe2-d597-f7b9-5e59-717aeb77c3c3%40mgmarlow.com%3E> 2120 - <https://lists.sr.ht/~protesilaos/denote/%3C87zg75q4er.fsf%40protesilaos.com%3E> 2121 - <https://lists.sr.ht/~protesilaos/denote/%3CCAO4UgPQtxhhqW0tB7eZnVh4nF9vLvnVGx+5oB_78_dg32URSLA%40mail.gmail.com%3E> 2122 2123 *** New public symbols 2124 :PROPERTIES: 2125 :CUSTOM_ID: h:ed723274-a78e-4cfd-9655-c3bfe0fb1e68 2126 :END: 2127 2128 The following are now public symbols that we commit to support and 2129 document henceforth: 2130 2131 + Function ~denote-file-type-extensions~ :: Return all file type 2132 extensions in ~denote-file-types~. 2133 2134 + Variable ~denote-encryption-file-extensions~ :: List of strings 2135 specifying file extensions for encryption. 2136 2137 + Function ~denote-file-type-extensions-with-encryption~ :: Derive 2138 ~denote-file-type-extensions~ plus ~denote-encryption-file-extensions~. 2139 2140 + Function ~denote-link-return-links~ :: Return list of links in 2141 current or optional =FILE=. Also see ~denote-link-return-backlinks~. 2142 2143 + Function ~denote-link-return-backlinks~ :: Return list of links in 2144 current or optional =FILE=. Also see ~denote-link-return-links~. 2145 2146 + Function ~denote-rewrite-front-matter~ :: Rewrite front matter of 2147 note after ~denote-rename-file~ (or related) The =FILE=, =TITLE=, 2148 =KEYWORDS=, and =FILE-TYPE= arguments are given by the renaming 2149 command and are used to construct new front matter values if 2150 appropriate. 2151 2152 + Function ~denote-rewrite-keywords~ :: Rewrite =KEYWORDS= in =FILE= 2153 outright according to =FILE-TYPE=. Do the same as 2154 ~denote-rewrite-front-matter~ for keywords, but do not ask for 2155 confirmation. This is for use in ~denote-keywords-add~, 2156 ~denote-keywords-remove~, ~denote-dired-rename-marked-files~, or 2157 related. 2158 2159 I am publicising the ~denote-link-return-links~ and its counterpart in 2160 response to the mailing list thread started by relict007: 2161 <https://lists.sr.ht/~protesilaos/denote/%3C87a5ygk6yi.fsf@kotlak.com%3E>. 2162 relict007 is the developer of the ~denote-cache~ package (in 2163 progress): <https://git.sr.ht/~relict007/denote-cache>. 2164 2165 Similarly, the ~denote-rewrite-keywords~ is made public upon the 2166 request of Alan Schmitt: 2167 <https://lists.sr.ht/~protesilaos/denote/%3Cm2ttzgn2wu.fsf%40m4x.org%3E>. 2168 2169 ** Miscellaneous 2170 :PROPERTIES: 2171 :CUSTOM_ID: h:918087e6-8cd5-4d4f-a11a-b465dcbd9fe3 2172 :END: 2173 2174 - Revised ~denote-link-return-{links,backlinks}~ to not produce a 2175 ~user-error~. The errors are reserved for the interactive 2176 functions. The others are for developers. Thanks to Elias Storms for 2177 bringing this matter to my attention: 2178 <https://github.com/protesilaos/denote/commit/694c1517be73949edbc3993c105c764da8e2571f#commitcomment-112677876>. 2179 2180 - Refrained from trying to find forward links in non-text-files. If a 2181 file extension is not in ~denote-file-types~, we have no way of 2182 parsing or finding outgoing links in it. This change checks for the 2183 file extension early on in 'when-let*' block and avoids opening the 2184 file which is a relatively costly operation (and would fail finding 2185 links anyway). Thanks to relict007 for the patch. This was done on 2186 the mailing list: 2187 <https://lists.sr.ht/~protesilaos/denote/%3C87r0riffdx.fsf%40kotlak.com%3E> 2188 The change is small and thus does not require copyright assignment 2189 to the Free Software Foundation. 2190 2191 - Explained how to troubleshoot Denote. Refer to the section in the 2192 manual titled "Troubleshoot Denote in a pristine environment." 2193 While this is about Denote, the skills apply to all Emacs packages. 2194 2195 - Ensured backlinks get correct ~denote-directory~ path. The 2196 backlinks buffer will now get the correct path when it is generated 2197 inside a silo. This is related to issue 129 reported by hapst3r on 2198 the GitHub mirror: <https://github.com/protesilaos/denote/issues/129>. 2199 The change is necessary because =.dir-locals.el= do not work for 2200 buffers, so we must get the value from the file that calls 2201 ~denote-link-backlinks~. 2202 2203 - Added missing underscore from examples in exporting section. Thanks 2204 to Peter Prevos for bringing this matter to my attention: 2205 <https://lists.sr.ht/~protesilaos/denote/%3C87fs8b85tq.fsf%40prevos.net%3E#%3C87lehiuxfo.fsf@protesilaos.com%3E>. 2206 2207 - Made the command ~denote-open-or-create~ work with an empty 2208 ~denote-directory~. The ~denote-file-prompt~ would throw an error 2209 before. The correct behaviour is to proceed to the "Create" phase 2210 if the ~denote-directory~ is empty. Thanks to user drcxd for 2211 reporting the bug in issue 131 on the GitHub mirror and for testing 2212 my sample code: <https://github.com/protesilaos/denote/issues/131>. 2213 2214 - Documented how to use tree-based file prompt on demand. This is my 2215 solution to a request made by Mirko Hernandez on the possible use of 2216 the old Denote file prompt. It is better not to introduce a user 2217 option for this case, nor to keep multiple variants of the 2218 ~denote-file-prompt~ in denote.el, as we want to keep things simple. 2219 Mirko's feedback was provided in issue 121 on the GitHub mirror: 2220 <https://github.com/protesilaos/denote/issues/121>. 2221 2222 - Added the variable ~denote-user-enforced-denote-directory~. This is 2223 intended for users who write custom code to extend Denote. The 2224 value of this variable should be ~let~ bound around calls to the 2225 function ~denote-directory~, thus overriding its return value. This 2226 was discussed on the mailing list and then introduced by Vedang 2227 Manerikar in commit =977c757=, with further changes by me in 2228 =20ddc97=: <https://lists.sr.ht/~protesilaos/denote/patches/41776>. 2229 Vedang has assigned copyright to the Free Software Foundation. 2230 2231 - Fixed ~my-denote-org-extract-subtree~ section of the documentation. 2232 This is part of some sample code that is not part of =denote.el=, 2233 but we provide as a convenience/inspiration for interested parties. 2234 2235 The provided function did not work correctly. 2236 2237 1. Tags are extracted before deleting the region from the source file. 2238 2. The function ~org-end-of-subtree~ is called to calculate the 2239 point we should delete up to. The previously used function 2240 ~org-entry-end-position~ ends at the first sub-heading under the 2241 tree, which is not what we want. Instead, we want to cut the 2242 whole subtree. 2243 3. The date information available in the subtree is retained. We 2244 look for three common places for this information: the =CREATED= 2245 or =DATE= properties in the =PROPERTIES= drawer, and the =CLOSED= 2246 cookie at the element level itself. 2247 2248 Thanks to Vedang Manerikar for the contribution: 2249 <https://lists.sr.ht/~protesilaos/denote/%3CCABzEscbPx24LCUCc7JsMmQtVGwhou5fUH_5h+%3Dt%3Dqi4396NqNQ%40mail.gmail.com%3E> 2250 2251 - Removed the dependency on the built-in ~xdg~ library and updated the 2252 default value of the user option ~denote-directory~. The reason is 2253 that XDG is a Linux standard that does not work on other operating 2254 systems, according to private feedback I received. 2255 2256 - Fixed a regression for =M-p= (~previous-history-element~) in "do or 2257 create" commands. Read the doc string of the commands 2258 ~denote-open-or-create~ or ~denote-link-or-create~ for how this is 2259 supposed to work. In short: 2260 2261 - Invoke the "do or create" command. 2262 - Type something that does not match a file. 2263 - In the following title prompt, hit =M-p= to bring back the last input. 2264 2265 I realised there was a regression when I read issue 152 on the 2266 GitHub mirror, which was created by user "ustcpxy": 2267 <https://github.com/protesilaos/denote/issues/152>. The issue is 2268 about skipping the file title prompt. 2269 2270 - Simplified the internal ~denote--buffer-file-names~. Thanks to Adam 2271 Růžička for noting that my change was not compatible with older 2272 Emacs versions, and for preparing the change. This was discussed in 2273 pull request 158 on the GitHub mirror, with my suggestion to not use 2274 ~seq-filter~ as it affected the return value: 2275 <https://github.com/protesilaos/denote/pull/158>. The change is 2276 below the 15 line limit, meaning that Adam does have to assign 2277 copyright to the Free Software Foundation. 2278 2279 - Documented custom code in the manual on how to interactively select 2280 a silo. I am providing this in response to a request from GitHub 2281 user rbenit68. The discussion took place in issue 127 on the GitHub 2282 mirror, with the participation of Mirko Hernandez: 2283 <https://github.com/protesilaos/denote/issues/127>. The custom code 2284 I provide is the expanded version of an idea put forth by Mirko, to 2285 whom I am thankful. 2286 2287 - Fixed an outdated reference in the ~denote-file-types~ doc string. 2288 Thanks to user doolio for spotting the error and reporting it in 2289 issue 139 on the GitHub mirror: 2290 <https://github.com/protesilaos/denote/issues/139>. 2291 2292 - Cited in the manual's section "Publications about Denote" an article 2293 by Mohamed Suliman titled /Managing a bibliography of BiBTeX entries 2294 with Denote/ (2022-12-20): 2295 <https://www.scss.tcd.ie/~sulimanm/posts/denote-bibliography.html>. 2296 If you have published something related to Denote, please let me 2297 know and I will add to the list. 2298 2299 - Cited the essay by Summer Emacs titled /An explanation of how I use 2300 Emacs/ (2023-05-04): 2301 <https://github.com/summeremacs/howiuseemacs/blob/main/full-explanation-of-how-i-use-emacs.org> 2302 2303 - Cited the video series by Stefan Thesing titled /Denote as a 2304 Zettelkasten/: <https://www.thesing-online.de/blog/denote-as-a-zettelkasten/>. 2305 2306 - Added link to Karl Voit's work in the manual's section "Alternative 2307 implementations and further reading." Thanks to Norwid Behrnd for 2308 the contribution in pull request 123 on the GitHub mirror: 2309 <https://github.com/protesilaos/denote/pull/123>. 2310 2311 - Fixed the broken link to jao's blog. Thanks to Tomasz Hołubowicz 2312 for the contribution, which was done in pull request 145 on the 2313 GitHub mirror: <https://github.com/protesilaos/denote/pull/145>. 2314 2315 - Authored lots of other ancillary changes/features to the code base 2316 or the manual (yes, this change log is how I "cut the long story 2317 short"). 2318 2319 * Version 1.2.0 on 2022-12-12 2320 :PROPERTIES: 2321 :CUSTOM_ID: h:92478a05-4a69-413c-8d95-1dacbcf6af2c 2322 :END: 2323 2324 ** Denote now requires Emacs version 28.1 or higher 2325 :PROPERTIES: 2326 :CUSTOM_ID: h:bc0e173a-3b9f-427c-9fb0-d435a5ef127e 2327 :END: 2328 2329 With the help of Noboru Ota (nobiot), we realised that Denote was 2330 broken on Emacs 27 for quite a while. The fact that we received no 2331 feedback about it suggests that this change is the best course of 2332 action going forward. Discussion: 2333 <https://lists.sr.ht/~protesilaos/denote/%3C86r0yvzm12.fsf%40nobiot.com%3E#%3C86sfja78ik.fsf@nobiot.com%3E> 2334 2335 Emacs 27 lacks certain Xref facilities that we need for the 2336 backlinking facility. It was holding us back for no good reason, 2337 while also adding to the maintenance burden. 2338 2339 If you are using Denote on Emacs 27 and things are working for you, 2340 there is no need to update the package. Do it when you also upgrade 2341 Emacs to a newer version. 2342 2343 ** Display context in backlinks' buffer 2344 :PROPERTIES: 2345 :CUSTOM_ID: h:dafbdbae-36f1-487a-94c8-2762568a766e 2346 :END: 2347 2348 By default, the generic backlinks' buffer, which can be displayed with 2349 the command ~denote-link-backlinks~ (alias ~denote-link-show-backlinks-buffer~), 2350 only shows the file names of the linked notes. 2351 2352 We have made it possible to produce a more informative view by showing 2353 the context of the link and also listing all links per file. This is 2354 done by setting the user option ~denote-backlinks-show-context~ to a 2355 non-nil value. 2356 2357 To illustrate the difference, this is the default backlinks' buffer: 2358 2359 #+begin_example 2360 Backlinks to "On being honest" (20220614T130812) 2361 ------------------------------------------------ 2362 2363 20220614T145606--let-this-glance-become-a-stare__journal.txt 2364 20220616T182958--feeling-butterflies-in-your-stomach__journal.txt 2365 #+end_example 2366 2367 And this is the one with ~denote-backlinks-show-context~ enabled: 2368 2369 #+begin_example 2370 Backlinks to "On being honest" (20220614T130812) 2371 ------------------------------------------------ 2372 2373 20220614T145606--let-this-glance-become-a-stare__journal.txt 2374 37: growing into it: [[denote:20220614T130812][On being honest]]. 2375 64: As I said in [[denote:20220614T130812][On being honest]] I have never 2376 20220616T182958--feeling-butterflies-in-your-stomach__journal.txt 2377 62: indifference. In [[denote:20220614T130812][On being honest]] I alluded 2378 #+end_example 2379 2380 Granted, here we show plain text though in Emacs the results have the 2381 appropriate colours of the active theme and are easier to read. 2382 2383 Thanks to Noboru Ota (nobiot) for implementing this feature. We 2384 discussed it at length on the mailing list: 2385 <https://lists.sr.ht/~protesilaos/denote/%3C86r0yvzm12.fsf%40nobiot.com%3E>. 2386 2387 Noboru has assigned copyright to the Free Software Foundation. 2388 2389 ** Dynamic Org blocks for lists of Denote links 2390 :PROPERTIES: 2391 :CUSTOM_ID: h:f7904a57-22c0-446f-b7e3-7a736332002c 2392 :END: 2393 2394 Denote now includes the ~denote-org-dblock~ library. Activate it 2395 thus: 2396 2397 #+begin_src emacs-lisp 2398 ;; Register Denote's Org dynamic blocks 2399 (require 'denote-org-dblock) 2400 #+end_src 2401 2402 A dynamic block gets its contents by evaluating a given function, 2403 depending on the type of block. The type of block and its parameters 2404 are stated in the opening =#+BEGIN= line of the block. Typing =C-c 2405 C-c= with point on that line runs the function, with the given 2406 arguments, and populates the block's contents accordingly. 2407 2408 What Denote has is ways to write blocks that produce a list of links 2409 matching a given regular expression while conforming with some other 2410 parameters. The manual explains how to use this powerful feature 2411 (which is necessarily specific to the Org file type): 2412 <https://protesilaos.com/emacs/denote#h:8b542c50-dcc9-4bca-8037-a36599b22779>. 2413 2414 Thanks to Elias Storms for authoring ~denote-org-dblock~ and for 2415 discussing this issue at length with me on the mailing list: 2416 <https://lists.sr.ht/~protesilaos/denote/%3Cm2sfisexx7.fsf%40MBA21.fritz.box%3E>. 2417 2418 Elias has assigned copyright to the Free Software Foundation. 2419 2420 ** Integration with the built-in project.el and xref.el libraries 2421 :PROPERTIES: 2422 :CUSTOM_ID: h:e8a7d08c-cdf0-4207-92c1-391415b8371f 2423 :END: 2424 2425 Denote was already using Xref internally but has now gained more 2426 capabilities which help it find files more effectively. With the help 2427 of Emacs' standard project library, all file-related prompts (e.g. to 2428 add a link) search all items in the ~denote-directory~ regardless of 2429 whether the user is in a subdirectory or not. 2430 2431 All Denote commands benefit from this refactoring. One such request 2432 to "Make ~denote-open-or-create~ work better across subfolders" was 2433 made in issue 114 on the GitHub mirror: 2434 <https://github.com/protesilaos/denote/issues/114>. 2435 2436 Thanks to Noboru Ota (nobiot) for introducing this feature together 2437 with a new system of "modules" for incorporating additional built-in 2438 functionality: 2439 2440 - <https://lists.sr.ht/~protesilaos/denote/%3C86a64ooxyi.fsf%40nobiot.com%3E> 2441 - <https://lists.sr.ht/~protesilaos/denote/%3C86k03f4iq6.fsf%40nobiot.com%3E> 2442 2443 I will not document the new user option ~denote-modules~ right now as 2444 my ongoing job search prevented me from exploring the full potential 2445 of this feature. I promise to do it for the next version of Denote 2446 and update the manual accordingly. Nevertheless, the doc string of 2447 ~denote-modules~ already provides all one needs to get started. 2448 2449 ** Re-use last input in "do or create" commands 2450 :PROPERTIES: 2451 :CUSTOM_ID: h:5a003d44-7ad0-4c92-b908-ec7cf016b2dd 2452 :END: 2453 2454 The commands ~denote-open-or-create~, ~denote-link-or-create~ first 2455 prompt for an existing note. If they find it, they act on it, 2456 otherwise they prompt for the creation of a new note to operate on. 2457 2458 At the first prompt, it is common to use regular expressions and 2459 out-of-order pattern matching (such as with the ~orderless~ package), 2460 so the input can be something like =_test ^2022 some title=, which we 2461 obviously don't want to automatically reuse as the new note's actual 2462 title. 2463 2464 To this end, and to accommodate all workflows, we leverage Emacs' 2465 minibuffer history to make the last input accessible with =M-p= at the 2466 minibuffer prompt (=M-x previous-history-element=). The text is 2467 available for further editing before it is submitted as the new note's 2468 title. Simple, effective, and flexible! 2469 2470 Thanks to Guo Yong for starting the discussion that led me to this 2471 improvement: 2472 <https://lists.sr.ht/~protesilaos/denote/%3CNF6pFBq--3-9%40tutanota.com%3E>. 2473 2474 ** Add support for any file type 2475 :PROPERTIES: 2476 :CUSTOM_ID: h:e73a4e76-6c00-4691-8893-8f885c26f306 2477 :END: 2478 2479 Denote provides the user option ~denote-file-type~ which specifies the 2480 file type to use for new notes. Options include Org mode (the 2481 default), Markdown+YAML, Markdown+TOML, and plain text. Furthermore, 2482 there exists the convenience command ~denote-type~ (alias 2483 ~denote-create-note-using-type~) which prompts for a file type to use 2484 when creating a new note (I normally write in plain text, but 2485 sometimes switch to Org or Markdown). 2486 2487 The variable ~denote-file-types~ (which is NOT a user option) 2488 specifies all the parameters of what a "file type" means, such as how 2489 to format its front matter, what style of date+time to use, which file 2490 type extension to write, how to rename the file, what style of link to 2491 apply, and so on. Advanced users can now edit this variable to either 2492 register new file types or redefine the behaviour of existing ones. 2493 Read this comprehensive guide on how to do it: 2494 <https://protesilaos.com/codelog/2022-10-30-demo-denote-custom-file-type/>. 2495 2496 I repeat: this is for advanced users or, anyhow, for those who are 2497 prepared to maintain some custom code in their setup. The guide is 2498 accessible though and I am always willing to help anyone in need of 2499 assistance. 2500 2501 A relevant request for such a feature can be found in issue 86 on the 2502 GitHub mirror: <https://github.com/protesilaos/denote/issues/86>. 2503 2504 The ~denote-file-types~ were introduced by Jean-Philippe Gagné Guay in 2505 pull request 89 at the GitHub mirror and were part of Denote version 2506 0.6.0: <https://github.com/protesilaos/denote/pull/89>. I have made 2507 lots of changes since then to make all parts of Denote work with it 2508 and to parameterise its various facets. 2509 2510 ** Exclude certain directories from all operations 2511 :PROPERTIES: 2512 :CUSTOM_ID: h:04f42aab-d8fe-4c4a-b865-3bb0655e2631 2513 :END: 2514 2515 The user option ~denote-excluded-directories-regexp~ instructs all 2516 Denote functions that read or check file/directory names to omit 2517 directories that match the given regular expression. The regexp needs 2518 to match only the name of the directory, not its full path. 2519 2520 Affected operations include file prompts and functions that return the 2521 available files in the ~denote-directory~. File prompts are used by 2522 several commands, such as ~denote-link~ and ~denote-subdirectory~. 2523 Functions that check for files include ~denote-directory-files~ and 2524 ~denote-directory-subdirectories~. 2525 2526 Thanks to Graham Marlow for the contribution which was done in pull 2527 request 112 on the GitHub mirror: 2528 <https://github.com/protesilaos/denote/pull/112>. 2529 2530 The original contribution, with the subsequent tweaks I made to it, is 2531 within the eligible line count and thus does not require copyright 2532 assignment to the Free Software Foundation. 2533 2534 ** Exclude certain keywords from being inferred 2535 :PROPERTIES: 2536 :CUSTOM_ID: h:226ba85e-1f5e-45f5-956a-f5e8a95c397e 2537 :END: 2538 2539 The user option ~denote-excluded-keywords-regexp~ omits keywords that 2540 match a regular expression from the list of inferred keywords. 2541 2542 Keywords are inferred from file names and provided at relevant prompts 2543 as completion candidates when the user option ~denote-infer-keywords~ 2544 is non-nil. 2545 2546 Thanks to Stefan Thesing for proposing this idea in issue 115 on the 2547 GitHub mirror: <https://github.com/protesilaos/denote/issues/115>. 2548 2549 [ Other people participate in that thread and there may be something 2550 more coming out of it. ] 2551 2552 ** Use the ~citar-denote~ package for bibliography notes 2553 :PROPERTIES: 2554 :CUSTOM_ID: h:ff16633f-5fb8-4935-9e2f-044ec998d3f7 2555 :END: 2556 2557 Peter Prevos has produced the ~citar-denote~ package which makes it 2558 possible to write notes on BibTeX entries with the help of the ~citar~ 2559 package. These notes have the citation's unique key associated with 2560 them in the file's front matter. They also get a configurable keyword 2561 in their file name, making it easy to find them in Dired and/or 2562 retrieve them with the various Denote methods. 2563 2564 With ~citar-denote~, the user leverages standard minibuffer completion 2565 mechanisms (e.g. with the help of the ~vertico~ and ~embark~ packages) 2566 to manage bibliographic notes and access those notes with ease. The 2567 package's documentation covers the details: <https://github.com/pprevos/citar-denote/>. 2568 2569 Thanks to Peter Prevos for developing this package and for mentioning 2570 it on the Denote mailing list: 2571 <https://lists.sr.ht/~protesilaos/denote/%3C877cz0e96r.fsf%40prevos.net%3E>. 2572 2573 ** New functions and variables for developers 2574 :PROPERTIES: 2575 :CUSTOM_ID: h:5cc2076d-d4d2-45be-b28e-9ec67eca82b4 2576 :END: 2577 2578 Developers or users who maintain custom code now have access to: 2579 2580 + Function ~denote-keywords-sort~ 2581 + Function ~denote-keywords-prompt~ 2582 2583 Plus all the following which are related to the aforementioned ~denote-file-types~: 2584 2585 + Variable ~denote-org-link-format~ 2586 + Variable ~denote-md-link-format~ 2587 + Variable ~denote-id-only-link-format~ 2588 + Variable ~denote-org-link-in-context-regexp~ 2589 + Variable ~denote-md-link-in-context-regexp~ 2590 + Variable ~denote-id-only-link-in-context-regexp~ 2591 + Function ~denote-date-org-timestamp~ 2592 + Function ~denote-date-rfc3339~ 2593 + Function ~denote-date-iso-8601~ 2594 2595 Again, users can implement support for ANY FILE TYPE and use it to 2596 write notes in, either as their default choice or on-demand. If 2597 anything, this highlights the flexibility of Denote. 2598 2599 ** Miscellaneous 2600 :PROPERTIES: 2601 :CUSTOM_ID: h:acbb0cf7-ad17-495e-85d2-821cbbfc3158 2602 :END: 2603 2604 + Added the ~denote-keywords-sort~ function. The intent is to 2605 abstract the task of sorting the keywords. Before, it was handled 2606 by the ~denote-keywords-prompt~, which meant that keywords were not 2607 sorted when the ~denote~ function was called from Lisp. Thanks to 2608 Florian for bringing this matter to my attention, providing relevant 2609 feedback, and fixing an omission of mine in ~denote-rename-file~: 2610 <https://lists.sr.ht/~protesilaos/denote/%3C166689879712.8.6808878344988686135.71824507%40aboulafia.org%3E>. 2611 2612 + Expanded the manual's entry on directory "silos" to include more 2613 code examples. Thanks to Viktor Haag for asking a question on the 2614 mailing list that inspired me to produce this entry: 2615 <https://lists.sr.ht/~protesilaos/denote/%3CCANnkwC6NLd0VneUEqFrjh7TCUBLBgEtLCcPwM37JDvJXJCShVQ%40mail.gmail.com%3E>. 2616 2617 + Included a section in the manual with a non-exhaustive list of 2618 references to publications about Denote. As of this writing, it 2619 includes entries from David Wilson (SystemCrafters), Jack Baty, 2620 Jeremy Friesen, and Peter Prevos. If you have an article about 2621 Denote, please contact me about it directly or on the Denote mailing 2622 list and I will add it to the manual. 2623 2624 + Tweaked how Org's HTML export produces links in order to avoid 2625 broken subdirectory paths. Thanks to Thibaut Benjamin for the 2626 contribution, which was done in pull request 116 on the GitHub 2627 mirror: <https://github.com/protesilaos/denote/pull/116>. 2628 2629 The change concerns a single line and thus Thibaut requires no 2630 copyright assignment to the Free Software Foundation. 2631 2632 + Expanded the manual where necessary. 2633 2634 * Version 1.1.0 on 2022-10-20 2635 :PROPERTIES: 2636 :CUSTOM_ID: h:8e0f536a-ab3b-4cab-82f7-529bc0e40dbd 2637 :END: 2638 2639 ** New commands or refinements to common use-cases 2640 :PROPERTIES: 2641 :CUSTOM_ID: h:5665e7ec-4f3a-4de3-8cb0-63d25a0db8c1 2642 :END: 2643 2644 + The ~denote-link-add-missing-links~ is a companion to what we 2645 already provide to produce a list of links to Denote files matching 2646 a regular expression (the ~denote-link-add-links~). This new 2647 command adds links that are not already present in the current file. 2648 So if you have a metanote that references, say, your journal entries 2649 but have not updated it in a month, you can revisit the metanote, 2650 invoke ~denote-link-add-missing-links~, and then type the search 2651 terms (e.g. =_journal=) to include what remains. 2652 2653 Thanks to Elias Storms for the initial contribution, which was done 2654 in pull request 108 on the GitHub mirror: 2655 <https://github.com/protesilaos/denote/pull/108>. 2656 2657 Elias has assigned copyright to the Free Software Foundation. It is 2658 required for changes that exceed 15 lines in total. 2659 2660 + The ~denote-link-find-backlink~ provides a minibuffer interface that 2661 shows all backlinks to the current note. It complements the 2662 existing ~denote-link-backlinks~ command (which also has the alias 2663 ~denote-link-show-backlinks-buffer~). Each command has its own 2664 niche: the minibuffer lets the user leverage powerful pattern 2665 matching styles, such as those provided by the =orderless= package, 2666 while the bespoke buffer provides an easy overview of what links to 2667 the current note. 2668 2669 Thanks to Elias Storms for the original patch: 2670 <https://lists.sr.ht/~protesilaos/denote/%3Cm2fsg6o2t6.fsf%40MBA21.fritz.box%3E#%3Cm2pmfam7yi.fsf@MBA21.fritz.box%3E>. 2671 2672 + The ~denote-keywords-add~ and ~denote-keywords-remove~ are two 2673 commands that interactively operate on the current note's front 2674 matter to add or remove keywords. They use the familiar keywords' 2675 prompt which means, among others, that they can read more than one 2676 keyword at a time. To specify multiple keywords, separate each 2677 input with a comma (or whatever the value of ~crm-separator~ is, 2678 which should be a comma unless something out-of-the-ordinary is in 2679 force). 2680 2681 Thanks to Elias Storms for the original patch, which was done as 2682 part of a discussion on the mailing list and then iterated on: 2683 <https://lists.sr.ht/~protesilaos/denote/%3Cm24jwvpbt2.fsf%40MBA21.fritz.box%3E#%3Cm28rlik0tc.fsf@MBA21.fritz.box%3E>. 2684 2685 + The ~denote-link~ command will now recognise an active region and 2686 use its text as the description of the inserted link. The default 2687 behaviour is to use the file's title from its front matter or file 2688 name. Thanks to Charanjit Singh for the original contribution, 2689 which was done as part of pull request 109 on the GitHub mirror: 2690 <https://github.com/protesilaos/denote/pull/109>. A subsequent 2691 tweak was implemented in pull request 110, following a discussion 2692 with me: <https://github.com/protesilaos/denote/pull/110>. 2693 2694 Charanjit's contribution is below the ~15 line threshold and thus 2695 does not require copyright assignment to the Free Software 2696 Foundation. 2697 2698 + The renaming operations are now aware of the underlying version 2699 control system and will use the appropriate command when a VCS is 2700 available. In practice, renaming a file under, say, Git will 2701 register it as a "rename" instead of two separate actions of 2702 deletion and addition. 2703 2704 Thanks to Florian for the patch. It was discussed on the mailing 2705 list and then underwent some changes: 2706 <https://lists.sr.ht/~protesilaos/denote/%3C166547153518.8.941129310186454444.68125516@aboulafia.org%3E>. 2707 2708 + The ~denote-rename-file-using-front-matter~ no longer fails to carry 2709 out its intended task when the front matter has no keywords. If no 2710 keywords are available, this is interpreted as a request to remove 2711 the KEYWORDS component of the file name. This was always 2712 technically possible and could be achieved with various permutations 2713 of the user option ~denote-prompts~ (as explained in its doc string 2714 or the manual). Denote only needs an identifier in the file name to 2715 establish unique links (although I strongly encourage you to stick 2716 to the standard file-naming scheme as it is informative, reliable, 2717 and can work even if you access your data without Emacs). 2718 2719 ** For more advanced use-cases 2720 :PROPERTIES: 2721 :CUSTOM_ID: h:505c84dd-2959-4bd4-8af4-78d75592a6d5 2722 :END: 2723 2724 + The variable ~denote-file-types~ has been tweaked to respond 2725 directly to changes in its value done with ~setq~. Thanks to Noboru 2726 Ota for the patch: <https://lists.sr.ht/~protesilaos/denote/%3C86k05gsqsg.fsf%40nobiot.com%3E>. 2727 2728 Noboru has assigned copyright to the Free Software Foundation. 2729 2730 + The =:front-matter= property of the ~denote-file-types~ now accepts 2731 a nil value. Denote could always work without front matter, but 2732 this was not implemented flexibly in the ~denote-file-types~. 2733 Thanks to Noboru Ota (nobiot) for pointing this out on the mailing 2734 list: <https://lists.sr.ht/~protesilaos/denote/%3C86k05gsqsg.fsf%40nobiot.com%3E>. 2735 2736 + The ~denote-file-prompt~ function now reads an optional 2737 =INITIAL-TEXT= argument. This is a string that prepopulates the 2738 minibuffer. It is useful for custom commands the user may have 2739 where, for example, there is a need to automatically filter to 2740 entries matching =_journal=. Thanks to Alan Schmitt for suggesting 2741 the idea: <https://lists.sr.ht/~protesilaos/denote/%3C87pmf676n1.fsf@m4x.org%3E>. 2742 2743 + The ~denote-rename-file-using-front-matter~ accepts an optional 2744 =AUTO-CONFIRM= argument. It can either be passed interactively or 2745 via Lisp. The doc string (or the manual) explains the details. 2746 Thanks to Elias Storms for the initial patch: 2747 <https://lists.sr.ht/~protesilaos/denote/%3Cm2a667aeku.fsf%40gmail.com%3E>. 2748 2749 + The ~denote-prompt-for-date-return-id~ function uses the familiar 2750 ~denote-date-prompt~ and returns the appropriate identifier. It is 2751 used internally by some of our function, but we also provide it for 2752 anyone who wants to write their own custom code. 2753 2754 + The ~denote-retrieve-or-create-file-identifier~ function reads and 2755 option =DATE= argument to its mandatory =FILE= argument. If =FILE= 2756 does not have an identifier and optional =DATE= is non-nil, the 2757 function invokes the ~denote-prompt-for-date-return-id~, as 2758 mentioned above. 2759 2760 + The ~denote-rename-file~ command accepts an optional =DATE= 2761 argument. It functionally does what is described right above, with 2762 the exception that this is for an interactive function (a 2763 "command"). Read the detailed doc string or the manual for 2764 everything that pertains to this powerful command. 2765 2766 Thanks to Florian for suggesting the idea on the mailing list: 2767 <https://lists.sr.ht/~protesilaos/denote/%3C166521684647.7.5483179875879361874.67576870%40aboulafia.org%3E>. 2768 2769 + The ~denote-directory-text-only-files~ function filters the 2770 ~denote-directory-files~ to only return a list of text files. This 2771 leaves out, say, mp3 files. The function is used internally, though 2772 it may also prove useful in custom user code. 2773 2774 ** Miscellaneous refinements 2775 :PROPERTIES: 2776 :CUSTOM_ID: h:0531047f-ef15-412e-b265-886c55526d57 2777 :END: 2778 2779 + Implemented a ~revert-buffer-function~ for the backlinks' buffer, 2780 which is produced by the command ~denote-link-backlinks~. This 2781 revert function is what the =g= key invokes with the default key 2782 bindings (the command is ~revert-buffer~). It produces the buffer 2783 anew, updating the list of backlinks accordingly. 2784 2785 + Documented how to speed up the creation of the backlinks' buffer. 2786 As this depends on the built-in =xref= library, the change is done 2787 by specifying the value of the user option ~xref-search-program~ in 2788 Emacs 28 or higher. For example: 2789 2790 #+begin_src emacs-lisp 2791 (setq xref-search-program 'ripgrep) 2792 #+end_src 2793 2794 For something more elaborate: 2795 2796 #+begin_src emacs-lisp 2797 ;; Prefer ripgrep, then ugrep, and fall back to regular grep. 2798 (setq xref-search-program 2799 (cond 2800 ((or (executable-find "ripgrep") 2801 (executable-find "rg")) 2802 'ripgrep) 2803 ((executable-find "ugrep") 2804 'ugrep) 2805 (t 2806 'grep))) 2807 #+end_src 2808 2809 + Removed some minor duplication of effort in how the buttonisation of 2810 links is done (what makes them clickable). 2811 2812 + Made refinements to the definition of functions such as 2813 ~denote-link-add-links~. There should be no noticeable change for 2814 users, though this shows we care about code quality. 2815 2816 + With Eshel Yaron, we tried to remove the empty indices for functions 2817 and variables from the HTML version of the manual. These indices 2818 are useful in the Info version, which can be accessed directly from 2819 Emacs when the =denote= package is installed (for example, evaluate 2820 =(info "(denote) Top")=), but they do not work with HTML. Alas, 2821 what we tried to do did not work. Maybe Org has a way to control 2822 what is exported where. We shall see. At any rate, thanks to Eshel 2823 for the effort: <https://lists.sr.ht/~protesilaos/denote/patches/36028>. 2824 2825 + All code that integrates the =denote:= custom hyperlink type with 2826 Org's link facility is now assigned =autoload= cookies. These are 2827 done to ensure that =denote= is loaded and is available in cases 2828 where Org needs to access a =denote:= link at some early stage 2829 (e.g. at startup before using Denote). Thanks to Sven Seebeck for 2830 reporting the problem: <https://lists.sr.ht/~protesilaos/denote/%3C87r0zovwix.fsf%40svenseebeck.me%3E>. 2831 Although Sven could not reproduce a bug reliably, I believe this 2832 prevents such an eventuality. 2833 2834 + Expanded or otherwise updated the manual to account for all of the 2835 above, where appropriate. 2836 2837 * Version 1.0.0 on 2022-09-30 2838 :PROPERTIES: 2839 :CUSTOM_ID: h:053975d7-3fe2-49e5-96a0-336483e5861c 2840 :END: 2841 2842 This is the first major release of Denote. A part of the changes 2843 documented herein is for advanced users or developers who wish to 2844 extend Denote with their custom code. Though we first cover what 2845 applies to everyone. 2846 2847 ** Changes for all users 2848 :PROPERTIES: 2849 :CUSTOM_ID: h:25692d4f-08da-4938-a81e-54070d91f51a 2850 :END: 2851 2852 + The custom Org hyperlink type of =denote:= can be visited from 2853 outside the ~denote-directory~. We now provide the necessary glue 2854 code that Org needs to store these =denote:= links. Storing them 2855 can be done with an ~org-capture~ template or via the command 2856 ~org-store-link~. Use this to, for example, capture a TODO that 2857 references one of your notes. 2858 2859 =denote:= links work for as long as the referenced file is somewhere 2860 in the ~denote-directory~ or one of its subdirectories. 2861 2862 Thanks to Marc Fargas for the contribution. Marc did not need to 2863 assign copyright to the Free Software Foundation, as the patch was 2864 within the ~15 line limit that is permissible. 2865 2866 The contribution was discussed on the mailing list: 2867 <https://lists.sr.ht/~protesilaos/denote/patches/35137>. A prior 2868 exchange took place in issue 104 over at the GitHub mirror: 2869 <https://github.com/protesilaos/denote/issues/104>. 2870 2871 Some further tweaks were made to the relevant function. Thanks to 2872 Elias Storms for reporting on the mailing list a bug which revealed 2873 a regression I introduced to the Org link storing mechanism: 2874 <https://lists.sr.ht/~protesilaos/denote/%3C15D55F4B-64D1-4083-AD5E-B5BACA8F1909%40ap.be%3E>. 2875 2876 + Following from above, the command ~denote-link-find-file~ finds 2877 files reliably, regardless of where the link is stored. All it 2878 needs is for the target file to be inside the ~denote-directory~. 2879 2880 I discovered this while exchanging views with Marc Fargas regarding 2881 the aforementioned patch: <https://lists.sr.ht/~protesilaos/denote/patches/35137>. 2882 2883 + The command ~denote-link-buttonize-buffer~, which "buttonizes" 2884 =denote:= links in plain text and Markdown files, now performs its 2885 task regardless of where the current file is stored. Those links 2886 work for as long as the file they reference is somewhere inside the 2887 ~denote-directory~. 2888 2889 + The commands ~denote-link-after-creating~, ~denote-link-or-create~ 2890 provide a convenience for users who need to create link to notes 2891 that may not exist yet. The idea is that one is expounding on a 2892 given topic and wants to create a link to a relevant issue. They 2893 are not sure if they have written anything about it yet, so they 2894 invoke the relevant command. Consult their doc strings or read the 2895 manual: <https://protesilaos.com/emacs/denote#h:9e41e7df-2aac-4835-94c5-659b6111e6de>. 2896 2897 Thanks to user sienic for suggesting the idea and for testing the 2898 prototypes. And thanks to Juanjo Presa for participating in the 2899 discussion to share the view that this functionality should be part of 2900 denote.el. This happened in issue 96 over at the GitHub mirror: 2901 <https://github.com/protesilaos/denote/issues/96>. 2902 2903 + The command ~denote-open-or-create~ offers the convenience of 2904 visiting a file, if it exists, else prompting for its creation. 2905 Thanks to Alan Schmitt for the contribution. The patch was sent on 2906 the mailing list: <https://lists.sr.ht/~protesilaos/denote/%3C87fsgvddny.fsf%40protesilaos.com%3E>. 2907 It is within the limit of what is allowed without assigning 2908 copyright to the Free Software Foundation, though Alan has done the 2909 relevant paperwork. 2910 2911 + The manual expands on two sections: (1) Variants of 2912 ~denote-open-or-create~, (2) Variants of ~denote-link-or-create~. 2913 They show how one can use the above "do or create" commands with 2914 different permutations of the Denote prompts for new note creation. 2915 2916 + The manual includes a section titled "Create a note with the 2917 region's contents". Quote: 2918 2919 #+begin_quote 2920 Sometimes it makes sense to gather notes in a single file and later 2921 review it to make multiple notes out of it. With the following 2922 code, the user marks a region and then invokes the command 2923 ~my-denote-create-new-note-from-region~: it prompts for a title and 2924 keywords and then uses the region's contents to fill in the newly 2925 created note. 2926 #+end_quote 2927 2928 This is not part of denote.el, though we provide it in the manual 2929 for users that may need it. Thanks to sundar bp for suggesting the 2930 idea. This was done via a private channel and the information is 2931 shared with permission. 2932 2933 + The manual has another entry titled "Split an Org subtree into its 2934 own note", which is similar to the above idea of using the region's 2935 contents but has some extra niceties provided by Org. Quote: 2936 2937 #+begin_quote 2938 With Org files in particular, it is common to have nested headings which 2939 could be split off into their own standalone notes. In Org parlance an 2940 entry with all its subheadings is a "subtree". With the following code, 2941 the user places the point inside the heading they want to split off and 2942 invokes the command ~my-denote-split-org-subtree~. It will create a 2943 note using the heading's text and tags for the new file. The contents 2944 of the subtree become the contents of the new note and are removed from 2945 the old one. 2946 #+end_quote 2947 2948 Thanks to Sven Seebeck for suggesting the idea and for testing my 2949 prototypes. This information is shared with permission, as it was 2950 provided via a private channel. 2951 2952 + The manual describes how a user can leverage the built-in 2953 ~dired-virtual-mode~ to perform arbitrary sorting of their list of 2954 notes. It also includes code for Eshell to quickly "export" a 2955 command's output into a dedicated buffer (which can then be used to 2956 derive a "virtual" Dired). Thanks to Yi Liu for asking the question 2957 that inspired this entry: 2958 <https://lists.sr.ht/~protesilaos/denote/%3C1C75FF01-EC76-49DF-9AEB-ED718A2795FF@gmail.com%3E>. 2959 2960 + The ~denote-faces-broken-link~ has been removed. It was used for 2961 Org links. The idea was to apply a different style if the link was 2962 broken. However, the way fontification works means that there may 2963 be a performance penalty as Org tries to check again and again if 2964 the link is broken or note. As =denote:= links are robust (unless 2965 the user tries to break them), this penalty is unacceptable. Thanks 2966 to Peter Prevos for reporting the issue and discussing it with me on 2967 the mailing list: 2968 <https://lists.sr.ht/~protesilaos/denote/%3C87k05umyyo.fsf%40prevos.net%3E>. 2969 2970 + The "denote" group in Custom UI buffers now provides a link to the 2971 Info manual that is shipped with the package. To read the manual, 2972 evaluate =(info "(denote) Top")=. Else visit the official web page: 2973 <https://protesilaos.com/emacs/denote>. 2974 2975 + Fixed a case where an internal check for a note would throw an error 2976 if the buffer was not visiting a file. Thanks to Hilde Rhyne was 2977 the patch: it is below the ~15 line threshold and thus does not 2978 require copyright assignment to the Free Software Foundation. The 2979 issue was discussed on the mailing list and was pushed to users as 2980 version =0.6.1=: 2981 <https://lists.sr.ht/~protesilaos/denote/%3Cm035d7nq22.fsf%40disroot.org%3E>. 2982 2983 + When linking to a file that has no front matter, Denote tries to use 2984 the TITLE component of the file name (per our file-naming scheme) as 2985 the link's descriptive text. We now make this look a bit better, by 2986 capitalising only the first letter while dehyphenating the text, 2987 converting =this-is-a-test= to =This is a test=. Before, we would 2988 capitalise all words. Thanks to Clemens Radermacher for the patch. 2989 It was sent via a private channel. Clemens has assigned copyright 2990 to the Free Software Foundation. 2991 2992 ** Changes for developers or advanced users 2993 :PROPERTIES: 2994 :CUSTOM_ID: h:165cd056-5e27-4536-b8ac-57f88c927a43 2995 :END: 2996 2997 Lots of functions and variables which once were for "private" use (the 2998 presence of double hyphens in the symbol) are now made public. 2999 Concretely this means that they no longer have double hyphens in their 3000 name and we pledge to support them henceforth. "Support" means that 3001 we (i) consider them stable, (ii) document them properly, (iii) will 3002 record any changes made to them such as in a change log, a blog post 3003 on my website, and via ~make-obsolete~. 3004 3005 The manual provides a complete reference of what is on offer. The 3006 section is titled "For developers or advanced users": 3007 <https://protesilaos.com/emacs/denote#h:c916d8c5-540a-409f-b780-6ccbd90e088e>. 3008 3009 Normally, we do not support private forms and can delete/modify them 3010 without notice. However, I decided to write obsoletion aliases for 3011 all forms I made public or otherwise revised, in an effort not to 3012 break any existing custom code. The following table covers all 3013 obsolete symbols and their new counterparts. PLEASE UPDATE YOUR CODE 3014 as those aliases will be removed in the near future. 3015 3016 | Index | Old symbol | New symbol | 3017 |-------+------------------------------------------------+---------------------------------------------------| 3018 | 1 | denote--id-format | denote-id-format | 3019 | 2 | denote--id-regexp | denote-id-regexp | 3020 | 3 | denote--title-regexp | denote-title-regexp | 3021 | 4 | denote--keywords-regexp | denote-keywords-regexp | 3022 | 5 | denote--punctuation-regexp | denote-excluded-punctuation-regexp | 3023 | 6 | denote-punctuation-excluded-extra-regexp | denote-excluded-punctuation-extra-regexp | 3024 | 7 | denote--sluggify | denote-sluggify | 3025 | 8 | denote--sluggify-and-join | denote-sluggify-and-join | 3026 | 9 | denote--sluggify-keywords | denote-sluggify-keywords | 3027 | 10 | denote--desluggify | denote-desluggify | 3028 | 11 | denote--only-note-p | denote-file-is-note-p | 3029 | 12 | denote--file-has-identifier-p | denote-file-has-identifier-p | 3030 | 13 | denote--file-supported-extension-p | denote-file-has-supported-extension-p | 3031 | 14 | denote--writable-and-supported-p | denote-file-is-writable-and-supported-p | 3032 | 15 | denote--file-name-relative-to-denote-directory | denote-get-file-name-relative-to-denote-directory | 3033 | 16 | denote-link--id-from-string | denote-extract-id-from-string | 3034 | 17 | denote--directory-files | denote-directory-files | 3035 | 18 | denote--subdirs | denote-directory-subdirectories | 3036 | 19 | denote--get-note-path-by-id | denote-get-path-by-id | 3037 | 20 | denote--directory-files-matching-regexp | denote-directory-files-matching-regexp | 3038 | 21 | denote--retrieve-read-file-prompt | denote-file-prompt | 3039 | 22 | denote--extract-keywords-from-path | denote-extract-keywords-from-path | 3040 | 23 | denote--keywords-prompt | denote-keywords-prompt | 3041 | 24 | denote--retrieve-filename-identifier | denote-retrieve-filename-identifier | 3042 | 25 | denote--file-name-id | denote-retrieve-or-create-file-identifier | 3043 | 26 | denote--retrieve-filename-title | denote-retrieve-filename-title | 3044 | 27 | denote--retrieve-title-value | denote-retrieve-title-value | 3045 | 28 | denote--retrieve-title-line | denote-retrieve-title-line | 3046 | 29 | denote--retrieve-keywords-value | denote-retrieve-keywords-value | 3047 | 30 | denote--retrieve-keywords-line | denote-retrieve-keywords-line | 3048 | 31 | denote--format-file | denote-format-file-name | 3049 | 32 | denote--barf-duplicate-id | denote-barf-duplicate-id | 3050 | 33 | denote--title-prompt | denote-title-prompt | 3051 | 34 | denote--file-type-prompt | denote-file-type-prompt | 3052 | 35 | denote--date-prompt | denote-date-prompt | 3053 | 36 | denote--subdirs-prompt | denote-subdirectory-prompt | 3054 | 37 | denote--template-prompt | denote-template-prompt | 3055 | 38 | denote--filetype-heuristics | denote-filetype-heuristics | 3056 | 39 | denote--rename-file | denote-rename-file-and-buffer | 3057 | 40 | denote--rename-file-prompt | denote-rename-file-prompt | 3058 3059 If you are writing code that extends Denote and feel that something is 3060 either missing or has remained private, please contact us on the 3061 mailing list, the GitHub/GitLab mirror, or send me an email directly. 3062 I always respond in a timely fashion. 3063 3064 ** Open to everyone 3065 :PROPERTIES: 3066 :CUSTOM_ID: h:27a391cf-8d5e-4d19-942f-46fc52dea80c 3067 :END: 3068 3069 The most common feedback I get about Denote is that its documentation 3070 is good. As you can tell from these change logs, the plan is to 3071 continue on this path. 3072 3073 Please note that the communication channels for Denote (mailing list, 3074 mirrors, my personal email) are open to users of all levels. Do not 3075 hesitate to contact us/me. 3076 3077 Thanks again to everyone for their contributions, direct or indirect, 3078 either in the form of code or the discussion of ideas. Quoting from 3079 the "Acknowledgements" section of the manual (all my packages have 3080 such a section): 3081 3082 #+begin_quote 3083 Denote is meant to be a collective effort. Every bit of help matters. 3084 3085 + Author/maintainer :: Protesilaos Stavrou. 3086 3087 + Contributions to code or the manual :: Abin Simon, Alan Schmitt, 3088 Benjamin Kästner, Clemens Radermacher, Colin McLear, Damien Cassou, 3089 Eshel Yaron, Hilde Rhyne, Jack Baty, Jean-Philippe Gagné Guay, Jürgen 3090 Hötzel, Kaushal Modi, Kyle Meyer, Marc Fargas, Peter Prevos, Philip 3091 Kaludercic, Quiliro Ordóñez, Stefan Monnier. 3092 3093 + Ideas and/or user feedback :: Abin Simon, Alan Schmitt, Alfredo 3094 Borrás, Benjamin Kästner, Colin McLear, Damien Cassou, Elias Storms, 3095 Frank Ehmsen, Hanspeter Gisler, Jack Baty, Juanjo Presa, Kaushal 3096 Modi, M. Hadi Timachi, Paul van Gelder, Peter Prevos, Shreyas 3097 Ragavan, Summer Emacs, Sven Seebeck, Taoufik, Yi Liu, Ypot, atanasj, 3098 hpgisler, pRot0ta1p, sienic, sundar bp. 3099 3100 Special thanks to Peter Povinec who helped refine the file-naming 3101 scheme, which is the cornerstone of this project. 3102 3103 Special thanks to Jean-Philippe Gagné Guay for the numerous 3104 contributions to the code base. 3105 #+end_quote 3106 3107 * Version 0.6.0 on 2022-08-31 3108 :PROPERTIES: 3109 :CUSTOM_ID: h:50aba79a-d702-42b4-a2a5-7fa29033f904 3110 :END: 3111 3112 Denote is in a stable state. I consider it feature-complete, without 3113 prejudice to possible refinements to its existing feature set. The next 3114 version shall be =1.0.0=. 3115 3116 ** User-facing changes 3117 :PROPERTIES: 3118 :CUSTOM_ID: h:566a770b-399e-47a6-9aa4-326fd6ade9a7 3119 :END: 3120 3121 + The Denote linking facility can now link to any file that has the 3122 Denote file-naming scheme. Before, we limited this feature to what we 3123 consider "note" files, else the supported plain text formats (per 3124 ~denote-file-type~). Thanks to Peter Prevos for the discussion on the 3125 mailing list: <https://lists.sr.ht/~protesilaos/denote/%3C87fsi1m5ze.fsf%40prevos.net%3E>. 3126 3127 + Date prompts may optionally use the familiar Org date-selection 3128 mechanism that leverages the calendar. This feature is subject to the 3129 user option ~denote-date-prompt-use-org-read-date~. A date prompt is 3130 used by the ~denote-date~ command or, optionally, by the ~denote~ 3131 command when the user option ~denote-prompts~ is configured 3132 accordingly. The manual elaborates on the specificities. Thanks to 3133 Jean-Philippe Gagné Guay for the contribution in pull request 97 at 3134 the GitHub mirror: <https://github.com/protesilaos/denote/pull/97>. 3135 3136 + Leading empty spaces at the ~denote~ =TITLE= prompt no longer produce 3137 hyphens: they are simply ignored to keep file names consistent. 3138 Thanks to Peter Prevos for the contribution in pull request 99 at the 3139 GitHub mirror: <https://github.com/protesilaos/denote/pull/99>. 3140 3141 [ Peter has started the process for copyright assignment to the Free 3142 Software Foundation, though the total contributions are still within 3143 the permitted boundaries. ] 3144 3145 + When linking to files that have no front matter, the link's anchor 3146 text (the human-readable part) is derived from the file name =TITLE= 3147 component. We apply a de-hyphenation and capitalisation of its 3148 constituent words. This is not always perfect, but it is better than 3149 something like =this-is-the-title=. Thanks to Peter Prevos for the 3150 original idea in pull request 93 at the GitHub mirror: 3151 <https://github.com/protesilaos/denote/pull/93>. 3152 3153 + The active region is now used as the default value of the ~denote~ 3154 command =TITLE= prompt. The idea behind this Do-What-I-Mean-flavoured 3155 patch is to be able to take a note about a subject that appears in a 3156 buffer by simply marking it before invoking the ~denote~ command. 3157 3158 Thanks to Eshel Yaron for the patch: <https://lists.sr.ht/~protesilaos/denote/patches/34870>. 3159 It is below the ~15 line threshold that thus requires no copyright 3160 assignment to the Free Software Foundation. 3161 3162 + The ~denote-rename-file-using-front-matter~ command now offers to save 3163 the buffer if appropriate. In the past, it would simply produce an 3164 error asking the user to save the buffer. Thanks to Peter Prevos for 3165 the contribution in pull request 103 at he GitHub mirror: 3166 <https://github.com/protesilaos/denote/pull/103>. 3167 3168 + Fixed the text of the confirmation prompt in the command 3169 ~denote-migrate-old-markdown-yaml-tags~. Thanks to Abin Simon for the 3170 patch: <https://lists.sr.ht/~protesilaos/denote/patches/34632>. 3171 3172 This patchset also fixes (i) how a tag is identified for the purposes 3173 of migrating old to new front matter, (ii) the regular expression for 3174 Org front matter keywords 3175 3176 [ The total changes are below the ~15 line threshold and thus do not 3177 require copyright assignment to the Free Software Foundation. ] 3178 3179 + Fixed a bug that prevented the creation of new notes. Thanks to 3180 Juergen Hoetzel for the contribution in pull request 84 at the GitHub 3181 mirror: <https://github.com/protesilaos/denote/pull/84>. This was 3182 done immediately after the release of version =0.5.0= on 2022-08-10 3183 and was provided to users as version =0.5.1= 3184 3185 [ The change is below the ~15 line threshold. ] 3186 3187 ** Internal refinements 3188 :PROPERTIES: 3189 :CUSTOM_ID: h:9374b533-faaa-4ab4-b668-f74b5eae7ab5 3190 :END: 3191 3192 These make the code simpler and more predictable. As the individual 3193 changes are not user-facing, I invite interested parties to consult the 3194 Git log. Special thanks to Jean-Philippe Gagné Guay for the multiple 3195 contributions (and relevant discussions) over at the GitHub mirror: 3196 3197 - <https://github.com/protesilaos/denote/pull/88> 3198 - <https://github.com/protesilaos/denote/pull/89> 3199 - <https://github.com/protesilaos/denote/pull/91> 3200 - <https://github.com/protesilaos/denote/pull/94> 3201 - <https://github.com/protesilaos/denote/pull/101> 3202 - <https://github.com/protesilaos/denote/pull/102> 3203 3204 [ Jean-Philippe has assigned copyright to the Free Software Foundation. 3205 It is required for non-trivial changes. ] 3206 3207 ** For advanced users 3208 :PROPERTIES: 3209 :CUSTOM_ID: h:c6fc05a2-ff31-4a0c-91a1-f64d2cfd6a16 3210 :END: 3211 3212 The variable ~denote-file-types~ is an alist of plists which 3213 substantiates the supported file types (per the user option 3214 ~denote-file-type~). Properties pertain to the formatting of front 3215 matter and the retrieval of relevant values. The doc string of 3216 ~denote-file-types~ explains the details, while the default value uses 3217 the ancillary functions we define. Thanks to Jean-Philippe Gagné Guay 3218 for the relevant contributions in pull request 89 at the GitHub mirror: 3219 <https://github.com/protesilaos/denote/pull/89>. 3220 3221 3222 * Version 0.5.0 on 2022-08-10 3223 :PROPERTIES: 3224 :CUSTOM_ID: h:80b9daaa-c3c8-4457-b109-966bb6a99832 3225 :END: 3226 3227 The general theme of this release is to refine what we already offer. 3228 As I explained in some discussions, Denote is feature-complete. We can 3229 always improve the code or add some ancillary function/command/variable, 3230 though all the main ideas have already been implemented. Additional 3231 functionality can be provided by other packages: I remain at the 3232 disposal of anyone willing to write such a package. 3233 3234 The present release covers more than 150 commits since version 0.4.0 on 3235 2022-07-25. 3236 3237 All release notes: <https://protesilaos.com/emacs/denote-changelog>. 3238 3239 ** Templates for new notes 3240 :PROPERTIES: 3241 :CUSTOM_ID: h:0878125f-8392-48e6-aeff-1469eb1e18fc 3242 :END: 3243 3244 We now provide the ~denote-templates~ user option. A "template" is 3245 arbitrary text that Denote will add to a newly created note right below 3246 the front matter. 3247 3248 Templates are expressed as a =(KEY . STRING)= association. 3249 3250 - The =KEY= is the name which identifies the template. It is an 3251 arbitrary symbol, such as =report=, =memo=, =statement=. 3252 3253 - The =STRING= is ordinary text that Denote will insert as-is. It can 3254 contain newline characters to add spacing. The manual of Denote 3255 contains examples on how to use the ~concat~ function, beside writing 3256 a generic string: 3257 <https://protesilaos.com/emacs/denote#h:f635a490-d29e-4608-9372-7bd13b34d56c>. 3258 3259 The user can choose a template either by invoking the new command 3260 ~denote-template~ or by changing the user option ~denote-prompts~ to 3261 always prompt for a template when calling the ~denote~ command. 3262 3263 Thanks to Jean-Philippe Gagné Guay for refinements to this facility. 3264 Done in pull request 77 on the GitHub mirror: 3265 <https://github.com/protesilaos/denote/pull/77>. 3266 3267 [ Jean-Philippe has assigned copyright to the Free Software Foundation. ] 3268 3269 ** Revised format for Org =#+filetags= entry 3270 :PROPERTIES: 3271 :CUSTOM_ID: h:17688b79-cb1b-4a59-831e-fbf2a81245d3 3272 :END: 3273 3274 Denote used to format tags in Org files by separating them with two 3275 spaces: 3276 3277 #+begin_example 3278 #+filetags: tag1 tag2 3279 #+end_example 3280 3281 While this worked for some obvious use-cases, it is not supported by 3282 Org. The Org documentation stipulates that tags be separated by the 3283 colon sign. The above would then be written thus: 3284 3285 #+begin_example 3286 #+filetags: :tag1:tag2: 3287 #+end_example 3288 3289 Denote now conforms with Org's specifications. To help users update 3290 their existing notes, we provide the ~denote-migrate-old-org-filetags~ 3291 command. It will perform the conversion in all Org files that had the 3292 old notation. As with all Denote operations that rewrite file contents, 3293 it DOES NOT SAVE BUFFERS. The user is expected to review the changes, 3294 such as by using ~diff-buffer-with-file~. Multiple buffers can be saved 3295 with ~save-some-buffers~ (check its doc string). 3296 3297 This command is provided for the convenience of the user. It shall be 3298 deprecated and eventually removed from future versions of Denote. 3299 3300 If you need help with any of this, please do not hesitate to contact me 3301 either in private or in one of Denote's official channels (mailing list, 3302 GitHub/GitLab mirror). 3303 3304 Thanks to Alan Schmitt for bringing this matter to my attention: 3305 <https://lists.sr.ht/~protesilaos/denote/%3C871qu0jw5l.fsf%40protesilaos.com%3E>. 3306 Also thanks to Jean-Philippe Gagné Guay for commenting on it as it 3307 helped me decide to include the command in =denote.el=: 3308 <https://github.com/protesilaos/denote/pull/83#issuecomment-1210167133>. 3309 3310 ** Revised format for Markdown+YAML =tags:= entry 3311 :PROPERTIES: 3312 :CUSTOM_ID: h:205a09cf-0159-425e-a6b3-41700fa3ad31 3313 :END: 3314 3315 This is the same idea as above. Before, we were making the mistake of 3316 using incorrect YAML notation: 3317 3318 #+begin_src yaml 3319 tags: tag1 tag2 3320 #+end_src 3321 3322 Now we do: 3323 3324 #+begin_src yaml 3325 tags: ["tag1", "tag2"] 3326 #+end_src 3327 3328 This is how the TOML variant always worked. 3329 3330 For the user's convenience, we provide a command to migrate from the old 3331 to the new syntax: ~denote-migrate-old-markdown-yaml-tags~. 3332 3333 ** Changes to file renaming and front matter rewriting 3334 :PROPERTIES: 3335 :CUSTOM_ID: h:15ecb4e8-d1ce-4e42-b74d-a3a046d93220 3336 :END: 3337 3338 Denote adds "front matter" to newly created notes which includes data 3339 such as the title and keywords/tags of the document. Strictly speaking, 3340 the front matter is not required by Denote. It is provided for the 3341 user's convenience, such as for readability or if they want to use the 3342 note with other programs (e.g. Org export, a blog with Hugo/Jekyll, 3343 ...). 3344 3345 Denote provides commands which help the user rename their notes, by 3346 changing the file name's =TITLE= and/or =KEYWORDS= components (per 3347 Denote's file-naming scheme). These commands also operate on the front 3348 matter to keep the data between file name and file contents in sync 3349 (again, for the user's convenience). 3350 3351 For this release we have consolidated and refined our offerings in order 3352 to improve their ergonomics. All changes are the result of fruitful 3353 discussions on the mailing list and the issue tracker of the GitHub 3354 mirror: 3355 3356 - <https://lists.sr.ht/~protesilaos/denote/%3C87k081l6vw.fsf%40silverstone.mail-host-address-is-not-set%3E> 3357 - <https://lists.sr.ht/~protesilaos/denote/%3C878rogw5kk.fsf%40protesilaos.com%3E> 3358 - <https://lists.sr.ht/~protesilaos/denote/%3C87fsiljv1s.fsf%40hu.mail-host-address-is-not-set%3E> 3359 - <https://lists.sr.ht/~protesilaos/denote/%3C87r122afe3.fsf%40hu.mail-host-address-is-not-set%3E> 3360 - <https://github.com/protesilaos/denote/issues/74> 3361 3362 Thanks to (A-Z) Hanspeter Gisler, Jean-Philippe Gagné Guay, and Peter 3363 Prevos for their participation. 3364 3365 Also thanks to Jean-Philippe Gagné Guay for relevant code contributions 3366 (please consult the Git log for the minutiae): 3367 3368 - <https://github.com/protesilaos/denote/pull/66> 3369 - <https://github.com/protesilaos/denote/pull/67> 3370 - <https://github.com/protesilaos/denote/pull/69> 3371 - <https://github.com/protesilaos/denote/pull/75> 3372 - <https://github.com/protesilaos/denote/pull/76> 3373 3374 *** Renaming a single file 3375 :PROPERTIES: 3376 :CUSTOM_ID: h:1d695e54-1481-42dd-916b-c0542c48aa6f 3377 :END: 3378 3379 The commands ~denote-dired-rename-file-and-add-front-matter~ and 3380 ~denote-dired-rename-file~ are deprecated and superseded by the new 3381 ~denote-rename-file~. Please update any key bindings in your setup. 3382 3383 The difference between the old commands and the new ~denote-rename-file~ 3384 is that the latter will now insert front matter to supported file types 3385 (per ~denote-file-type~) if they have none. This basically means that, 3386 e.g., renaming a generic Org/Markdown/Plain text file with 3387 ~denote-rename-file~ will update its file name to comply with Denote's 3388 file-naming scheme and also add the appropriate front matter (it 3389 "converts" it to a Denote note). If front matter exists, this command 3390 will rewrite it to reflect the changes to the file name's =TITLE= and/or 3391 =KEYWORDS=. 3392 3393 Consult the manual for the details: 3394 <https://protesilaos.com/emacs/denote#h:7cc9e000-806a-48da-945c-711bbc7426b0>. 3395 3396 Or, if the new version of the GNU ELPA package is installed, evaluate: 3397 3398 #+begin_src emacs-lisp 3399 (info "(denote) Rename a single file") 3400 #+end_src 3401 3402 The user option ~denote-dired-rename-expert~ is obsolete. Denote always 3403 asks for confirmation when renaming a single file. This is because the 3404 user can rely on batch-renaming commands which ask for confirmation only 3405 once per batch. 3406 3407 *** Renaming multiple files at once 3408 :PROPERTIES: 3409 :CUSTOM_ID: h:82455fb4-576b-4753-af66-ac48fd158327 3410 :END: 3411 3412 The command ~denote-dired-rename-marked-files-and-add-front-matter~ is 3413 deprecated and its functionality is absorbed by the existing 3414 ~denote-dired-rename-marked-files~ command. The deprecated command was 3415 used to insert front matter to supported file types (per 3416 ~denote-file-type~) that had none. We now handle this internally, thus 3417 streamlining the experience for the user. 3418 3419 Refer to the manual for the details: 3420 <https://protesilaos.com/emacs/denote#h:1b6b2c78-42f0-45b8-9ef0-6de21a8b2cde> 3421 3422 Assuming the latest Info manual is installed, evaluate: 3423 3424 #+begin_src emacs-lisp 3425 (info "(denote) Rename multiple files at once") 3426 #+end_src 3427 3428 *** Renaming a single file based on its front matter 3429 :PROPERTIES: 3430 :CUSTOM_ID: h:d913e369-9325-46c4-985b-cf5b3e35372b 3431 :END: 3432 3433 Introduced the ~denote-rename-file-using-front-matter~ command. This is 3434 new functionality we provide which uses the front matter as input to 3435 perform a rename of the file. The aforementioned offerings prompt for 3436 input via the minibuffer and propagate the changes firstly to the file 3437 name and subsequently to the front matter. Whereas with the command 3438 ~denote-rename-file-using-front-matter~, the user can edit the front 3439 matter manually and then invoke the command to pass the changes to the 3440 file name, subject to a confirmation. Relevant entries are the title 3441 and tags/filetags (depending on the file type). The date and the 3442 identifier are not pertinent. Identifiers in file names are NEVER 3443 rewritten by Denote. 3444 3445 Consult the manual: 3446 <https://protesilaos.com/emacs/denote#h:3ab08ff4-81fa-4d24-99cb-79f97c13a373>. 3447 3448 With the latest package, evaluate: 3449 3450 #+begin_src emacs-lisp 3451 (info "(denote) Rename a single file based on its front matter") 3452 #+end_src 3453 3454 *** Renaming multiple files based on their front matter 3455 :PROPERTIES: 3456 :CUSTOM_ID: h:4efc6c14-fd71-4bd8-8bb1-e8e720b98eff 3457 :END: 3458 3459 The command ~denote-dired-rename-marked-files-using-front-matter~ 3460 completes the set of features we provide for syncing between file name 3461 and front matter. It applies to all marked files in a Dired buffer. 3462 3463 Read the manual to understand how the command works and what it does 3464 exactly: <https://protesilaos.com/emacs/denote#h:ea5673cd-e6ca-4c42-a066-07dc6c9d57f8>. 3465 3466 Or evaluate: 3467 3468 #+begin_src emacs-lisp 3469 (info "(denote) Rename multiple files based on their front matter") 3470 #+end_src 3471 3472 *** Add missing front matter on demand 3473 :PROPERTIES: 3474 :CUSTOM_ID: h:32a103be-71a2-48e4-a18e-7727c04545ed 3475 :END: 3476 3477 Sometimes the user may have incomplete front matter, perhaps due to a 3478 mistake that was saved on disk. The command ~denote-add-front-matter~ 3479 appends a new front matter block to the current note. 3480 3481 Read: 3482 <https://protesilaos.com/emacs/denote#h:54b48277-e0e5-4188-ad54-ef3db3b7e772> 3483 3484 Or evaluate: 3485 3486 #+begin_src emacs-lisp 3487 (info "(denote) Regenerate front matter") 3488 #+end_src 3489 3490 ** Faces for Denote links 3491 :PROPERTIES: 3492 :CUSTOM_ID: h:507fb46c-a2e9-48a7-8cd2-53c5fc73394d 3493 :END: 3494 3495 We provide the ~denote-faces-link~ and the ~denote-faces-broken-link~. 3496 The latter is only relevant for Org, as Emacs' standard button mechanism 3497 does not have a way to apply a face dynamically. 3498 3499 This is a change for themes/tinkerers who need to differentiate 3500 =denote:= links from other links. Otherwise, the presentation is the 3501 same as before. 3502 3503 Thanks to Peter Prevos for asking about it on the mailing list: 3504 <https://lists.sr.ht/~protesilaos/denote/%3C03618bb20d3eaba78c32cd0cb63bfc71%40prevos.net%3E>. 3505 3506 ** Use of XDG path in ~denote-directory~ 3507 :PROPERTIES: 3508 :CUSTOM_ID: h:efa3049e-f1fa-48ff-af7d-d16edc677704 3509 :END: 3510 3511 The default value of the ~denote-directory~ user option used to be 3512 =~/Documents/notes= (subject to some conversion via Elisp). Denote now 3513 conforms with the freedesktop.org specifications by using the =XDG= 3514 directory for =DOCUMENTS= instead of =~/Documents=: 3515 <https://www.freedesktop.org/wiki/Software/xdg-user-dirs/>. 3516 3517 Users who already bind the ~denote-directory~ are not affected by this 3518 change. Same for those who do not tinker with =XDG= environment 3519 variables and/or do not use some exotic setup. 3520 3521 Thanks to Philip Kaludercic for the patch: 3522 <https://lists.sr.ht/~protesilaos/denote/patches/34561#%3C20220809115824.43089-1-philipk@posteo.net%3E> 3523 3524 ** Bespoke major-mode for the backlinks' buffer 3525 :PROPERTIES: 3526 :CUSTOM_ID: h:feb9a0ed-ba15-486e-ae11-5b222b00bc31 3527 :END: 3528 3529 The backlinks' buffer now uses the ~denote-backlink-mode~ instead of the 3530 generic ~special-mode~. The former derives from the latter. It binds 3531 keys to move between links with =n= (next) and =p= (previous). These 3532 are stored in the ~denote-backlink-mode-map~ (use =M-x describe-mode= 3533 (=C-h m=) in an unfamiliar buffer to learn more about it). 3534 3535 Thanks to Philip Kaludercic for the patch: 3536 <https://lists.sr.ht/~protesilaos/denote/patches/34561#%3C20220809115824.43089-2-philipk@posteo.net%3E> 3537 3538 ** Changes to the manual 3539 :PROPERTIES: 3540 :CUSTOM_ID: h:80217a39-86b8-4310-b7c4-dcc14e0b98fd 3541 :END: 3542 3543 + Documented all of the aforementioned. Improved how information is 3544 presented and, generally, iterated on an already comprehensive 3545 document. 3546 3547 + Introduced a node which explains how to tweak the front matter: 3548 <https://protesilaos.com/emacs/denote#h:7f918854-5ed4-4139-821f-8ee9ba06ad15>. 3549 Or evaluate: 3550 3551 #+begin_src emacs-lisp 3552 (info "(denote) Change the front matter format") 3553 #+end_src 3554 3555 + Updated the reference to =consult-notes=. This is a package that uses 3556 the =consult= interface to provide access and search facilities for 3557 notes. It can integrate with Denote. Thanks to Colin McLear for the 3558 change in pull request 70 on the GitHub mirror: 3559 <https://github.com/protesilaos/denote/pull/70>. 3560 3561 [ The change is below the ~15 line threshold and thus does not require 3562 copyright assignment to the Free Software Foundation. ] 3563 3564 ** Internal restructuring 3565 :PROPERTIES: 3566 :CUSTOM_ID: h:5d09d0af-3c25-4419-8448-90b8e1adab0d 3567 :END: 3568 3569 + All Denote code is consolidated in =denote.el=. We no longer maintain 3570 separate files like =denote-link.el=, =denote-dired.el=, etc. Users 3571 who had ~require~ calls to such libraries must remove them and only 3572 keep: 3573 3574 #+begin_src emacs-lisp 3575 (require 'denote) 3576 #+end_src 3577 3578 + User options that have an entry in the manual will now provide a link 3579 to it via their Help buffer and/or the Custom UI. This is done by 3580 adding the =:link= attribute to their declaration. 3581 3582 Furthermore, user options and faces now specify the version of Denote 3583 that last affected their value (e.g. ~denote-directory~, which was 3584 mentioned above for the XDG spec, now informs the user that it changed 3585 for version =0.5.0=). 3586 3587 [ I learnt these by developing the =modus-themes=. ] 3588 3589 + The variables ~denote-last-title~, ~denote-last-keywords~, 3590 ~denote-last-buffer~, and ~denote-last-front-matter~ are all obsolete. 3591 These were used prior to version =0.1.0= to help with development but 3592 are now deemed surplus to requirements. 3593 3594 + Lots of changes were made to private functions, variables, doc 3595 strings, and comments, in the interest of simplifying the code and/or 3596 ensuring consistency in how operations are carried out. Though 3597 everything is the same for the end-user. 3598 3599 Thanks to Jean-Philippe Gagné Guay for the numerous contributions on the 3600 GitHub mirror. They are important for Denote, though the user does not 3601 need to know what is happening internally (consult the Git log for the 3602 details): 3603 3604 - <https://github.com/protesilaos/denote/pull/65> 3605 - <https://github.com/protesilaos/denote/pull/72> 3606 - <https://github.com/protesilaos/denote/pull/73> 3607 - <https://github.com/protesilaos/denote/pull/78> 3608 - <https://github.com/protesilaos/denote/pull/80> 3609 - <https://github.com/protesilaos/denote/pull/81> 3610 - <https://github.com/protesilaos/denote/pull/82> 3611 - <https://github.com/protesilaos/denote/pull/83> 3612 3613 ** Discussions 3614 :PROPERTIES: 3615 :CUSTOM_ID: h:79089c06-9e0c-49cc-9d53-a1a2fd72fb65 3616 :END: 3617 3618 *** Encrypting Denote notes 3619 :PROPERTIES: 3620 :CUSTOM_ID: h:87e4556a-4864-4955-a98c-62b2e6a509c3 3621 :END: 3622 3623 Paul van Gelder asked about this on the mailing list. I provided 3624 guidelines on what can be done, though did not record anything in the 3625 manual: I prefer to elicit more feedback from users. The gist is that 3626 Emacs already has all the requisite functionality, though encryption per 3627 se is outside the scope of Denote: 3628 <https://lists.sr.ht/~protesilaos/denote/%3C1123434736.64290.1658954014673%40kpc.webmail.kpnmail.nl%3E>. 3629 3630 Denote's relevant internal mechanisms will recognise files ending in 3631 =.gpg= (e.g. for fontification in Dired). 3632 3633 *** Visualise usage of Denote keywords 3634 :PROPERTIES: 3635 :CUSTOM_ID: h:d94ee5e3-0a54-404c-b44b-34edc3703fbc 3636 :END: 3637 3638 Peter Prevos shared a proof-of-concept way to visualise keywords in the 3639 ~denote-directory~ and show usage statistics: 3640 <https://lists.sr.ht/~protesilaos/denote/%3Ce9e5d6ae85984b51067b47f4d8e134fa%40prevos.net%3E>. 3641 3642 We do not include this information in the manual, as we wait for the 3643 fully fledged code. Though do give it a try if you are interested and, 3644 perhaps, share your thoughts for Peter's consideration. 3645 3646 *** Conflict between ~denote-dired-mode~ and ~diredfl-mode~ 3647 :PROPERTIES: 3648 :CUSTOM_ID: h:0cbf504c-676c-436e-8ae8-e7115368e691 3649 :END: 3650 3651 Hilde Rhyne shared a workaround they have to disable ~diredfl-mode~ in 3652 the buffers where ~denote-dired-mode~ is enabled. The conflict between 3653 the two is a known issue that is acknowledged in the manual: 3654 <https://lists.sr.ht/~protesilaos/denote/%3Cm0tu6q6bg0.fsf%40disroot.org%3E>. 3655 3656 I think we need a proper solution in the code we provide, so this 3657 workaround is not mentioned in the manual. 3658 3659 *** Why doesn't Denote provide a search facility? 3660 :PROPERTIES: 3661 :CUSTOM_ID: h:068108f4-a4fa-4ff8-be49-f1f10a862451 3662 :END: 3663 3664 There was a discussion started by Fourchaux, with the participation of 3665 basaran and Andre0991 on the GitHub mirror: 3666 <https://github.com/protesilaos/denote/issues/71>. 3667 3668 The gist of my answer is that Denote does not need to provide such a 3669 facility because notes are ordinary files: whatever the user already has 3670 for them should apply to Denote. If the user has nothing to search 3671 through files, they anyhow need something that works outside the 3672 confines of Denote: a =denote-SEARCH= command is not an adequate 3673 solution. 3674 3675 Emacs has numerous built-in commands, such as ~grep~ (~lgrep~ and 3676 ~rgrep~), ~project-find-regexp~, ~find-grep-dired~, ~ibuffer-do-occur~, 3677 ... Furthermore, there are lots of high quality packages that have 3678 their own wrappers or extensions for searching file contents, such as 3679 the =ivy= and =helm= completion frameworks, as well as =consult= (the 3680 commands ~consult-grep~ and ~consult-ripgrep~), =consult-notes=, =rg=, 3681 =deadgrep=, =deft=, and probably plenty more that do not come to mind 3682 right now. 3683 3684 I strongly encourage the user to find a universal search solution to the 3685 problem of searching file contents. 3686 3687 * Version 0.4.0 on 2022-07-25 3688 :PROPERTIES: 3689 :CUSTOM_ID: h:1c8098ee-089c-4511-bc6a-4140aab01321 3690 :END: 3691 3692 + Defined the ~denote-link-dired-marked-notes~ command. It lets the 3693 user produce a typographic list of links to the note files that are 3694 marked in Dired. The list is written at point. If there are multiple 3695 buffers which visit Denote notes, the command first prompts with 3696 minibuffer completion for one among them. 3697 3698 In terms of workflow, ~denote-link-dired-marked-notes~ complements the 3699 ~denote-link-add-links~ command for those cases where it is easier to 3700 select files than write an elegant regular expression. 3701 3702 + Implemented the ~denote-dired-rename-marked-files~ command. This 3703 provides a much-requested facility to perform the familiar renaming 3704 operation on a set of files. In particular: 3705 3706 - the file's existing file name is retained and becomes the =TITLE= 3707 field, per Denote's file-naming scheme; 3708 3709 - the =TITLE= is sluggified and downcased, per our conventions; 3710 3711 - an identifier is prepended to the =TITLE=; 3712 3713 - the file's extension is retained; 3714 3715 - a prompt is asked once for the =KEYWORDS= field and the input is 3716 applied to all file names; 3717 3718 - if the file is recognised as a Denote note, the command rewrites its 3719 front matter to include the new keywords. A confirmation to carry 3720 out this step is performed once at the outset. Note that the 3721 affected buffers are not saved. The user can thus check them to 3722 confirm that the new front matter does not cause any problems 3723 (e.g. with the command ~diff-buffer-with-file~). Multiple buffers 3724 can be saved with ~save-some-buffers~ (read its doc string). 3725 3726 Parts of ~denote-dired-rename-marked-files~ were added or refined over 3727 a series of commits. Consult the Git log for the minutia. Thanks to 3728 Jean-Philippe Gagné Guay for the relevant additions in pull requests 3729 51 and 52 on the GitHub mirror: 3730 3731 - <https://github.com/protesilaos/denote/pull/51> 3732 - <https://github.com/protesilaos/denote/pull/52> 3733 3734 Jean-Philippe has assigned copyright to the Free Software Foundation. 3735 3736 + Improved how the ~denote-dired-rename-file~ command rewrites front 3737 matter. Before, it would perform a replacement of the whole block, 3738 which had the adverse effect of overwriting custom front matter 3739 entries. Now, it only targets the lines which hold the title and 3740 keywords, leaving everything else intact. Thanks to Peter Prevos for 3741 reporting the problem and testing the solution to it in issue 60 on 3742 the GitHub mirror: <https://github.com/protesilaos/denote/issues/60>. 3743 3744 + Introduced the ~denote-dired-rename-file-and-add-front-matter~ command 3745 that always prepends front matter to a file whose extension is among 3746 the supported ones (per the user option ~denote-file-type~). This 3747 differs from the standard ~denote-dired-rename-file~ command which 3748 only rewrites the front matter's title and keywords if they exist. 3749 3750 In practice, ~denote-dired-rename-file-and-add-front-matter~ empowers 3751 the user to convert a generic text file to a Denote note. 3752 3753 This command was originally added by Jean-Philippe Gagné Guay in pull 3754 request 49 on the GitHub mirror and refined in subsequent commits: 3755 <https://github.com/protesilaos/denote/pull/49>. Also read issue 48 3756 where this idea was originally discussed: 3757 <https://github.com/protesilaos/denote/issues/48>. 3758 3759 + Added the ~denote-dired-rename-marked-files-and-add-front-matters~ 3760 command, which is like the ~denote-dired-rename-marked-files~ but adds 3761 front matter instead of rewriting existing one, just how the command 3762 ~denote-dired-rename-file-and-add-front-matter~ does it (both are 3763 mentioned above). Thanks to Jean-Philippe Gagné Guay for the 3764 refinements to it in pull request 53 on the GitHub mirror: 3765 <https://github.com/protesilaos/denote/pull/53>. 3766 3767 + Wrote an interactive spec for ~denote-link-buttonize-buffer~. It can 3768 now be invoked with =M-x= or a key binding, should the need arise. 3769 This function is normally called via a hook and takes effect in plain 3770 text as well as Markdown files. 3771 3772 + Extended the fontification rules so that file names with non-ASCII 3773 characters are styled properly. This issue was brought up on the 3774 mailing list by Frank Ehmsen and was discussed with the participation 3775 of Peter Prevos: 3776 <https://lists.sr.ht/~protesilaos/denote/%3C2273b3b1-344c-6c6e-3ab6-a227b6bc3721%40eh-is.de%3E>. 3777 3778 The same topic was raised at the same time on the GitHub mirror by 3779 user hpgisler in issue 61: 3780 <https://github.com/protesilaos/denote/issues/61>. 3781 3782 After some discussion, we agreed on the right approach, which was 3783 formalised by Peter Prevos as pull request 64 on the GitHub mirror: 3784 <https://github.com/protesilaos/denote/pull/64>. The change is below 3785 the ~15 line threshold and thus does not require copyright assignment 3786 to the Free Software Foundation. 3787 3788 + Made the registration of the =denote:= custom Org hyperlink type 3789 conditional on the availability of the ~org~ feature. In other words, 3790 those who do not use Org will not be loading this part of the code. 3791 Thanks to Abin Simon for reporting the problem and for showing how 3792 Elfeed handles this case. This was done in issue 47 on the GitHub 3793 mirror: <https://github.com/protesilaos/denote/issues/47>. 3794 3795 + Ensured that duplicate keywords are not produced by the relevant 3796 prompt. Thanks to user Taoufik for the contribution in pull request 3797 50 on the GitHub mirror: <https://github.com/protesilaos/denote/pull/50>. 3798 The change is below the ~15 line threshold and thus does not require 3799 copyright assignment to the Free Software Foundation. 3800 3801 + Fixed a typo in the reference to the ~crm-separator~ in the manual. 3802 David Wilson (System Crafters channel) spotted the error in a recent 3803 live stream whose main topic was about Denote (thanks, by the way!): 3804 <https://www.youtube.com/watch?v=QcRY_rsX0yY>. 3805 3806 + Addressed an inconsistency in the command ~denote-link-find-file~ 3807 where it would not recognise links without a title in their format 3808 (those can be inserted by passing a prefix argument (=C-u= by default) 3809 to the commands that insert links, such as ~denote-link~). 3810 3811 + Attached conditionality to the ~denote~ command's =SUBDIRECTORY= 3812 argument, so that it does not create new file paths. This is only 3813 relevant for those who call ~denote~ from Lisp. Interactive use is 3814 the same as before. 3815 3816 + Clarified that the user option ~denote-org-capture-specifiers~ can 3817 accept arbitrary text in addition to the formatting specifiers that 3818 Org's capture mechanism introduces. 3819 3820 + Explained in the manual why ~denote-org-capture-specifiers~ is needed 3821 instead of writing the capture template directly the way one normally 3822 does. The gist is that because our file names are derived dynamically 3823 based on user input, we need to account for the sequence in which the 3824 value of arguments is reified by ~org-capture~. 3825 3826 + Refactored how notes are prepared internally. Thanks to Jean-Philippe 3827 Gagné Guay for the contribution in pull request 55 on the GitHub 3828 mirror: <https://github.com/protesilaos/denote/pull/55>. 3829 3830 + Declared the ~denote-punctuation-excluded-extra-regexp~ variable which 3831 is, for the time being, targeted at experienced users. Its purpose is 3832 to extend what we consider "illegal" punctuation for the file name. 3833 Thanks to pRot0ta1p for the feedback in issue 57 over at the GitHub 3834 mirror: <https://github.com/protesilaos/denote/issues/57>. Example 3835 based on the input of pRot0ta1p: 3836 3837 #+begin_src emacs-lisp 3838 (setq denote-punctuation-excluded-extra-regexp 3839 "[『』〖〗{}「」【】〔〕[]()《》〈〉«»!#¥%…&"'*,。;:、?—]*") 3840 #+end_src 3841 3842 The ideal is to make ~denote--punctuation-regexp~ work for all 3843 scripts, but that may be unrealistic. 3844 3845 + Clarified what the manual means by "attachments" to notes. Those are 3846 for Org, if the user resorts to the relevant Org mechanisms. Denote 3847 does not do any of that. 3848 3849 + Revised the parsing of a date input as used in the ~denote-date~ 3850 command or related. The idea is to turn =2020-01-15= into something 3851 like =2020-01-15 16:19= by using the current time, so that the hour 3852 and minute component is not left to =00:00= when the user does not 3853 specify it explicitly. 3854 3855 This reduces the burden on the user who would otherwise need to input 3856 the time value in order to avoid the error of duplicate identifiers in 3857 the scenario where the same date is used more than once. 3858 3859 The change also addresses a difference between Emacs 28 and Emacs 29 3860 where the former does not read dates without a time component. 3861 3862 Thanks to Peter Prevos for the feedback in issue 58 over at the GitHub 3863 mirror: <https://github.com/protesilaos/denote/issues/58>. 3864 3865 + Fixed compilation warnings in Emacs 29 about the format of doc strings 3866 that need to output a literal single quote. Thanks to Kyle Meyer for 3867 the patch, which was sent on the mailing list: 3868 <https://lists.sr.ht/~protesilaos/denote/patches/34117>. 3869 3870 + Fixed typo in the user option ~denote-prompts~ about the 3871 ~crm-separator~. Thanks to Kyle Meyer for the patch, which was sent 3872 on the mailing list: 3873 <https://lists.sr.ht/~protesilaos/denote/patches/34116>. 3874 3875 + Made the built-in =subr-x= library a runtime dependency, due to 3876 complications with the ~when-let*~ form. The problem was made 3877 manifest in a renaming operation, though it was not about renaming per 3878 se. Thanks to hpgisler for reporting the problem in issue 62 and for 3879 testing the proposed solution: 3880 <https://github.com/protesilaos/denote/issues/62>. 3881 3882 + Streamlined the use of the =seq= library instead of =cl-lib=, as we 3883 were already using the former more heavily and there was no need for 3884 the latter. Thanks to Philip Kaludercic for pointing this out on the 3885 emacs-devel mailing list: 3886 <https://lists.gnu.org/archive/html/emacs-devel/2022-07/msg00838.html>. 3887 3888 + Added a generic =README.md= file to placate the Git forges. Neither 3889 SourceHut nor GitHub/GitLab are fully compliant with the Org markup we 3890 use in =README.org= (we use Org because it is easy to generate the 3891 Info manual and HTML pages out of it). SourceHut will not render the 3892 file at all, while the others render it but do not parse it properly. 3893 3894 + Made several other internal tweaks and refinements in the interest of 3895 robustness and/or clarity. 3896 3897 + Rewrote all relevant documentation. 3898 3899 ** Non-changes 3900 :PROPERTIES: 3901 :CUSTOM_ID: h:0ac79968-a575-4380-addc-d58cc2b5f627 3902 :END: 3903 3904 The following are not part of any changes that were made during this 3905 release cycle, though they provide potentially interesting insight into 3906 the workings of the project. 3907 3908 + Identifiers with milliseconds :: Denote's identifier format extends up 3909 to seconds. This is the product of years of experimentation and is, 3910 in my opinion, the best compromise between usability/readability and 3911 precision. If a user produces two notes within a fraction of a 3912 second, then yes they will have duplicate identifiers. In principle, 3913 there is no reason not to address this potential problem, provided we 3914 do not compromise on Denote's file-naming scheme (making the 3915 identifier less readable is a compromise). We shall see what the best 3916 course of action is. Thanks to Felipe Balbi and Jean-Philippe Gagné 3917 Guay for the discussion thus far in issue 54 on the GitHub mirror: 3918 <https://github.com/protesilaos/denote/issues/54>. 3919 3920 + Denote and evil-mode :: Users of evil-mode do not have to worry about 3921 Denote, as we do not define any key bindings. The manual includes 3922 sample configuration, which proposes some key bindings, but that is 3923 the user's prerogative. Thanks to Saša Janiška and Alan Schmitt for 3924 their participation on the mailing list: 3925 <https://lists.sr.ht/~protesilaos/denote/%3C87czdxf1dz.fsf%40atmarama.ddns.net%3E>. 3926 3927 + Denote and Citar :: Peter Prevos started developing a package that 3928 connects Denote with Citar: <https://github.com/pprevos/denote-citar>. 3929 The idea is to use notes as part of one's bibliography. Discussions 3930 which include sample code on how to leverage ~denote~ from Lisp: 3931 3932 - <https://lists.sr.ht/~protesilaos/denote/%3C6add8bc63cab0a557fa4b9919e025afc%40prevos.net%3E> 3933 - <https://lists.sr.ht/~protesilaos/denote/%3C87r12d2w96.fsf%40protesilaos.com%3E> 3934 - <https://lists.sr.ht/~protesilaos/denote/%3C87a69060q6.fsf%40protesilaos.com%3E> 3935 3936 + Denote and graph of connections :: Saša Janiška asked whether Denote 3937 will provide some way to visualise links between notes. The answer is 3938 negative. Denote's scope is clearly delineated and its feature set is 3939 largely complete (notwithstanding refinements to what we already 3940 provide). Peter Prevos is experimenting with some code that uses the 3941 R language. Any such facility will have to be implemented as a 3942 separate package. I remain at the disposal of anyone who needs help 3943 with Denote's internals. Thanks to the aforementioned fellows for 3944 their participation on the mailing list: 3945 <https://lists.sr.ht/~protesilaos/denote/%3C878roleze1.fsf%40atmarama.ddns.net%3E>. 3946 3947 + Denote's scalability :: There was a discussion whether Denote will 3948 work well with very large sets of files. The short answer is that it 3949 will work the same way Emacs and/or standard Unix tools do: good 3950 enough! If there are improvements to be made, which do not jeopardise 3951 the principles of the project, we shall implement them without 3952 hesitation. Thanks to Saša Janiška and Peter Prevos for their 3953 participation on the mailing list: 3954 <https://lists.sr.ht/~protesilaos/denote/%3C87sfmtf7im.fsf%40atmarama.ddns.net%3E>. 3955 3956 + Denote's minimum requirement of Emacs 27.2 :: We cannot depend on 3957 Emacs 27.1 due to this message from the byte compiler: 3958 3959 : You should depend on (emacs "27.2") or the (org "9.3") package if you need `org-link-open-as-file'. 3960 3961 Depending on Org is not an option because Denote optionally works 3962 without Org, so Emacs 27.2 is what we have to opt for. If your 3963 operating system does not provide this version in package format, 3964 please petition its maintainers/providers to do so. Thanks to 3965 Alexander for asking about it on the mailing list: 3966 <https://lists.sr.ht/~protesilaos/denote/%3C9ec818e6a7979efbb2f8b1f5a497665b%40purelymail.com%3E>. 3967 3968 Finally, a mildly interesting piece of trivia: we have exceeded 600 3969 commits since the first day of the project's Git history on 2022-06-04 3970 (the actual history is much longer). That averages to more than 10 per 3971 day! I think things will slow down eventually. 3972 3973 * Version 0.3.0 on 2022-07-11 3974 :PROPERTIES: 3975 :CUSTOM_ID: h:6864cfd4-d0be-4c89-b313-39ba6e892a03 3976 :END: 3977 3978 + Fixed how references are analysed to produce the backlinks' buffer. 3979 This should resolve the issue that some users faced where the 3980 backlinks would not be produced. 3981 3982 The previous implementation would not yield the appropriate results if 3983 (i) the value of the user option ~denote-directory~ was a "project" 3984 per the built-in project.el and (ii) the link to the given entry was 3985 from a subdirectory. In short, the references were sometimes returned 3986 as relative file paths, whereas they should always be absolute. 3987 Thanks to Jean-Philippe Gagné Guay for the feedback in issue 42 over 3988 at the GitHub mirror: <https://github.com/protesilaos/denote/pull/42>. 3989 3990 [ Jean-Philippe has assigned copyright to the Free Software 3991 Foundation. It is a prerequisite for contributing to core Emacs 3992 and/or any package distributed via the official GNU ELPA. ] 3993 3994 + Addressed a regression in the function ~denote-directory~ (this is the 3995 function that normalises the variable of the same name) which 3996 prevented it from returning an expanded file path. This too 3997 contributed to problems with the backlinking facility. Thanks to 3998 Jean-Philippe Gagné Guay for the contribution in pull request 44 over 3999 at the GitHub mirror: <https://github.com/protesilaos/denote/pull/44>. 4000 4001 Also thanks to user pRot0ta1p for the relevant feedback in issue 43 4002 (also on the mirror): <https://github.com/protesilaos/denote/issues/43>. 4003 More thanks to Alfredo Borrás, Benjamin Kästner, and Sven Seebeck for 4004 their comments in a related thread on the mailing list: 4005 <https://lists.sr.ht/~protesilaos/denote/%3CCA73E705-1194-4324-9962-70708C4C72E5%40zoho.eu%3E>. 4006 These discussions showed we had a problem, which we managed to 4007 identify. 4008 4009 + Introduced the user option ~denote-prompts~ (read its doc string or 4010 the relevant entry in the manual). It governs how the standard 4011 ~denote~ command for creating new notes will behave in interactive 4012 usage. By default, ~denote~ prompts for a title and keywords. With 4013 ~denote-prompts~, the command can also ask for a file type (per 4014 ~denote-file-type~), subdirectory of the ~denote-directory~, and a 4015 specific date+time. Prompts occur in the order they are specified. 4016 Furthermore, the ~denote-prompts~ can be set to values which do not 4017 include the title and keywords. This means that the resulting file 4018 names can be any of those permutations: 4019 4020 : DATE.EXT 4021 : DATE--TITLE.EXT 4022 : DATE__KEYWORDS.EXT 4023 4024 Recall that Denote's standard file-naming scheme is defined as follows 4025 (read the manual for the details): 4026 4027 : DATE--TITLE__KEYWORDS.EXT 4028 4029 For our purposes, Denote will work perfectly fine for linking and 4030 backlinking, even if file names do not include the =TITLE= and 4031 =KEYWORDS= fields. However, the user is advised to consider the 4032 implications on usability: notes without a descriptive title and/or 4033 useful keywords may be hard to filter and practically impossible to 4034 manage at scale. File names without such information should at least 4035 be added to subdirectories which themselves have a descriptive name. 4036 4037 At any rate, Denote does not have strong opinions about one's 4038 workflow. The standard file name is the culmination of years of 4039 experience. 4040 4041 Consider the ~denote-prompts~ the affirmative answer to the question 4042 "Can keywords be optional?" as posed by Jack Baty on the mailing list: 4043 <https://lists.sr.ht/~protesilaos/denote/%3C8D392BC3-980A-4E5B-9480-D6A00BE8279F%40baty.net%3E>. 4044 4045 Thanks to Jean-Philippe Gagné Guay for the original contribution in 4046 commit 9b981a2. It was originally part of a pull request, but due to 4047 some internal changes I had to merge it as a patch and technically the 4048 web UI did not count the PR as "merged" (though it was in terms of 4049 substance). 4050 4051 + Refactored the ~denote~ command to (i) accommodate the new user option 4052 ~denote-prompts~ via its interactive specification and (ii) be more 4053 flexible when called from Lisp. The latter scenario is for advanced 4054 users or, generally, those who can maintain some custom code in their 4055 configuration. A case in point is one of the examples we show in the 4056 manual for a programmatic way to create notes that automatically get 4057 the =journal= tag: 4058 4059 #+begin_src emacs-lisp 4060 (defun my-denote-journal () 4061 "Create an entry tagged 'journal', while prompting for a title." 4062 (interactive) 4063 (denote 4064 (denote--title-prompt) 4065 '("journal"))) 4066 #+end_src 4067 4068 Notice that the ='("journal")= is a list of strings even for a single 4069 keyword. Whereas before a single one was a plain string. This is a 4070 breaking change. 4071 4072 Please consult the doc string of the ~denote~ command for the 4073 technicalities. 4074 4075 + Refashioned the interactive convenience functions of ~denote-type~, 4076 ~denote-date~, ~denote-subdirectory~ to leverage the ~denote-prompts~ 4077 user option while calling ~denote~ interactively. In practical terms, 4078 they no longer accept any arguments when called from Lisp. Users who 4079 need a programmatic approach are advised to either call ~denote~ 4080 directly, or check how these commands ~let~ bind the ~denote-prompts~ 4081 to carry out their operations. The doc string of each command 4082 explains how it works. Or evaluate this to check the manual: 4083 4084 #+begin_src emacs-lisp 4085 (info "(denote) Convenience commands for note creation") 4086 #+end_src 4087 4088 Else visit: 4089 <https://protesilaos.com/emacs/denote#h:887bdced-9686-4e80-906f-789e407f2e8f> 4090 4091 + Documented how the user option ~denote-directory~ can accept a local 4092 value. This is pertinent to scenaria where the user needs to maintain 4093 separate directories of notes. By "separate" we mean sets of notes 4094 that do not communicate with each other, cannot create links between 4095 them, etc. The manual delves into the technicalities. If you have 4096 the Info entry installed, evaluate: 4097 4098 #+begin_src emacs-lisp 4099 (info "(denote) Maintain separate directories for notes") 4100 #+end_src 4101 4102 Else visit: 4103 <https://protesilaos.com/emacs/denote#h:15719799-a5ff-4e9a-9f10-4ca03ef8f6c5>. 4104 4105 Thanks to user "Summer Emacs" for starting the discussion on the 4106 mailing list, and Benjamin Kästner for their participation: 4107 <https://lists.sr.ht/~protesilaos/denote/%3Cm25yk5e856.fsf@gmail.com%3E>. 4108 4109 + Added an entry to the manual's Frequently Asked Questions about a 4110 failed search for backlinks. It includes sample code that users of 4111 Windows can apply, if necessary. (The error is not Denote's fault.) 4112 Thanks to Benjamin Kästner for the patch, which is below the ~15 line 4113 threshold and thus does not require copyright assignment to the Free 4114 Software Foundation: 4115 <https://lists.sr.ht/~protesilaos/denote/%3Cce117b14-55cf-622e-6cd8-0af698091ae3%40gmail.com%3E>. 4116 4117 + Removed duplicate entries from the list of file paths that the =xref= 4118 library returns for the purposes of backlinking. Thanks to 4119 Jean-Philippe Gagné Guay for the contribution in pull request 44 on 4120 the GitHub mirror: <https://github.com/protesilaos/denote/issues/44>. 4121 4122 + Applied an appropriate face to the backlinks' button to mitigate an 4123 error. Thanks to Jean-Philippe Gagné Guay for the contribution in 4124 pull request 45 on the GitHub mirror and for later testing a 4125 subsequent tweak: <https://github.com/protesilaos/denote/issues/45>. 4126 4127 + Simplfied all the faces we define to make them work with all themes. 4128 The previous colours were consistent with the =modus-themes=: 4129 <https://protesilaos.com/emacs/modus-themes>. 4130 4131 + Refined how strings are sluggified under all circumstances. Before, a 4132 nil value for the user option ~denote-allow-multi-word-keywords~ would 4133 have the adverse effect of joining all the strings in the title field 4134 of the file name. The intent always was to do that only for 4135 multi-word keywords, not the title. This change was part of a hotfix, 4136 formalised as version =0.2.1= a day after the release of =0.2.0=. 4137 4138 + Made the fontification rules more robust, while avoiding any false 4139 positives. This was done over a series of commits as it had 4140 implications for the file name permutations that were mentioned 4141 earlier. Thanks to Jean-Philippe Gagné Guay for the patches and/or 4142 discussion about the merits of each change and concomitant 4143 considerations: 4144 4145 - https://github.com/protesilaos/denote/pull/36 4146 - https://github.com/protesilaos/denote/pull/38 4147 - https://github.com/protesilaos/denote/pull/40 4148 - https://github.com/protesilaos/denote/pull/42 4149 4150 + Rewrote all relevant entries in the manual to reflect all the 4151 user-facing aspects of the aforementioned. 4152 4153 + Discussed a use-case of rewriting old journal entries as Denote-style 4154 files. As of this writing, we do not support migration of files in 4155 bulk. It might happen at some point, though it is no mean task. 4156 Thanks to Summer Emacs and Alan Schmitt for their participation: 4157 <https://lists.sr.ht/~protesilaos/denote/%3Cm27d4mbktj.fsf%40gmail.com%3E>. 4158 4159 An aside here as this topic was brought up: my packages are open to 4160 users of all skill levels and is why I maintain a mailing list as well 4161 as mirrors of the official git repository on SourceHut. Do not 4162 hesitate to ask a question. If, for whatever reason, those 4163 communication channels are not appropriate, you are welcome to contact 4164 me in private: <https://protesilaos.com/contact>. 4165 4166 Thanks again to Jean-Philippe Gagné Guay for the numerous contributions. 4167 Please read the commit log for the minutia, as this change log entry 4168 omitted some of the finer yet important details. 4169 4170 * Version 0.2.0 on 2022-07-04 4171 :PROPERTIES: 4172 :CUSTOM_ID: h:2002fee6-3f0c-48be-9727-6d4e20f34856 4173 :END: 4174 4175 + Version =0.1.0= (from 2022-06-27) was never built as a package. The 4176 reason is that the GNU ELPA machinery reads the =Version:= header of 4177 the main file, not the git tag. As the original commit in =denote.el= 4178 included =Version: 0.1.0=, GNU ELPA rightly tries to build the package 4179 using that reference. But because at that time I had not yet updated 4180 the Copyright header to name the Free Software Foundation, the package 4181 could not be prepared. As such, please consider this release to be 4182 the "first formal stable version". My apologies for the delay, 4183 contrary to what was promised in the last change log entry. 4184 4185 - Prospective users are advised to read the manual: 4186 <https://protesilaos.com/emacs/denote>. For a video demonstration: 4187 <https://protesilaos.com/codelog/2022-06-18-denote-demo/>. 4188 4189 - Thanks to Benjamin Kästner for reporting the issue with the GNU ELPA 4190 package on the mailing list: 4191 <https://lists.sr.ht/~protesilaos/denote/%3C9d600ff0-4fed-2ad7-5dbc-5a194639a045@gmail.com%3E>. 4192 4193 + Originally, Denote was designed to only work with notes in a flat 4194 directory. With code contributions from Jean-Philippe Gagné Guay, 4195 support for subdirectories of the user option ~denote-directory~ is 4196 now available. This covers the case of creating links between notes, 4197 following them, and viewing the backlinks' buffer of the current 4198 entry. 4199 4200 - Thanks to Jean-Philippe for the contributions which took place on 4201 the GitHub mirror: 4202 4203 + <https://github.com/protesilaos/denote/pull/24> 4204 + <https://github.com/protesilaos/denote/pull/25> 4205 + <https://github.com/protesilaos/denote/pull/26> 4206 4207 - Jean-Philippe Gagné Guay has assigned copyright to the Free Software 4208 Foundation. This is a prerequisite to contribute code to any 4209 package on the official GNU ELPA archive (and to emacs.git for that 4210 matter). 4211 4212 + The new ~denote-subdirectory~ command lets the user select a directory 4213 to place the new note in. Available candidates are the value of the 4214 ~denote-directory~ as well as all of its subdirectories, minus =.git=. 4215 In future versions, we will consider how to provide a blocklist or a 4216 regexp filter for the user to specify which subdirectories should be 4217 omitted from minibuffer completion. Please consider providing your 4218 feedback on the technicalities. 4219 4220 - Thanks to Jean-Philippe Gagné Guay and Shreyas Ragavan for the 4221 feedback in issue 31 on the GitHub mirror: 4222 <https://github.com/protesilaos/denote/issues/31>. 4223 4224 - Thanks to Jean-Philippe Gagné Guay for fixing a potential problem in 4225 how directories are represented when commands enter the directory 4226 instead of selecting it (again, at the GitHub mirror): 4227 <https://github.com/protesilaos/denote/pull/35>. 4228 4229 + From 2022-06-24 to 2022-07-03, Denote provided support for links 4230 between Org notes that leveraged the =id:= hyperlink type. 4231 Discussions on the mailing list and the GitHub mirror revealed the 4232 longer-term problems in our implementation. In the Annex below, I 4233 provide my detailed opinion on the matter. The gist is that Denote 4234 does not---and will not---create =id:= links between its notes, but 4235 shall use the =denote:= hyperlink type instead (which works like the 4236 standard =file:= type). As the Annex explains, Denote is not org-roam 4237 lite and we try not to engender such false expectations. 4238 4239 - Despite the fact that the relevant patches are no longer applicable, 4240 I wish to thank Kaushal Modi and Jean-Philippe Gagné Guay for their 4241 contributions over at the GitHub mirror: 4242 4243 + <https://github.com/protesilaos/denote/pull/20> 4244 + <https://github.com/protesilaos/denote/pull/28> 4245 4246 + The user option ~denote-date-format~ controls how the date and time is 4247 recorded in the file's contents (what we call "front matter"). When 4248 nil (the default value), we use a file-type-specific format (also 4249 check the user option ~denote-file-type~): 4250 4251 - For Org, an inactive timestamp is used, such as =[2022-06-30 Wed 15:31]=. 4252 4253 - For Markdown, the RFC3339 standard is applied: =2022-06-30T15:48:00+03:00=. 4254 4255 - For plain text, the format is that of ISO 8601: =2022-06-30=. 4256 4257 If the value is a string, ignore the above and use it instead. The 4258 string must include format specifiers for the date. These are described 4259 in the doc string of ~format-time-string~. 4260 4261 The ~denote-date-format~ supersedes the now obsolete 4262 ~denote-front-matter-date-format~. 4263 4264 Thanks to Peter Prevos and Kaushal Modi for their feedback in issue 27 4265 on the GitHub mirror: <https://github.com/protesilaos/denote/issues/27>. 4266 4267 + All the faces we define are now declared in the =denote-faces.el= 4268 file. The fontification rules are shared by ~denote-dired-mode~ and 4269 the backlinks' buffer (invoked by ~denote-link-backlinks~ and 4270 controlled by the user option ~denote-link-fontify-backlinks~). The 4271 current list of faces: 4272 4273 - ~denote-faces-date~ 4274 - ~denote-faces-delimiter~ 4275 - ~denote-faces-extension~ 4276 - ~denote-faces-keywords~ 4277 - ~denote-faces-subdirectory~ 4278 - ~denote-faces-time~ 4279 - ~denote-faces-title~ 4280 4281 + Named the mailing list address as the =Maintainer:= of Denote. 4282 Together with the other package headers, they help the user find our 4283 primary sources and/or communication channels. This change conforms 4284 with work being done upstream in package.el by Philip Kaludercic. I 4285 was informed about it here: 4286 <https://lists.sr.ht/~protesilaos/general-issues/%3C875ykl84yi.fsf%40posteo.net%3E>. 4287 4288 + Fixed how keywords are inferred and combined. The previous code did not 4289 work properly when the user option =denote-infer-keywords= was nil. 4290 It would return a list of symbols, with the parentheses, whereas the 4291 file name needs a string where each keyword is delimited by an 4292 underscore. 4293 4294 + Simplified how information in the front matter is retrieved. It fixes 4295 cases where, for example, a special character at the end of the title 4296 was ignored. Thanks to Jean-Philippe Gagné Guay for the patch over at 4297 the GitHub mirror: <https://github.com/protesilaos/denote/pull/21>. 4298 4299 + Rewrote parts of the manual in the interest of clarity. 4300 4301 ** Annex about discontinuing support for org-id 4302 :PROPERTIES: 4303 :CUSTOM_ID: h:647d6155-1ac3-4ecb-bd4c-06d09fecd3ba 4304 :END: 4305 4306 My thanks for their participation in the discussions go to Jean-Philippe 4307 Gagné Guay, Kaushal Modi, and Shreyas Ragavan. 4308 4309 #+begin_example 4310 commit f35ef05cb451f265213c3aafc1e62c425b1ff043 4311 Author: Protesilaos Stavrou <info@protesilaos.com> 4312 Date: Sun Jul 3 17:34:38 2022 +0300 4313 4314 REMOVE support for 'id:' hyperlink types 4315 4316 The original idea was to support the 'org-id' library on the premise 4317 that it makes Denote a good Emacs citizen. However, discussions on the 4318 mailing list[0] and the GitHub mirror[1] have made it clear to me that 4319 'org-id' is not consistent with Denote's emphasis on simplicity. 4320 4321 To support the way 'org-id' works, we will eventually have to develop 4322 some caching mechanism, just how the org-roam package does it. This is 4323 because the variable 'org-id-extra-files' needs to be kept up-to-date 4324 whenever an operation on a file is performed. At scale, this sort of 4325 monitoring requires specialised software. Such a mechanism is outside 4326 the scope of Denote---if you need a db, use org-roam which is already 4327 great. 4328 4329 [0] <https://lists.sr.ht/~protesilaos/denote/%3C8735fk4y1w.fsf%40hallac.net%3E#%3C877d4un73c.fsf@protesilaos.com%3E> 4330 4331 [1] <https://github.com/protesilaos/denote/issues/29> 4332 4333 Quote of what I wrote on the GitHub mirror issue 29: 4334 4335 [ggjp] This is what I was implying. That we are, in fact, 4336 providing an option that is not viable long-term, but keeping 4337 the option for expert users who will be able to handle this. 4338 And we should warn about this clearly in the doc of that option. 4339 4340 [protesilaos] What you write here @ggjp and what @shrysr explained 4341 tells me that those expert users will need to be real experts. To 4342 put it concretely, I am an experienced Emacs user with no 4343 programming background, who has written several Emacs 4344 packages (including the modus-themes which are built into Emacs), 4345 but I have zero knowledge of using a db or of handling things with 4346 python and the like. So if I opt in to 'denote-link-use-org-id' I 4347 will eventually run into problems that my non-existent skills will 4348 prevent me from solving. At that point, I will just use org-roam 4349 which already handles this use-case in a competent way (and has a 4350 massive community to rely on in case I need further support). 4351 4352 If each package needs to write its own optimisations and maintain 4353 its own cache, to me this shows that 'org-id' is not good enough for 4354 the time being: more work needs to be done in org.git to provide a 4355 universal solution. 4356 4357 I wanted to support 'org-id' by default on the premise that Denote 4358 must be a good Emacs citizen which interoperates with the rest of 4359 the wider ecosystem. But if 'org-id' leaves something to be 4360 desired, then that goal is not worth pursuing: we add complexity to 4361 our code, offer an option that we cannot genuinely/adequately 4362 support, and make usage of it contingent on reading the docs and 4363 having a high level of expertise. 4364 4365 I think being a good Emacs citizen is a laudable principle. In this 4366 case, the right thing to do is to recommend the use of org-roam 4367 instead of trying to accommodate 'org-id'. As such, I have now 4368 changed my mind and think we should remove what we previously added. 4369 4370 For some context here: the reason I never used org-roam is 4371 because (i) it is Org-specific whereas I write notes in different 4372 file types and (ii) I did not want to ever rely on a db or 4373 equivalent dependency. 4374 4375 <https://github.com/protesilaos/denote/issues/29#issuecomment-1173036924> 4376 4377 README.org | 226 ++++++++--------------------------------------------- 4378 denote-link.el | 99 ++++++----------------- 4379 denote-retrieve.el | 2 +- 4380 denote.el | 14 +--- 4381 4 files changed, 63 insertions(+), 278 deletions(-) 4382 #+end_example 4383 4384 Followed up by my explanation: 4385 4386 #+begin_src text 4387 > can we not have denote style links to be default for (de)notes - and 4388 > explicitly supported, while if they need to, users can still link 4389 > denote org files via org-id to any other notes/files (and vice versa) 4390 > -- in which case performance + testing for org-id driven linking is 4391 > not within Denote's purview at all? 4392 4393 The formal support for `id:` links was added shortly before the release 4394 of version `0.1.0`. In the days prior, we supported what you describe 4395 via the manual. The user could change the `denote-org-front-matter` 4396 variable to include a `PROPERTIES` drawer. This possibility still 4397 exists, though yesterday I removed the relevant entry from the manual. 4398 This way only the real do-it-yourself experts will go down that path. 4399 4400 My concern here is with managing expectations. If our Org notes are 4401 superficially the same as org-roam's, an unsuspecting user may think 4402 that Denote is an org-roam lite. We will thus get issues/requests, such 4403 as those already mentioned in this GitHub repo, about migrating from 4404 org-roam to Denote. While there are similarities, Denote is not a 4405 minimalist org-roam and I would not like to encourage the idea of 4406 treating the two as interchangeable. 4407 4408 Doing things half-way-through is a way to create false expectations. A 4409 package on GNU ELPA must be usable by users of all skill levels. If the 4410 functionality we provide is incomplete and needs to be covered by 4411 user-level tweaks, we are excluding a portion of the user base while 4412 still assuming the maintenance burden. If someone trusts Denote to, 4413 say, write a 1000 notes, we do not want to surprise them after the fact. 4414 Imagine if the reported issues that triggered this change happened 6 4415 months into one's daily usage of Denote: it wouldn't be nice. 4416 4417 Setting the right expectations is a matter of responsibility: we let the 4418 user make a more informed choice and show respect for their time. It 4419 also makes it easier for me to keep Denote's scope in check by not 4420 supporting every little extra that Org implements. The premier Org 4421 extension is org-roam: we do not need another one (or, if we do, I am 4422 not the one to implement it). 4423 4424 ,* * * 4425 4426 Some comments on the `denote:` hyperlink type for Org as they may be 4427 relevant in this context: 4428 4429 ,* It is meant to work like the standard `file:` type. This means that 4430 it links to a file, while it can also have additional search 4431 parameters, as explained in the Org manual. Evaluate: 4432 4433 (info "(org) Search Options") 4434 4435 ,* It does not read the front matter, but only the file name. You can 4436 create a note as usual, delete all its contents, save it, and try to 4437 link to it from another note. It works. 4438 4439 ,* Exporting now works like the `file:` type for HTML, LaTeX, Texinfo, 4440 and Markdown. Technically, it also supports the ASCII backend but the 4441 format of the output could be tweaked further. 4442 4443 There may be refinements to be made, which is okay as that is part of a 4444 maintainer's duties. 4445 #+end_src 4446 4447 * Version 0.1.0 on 2022-06-27 4448 :PROPERTIES: 4449 :CUSTOM_ID: h:33939747-ad60-4913-a170-4b2f48f139cc 4450 :END: 4451 4452 The present entry is intended for early adopters of Denote who may have 4453 not caught up with the latest developments. Prospective users are 4454 advised to read the manual: <https://protesilaos.com/emacs/denote>. For 4455 a video demonstration: <https://protesilaos.com/codelog/2022-06-18-denote-demo/>. 4456 4457 + The =denote= package on GNU ELPA will be available a few hours after 4458 this release. GNU ELPA provides the latest stable release. To use a 4459 development snapshot, read: 4460 <https://protesilaos.com/codelog/2022-05-13-emacs-elpa-devel/>. 4461 4462 + Remember that any significant contribution (above ~15 lines) requires 4463 copyright assignment to the Free Software Foundation. A form with 4464 instructions is included in the manual's "Contributing" section: 4465 <https://protesilaos.com/emacs/denote#h:1ebe4865-c001-4747-a6f2-0fe45aad71cd>. 4466 4467 + The front matter of notes in Org has changed to be compliant with the 4468 standard =org-id= infrastructure. A =PROPERTIES= drawer is added to 4469 the top of the file, which includes an =ID= property with the value of 4470 the Denote identifier. Sample: 4471 4472 #+begin_src org 4473 :PROPERTIES: 4474 :ID: 20220610T202537 4475 :END: 4476 ,#+title: Sample Org front matter 4477 ,#+date: 2022-06-10 4478 ,#+filetags: denote testing 4479 #+end_src 4480 4481 + The front matter of Markdown (YAML or TOML) and plain text files 4482 remains constant. For completeness, this is how they look: 4483 4484 #+begin_src md 4485 --- 4486 title: "Sample with Markdown and YAML" 4487 date: 2022-06-10 4488 tags: denote testing 4489 identifier: "20220610T202021" 4490 --- 4491 #+end_src 4492 4493 #+begin_src md 4494 +++ 4495 title = "Sample with Markdown and TOML" 4496 date = 2022-06-10 4497 tags = ["denote", "testing"] 4498 identifier = "20220610T201510" 4499 +++ 4500 #+end_src 4501 4502 #+begin_example 4503 title: Sample plain text 4504 date: 2022-06-10 4505 tags: denote testing 4506 identifier: 20220610T202232 4507 --------------------------- 4508 #+end_example 4509 4510 + The integration with =org-id= extends to how linking works. By 4511 default, Denote uses its own custom hyperlink type which starts with 4512 the =denote:= prefix. In Org, it works like the =file:= type. When 4513 the user option ~denote-link-use-org-id~ is non-nil, links from Org 4514 notes to other Org notes will use the standard =id:= type instead. As 4515 this is an Org-specific feature, Denote takes care to use the 4516 major-mode-agnostic =denote:= type when the link targets a non-Org 4517 note. 4518 4519 + In Org files the links created by Denote are buttonized automatically. 4520 For Markdown and plain text, we use our own methods. When a link is 4521 inserted it is buttonized outright. To buttonize links in existing 4522 notes while visiting them in a buffer, add/evaluate this (it excludes 4523 Org on its own): 4524 4525 #+begin_src emacs-lisp 4526 (add-hook 'find-file-hook #'denote-link-buttonize-buffer) 4527 #+end_src 4528 4529 + The generation of the backlinks' buffer now uses the built-in =xref= 4530 library instead of relying on a hardcoded call to the =find= 4531 executable. This means that the ~denote-link-backlinks~ command will, 4532 in principle, work properly with all Emacs builds. 4533 4534 + Users of Emacs 28 or higher can configure ~xref-search-program~ to 4535 change from the default =grep= to =ripgrep=, =ugrep=, or a 4536 user-defined alternative. 4537 4538 + This is the first stable release of Denote. It covers close to 400 4539 commits starting from 2022-06-04. Denote is the successor to a toy 4540 package of mine, USLS, whose first public version was made available 4541 in early November 2020: <https://gitlab.com/protesilaos/usls>. 4542 4543 + Thanks to everyone involved in the development of Denote. Code 4544 contributions, bug reports, discussion of ideas, are all valuable. 4545 From A-Z the names mentioned in the manual's "Acknowledgements" 4546 section: Colin McLear, Damien Cassou, Frank Ehmsen, Jack Baty, Kaushal 4547 Modi, Peter Povinec, Sven Seebeck, Ypot. 4548 4549 + Sources of Denote: 4550 4551 + Package name (GNU ELPA): =denote= 4552 + Official manual: <https://protesilaos.com/emacs/denote> 4553 + Change log: <https://protesilaos.com/emacs/denote-changelog> 4554 + Git repo on SourceHut: <https://git.sr.ht/~protesilaos/denote> 4555 - Mirrors: 4556 + GitHub: <https://github.com/protesilaos/denote> 4557 + GitLab: <https://gitlab.com/protesilaos/denote> 4558 + Mailing list: <https://lists.sr.ht/~protesilaos/denote>