denote.info (212014B)
1 This is docvTU8YZ.info, produced by makeinfo version 6.7 from 2 denote.texi. 3 4 Copyright (C) 2022 Free Software Foundation, Inc. 5 6 Permission is granted to copy, distribute and/or modify this 7 document under the terms of the GNU Free Documentation License, 8 Version 1.3 or any later version published by the Free Software 9 Foundation; with no Invariant Sections, with the Front-Cover Texts 10 being “A GNU Manual,” and with the Back-Cover Texts as in (a) 11 below. A copy of the license is included in the section entitled 12 “GNU Free Documentation License.” 13 14 (a) The FSF’s Back-Cover Text is: “You have the freedom to copy and 15 modify this GNU manual.” 16 17 INFO-DIR-SECTION Emacs misc features 18 START-INFO-DIR-ENTRY 19 * Denote: (denote). Simple notes with an efficient file-naming scheme. 20 END-INFO-DIR-ENTRY 21 22 23 File: docvTU8YZ.info, Node: Top, Next: Overview, Up: (dir) 24 25 denote: Simple notes with an efficient file-naming scheme 26 ********************************************************* 27 28 Copyright (C) 2022 Free Software Foundation, Inc. 29 30 Permission is granted to copy, distribute and/or modify this 31 document under the terms of the GNU Free Documentation License, 32 Version 1.3 or any later version published by the Free Software 33 Foundation; with no Invariant Sections, with the Front-Cover Texts 34 being “A GNU Manual,” and with the Back-Cover Texts as in (a) 35 below. A copy of the license is included in the section entitled 36 “GNU Free Documentation License.” 37 38 (a) The FSF’s Back-Cover Text is: “You have the freedom to copy and 39 modify this GNU manual.” 40 41 This manual, written by Protesilaos Stavrou, describes the 42 customization options for the Emacs package called ‘denote’ (or 43 ‘denote.el’), and provides every other piece of information pertinent to 44 it. 45 46 The documentation furnished herein corresponds to stable version 47 1.2.0, released on 2022-12-16. Any reference to a newer feature which 48 does not yet form part of the latest tagged commit, is explicitly marked 49 as such. 50 51 Current development target is 1.3.0-dev. 52 53 • Package name (GNU ELPA): ‘denote’ 54 • Official manual: <https://protesilaos.com/emacs/denote> 55 • Change log: <https://protesilaos.com/emacs/denote-changelog> 56 • Git repo on SourceHut: <https://git.sr.ht/~protesilaos/denote> 57 • Mirrors: 58 • GitHub: <https://github.com/protesilaos/denote> 59 • GitLab: <https://gitlab.com/protesilaos/denote> 60 • Mailing list: <https://lists.sr.ht/~protesilaos/denote> 61 • Backronyms: Denote Everything Neatly; Omit The Excesses. Don’t 62 Ever Note Only The Epiphenomenal. 63 64 If you are viewing the README.org version of this file, please note 65 that the GNU ELPA machinery automatically generates an Info manual out 66 of it. 67 68 * Menu: 69 70 * Overview:: 71 * Points of entry:: 72 * Renaming files:: 73 * The file-naming scheme:: 74 * Front matter:: 75 * Linking notes:: 76 * Fontification in Dired:: 77 * Use Org dynamic blocks:: 78 * Minibuffer histories:: 79 * Extending Denote:: 80 * Installation:: 81 * Sample configuration:: 82 * For developers or advanced users:: 83 * Contributing:: 84 * Things to do:: 85 * Publications about Denote:: 86 * Alternatives to Denote:: 87 * Frequently Asked Questions:: 88 * Acknowledgements:: 89 * GNU Free Documentation License:: 90 * Indices:: 91 92 — The Detailed Node Listing — 93 94 Points of entry 95 96 * Standard note creation:: 97 * Create note using Org capture:: 98 * Maintain separate directory silos for notes:: 99 * Exclude certain directories from all operations:: 100 * Exclude certain keywords from being inferred:: 101 102 Standard note creation 103 104 * The denote-prompts option:: 105 * The denote-templates option:: 106 * Convenience commands for note creation:: 107 * The denote-date-prompt-use-org-read-date option:: 108 * Add or remove keywords interactively:: 109 110 Renaming files 111 112 * Rename a single file:: 113 * Rename multiple files at once:: 114 * Rename a single file based on its front matter:: 115 * Rename multiple files based on their front matter:: 116 117 The file-naming scheme 118 119 * Sluggified title and keywords:: 120 * Features of the file-naming scheme for searching or filtering:: 121 122 Front matter 123 124 * Change the front matter format:: 125 * Regenerate front matter:: 126 127 Linking notes 128 129 * Adding a single link:: 130 * Insert links matching a regexp:: 131 * Insert links, but only those missing from current buffer: Insert links but only those missing from current buffer. 132 * Insert links from marked files in Dired:: 133 * Link to an existing note or create a new one:: 134 * The backlinks' buffer:: 135 * Writing metanotes:: 136 * Visiting linked files via the minibuffer:: 137 * Miscellaneous information about links:: 138 139 Extending Denote 140 141 * Keep a journal or diary:: 142 * Create a note with the region's contents:: 143 * Split an Org subtree into its own note:: 144 * Narrow the list of files in Dired:: 145 * Use dired-virtual-mode for arbitrary file listings:: 146 * Use Embark to collect minibuffer candidates:: 147 * Search file contents:: 148 * Bookmark the directory with the notes:: 149 * Use the citar-denote package for bibliography notes:: 150 * Use the consult-notes package:: 151 * Treat your notes as a project:: 152 * Variants of denote-open-or-create:: 153 * Variants of denote-link-or-create:: 154 155 Installation 156 157 * GNU ELPA package:: 158 * Manual installation:: 159 160 Alternatives to Denote 161 162 * Alternative ideas with Emacs and further reading:: 163 164 Frequently Asked Questions 165 166 * Why develop Denote when PACKAGE already exists?:: 167 * Why not rely exclusively on Org?:: 168 * Why care about Unix tools when you use Emacs?:: 169 * Why many small files instead of few large ones?:: 170 * Does Denote perform well at scale?:: 171 * I add TODOs to my notes; will many files slow down the Org agenda?:: 172 * I want to sort by last modified, why won’t Denote let me?: I want to sort by last modified why won't Denote let me?. 173 * How do you handle the last modified case?:: 174 * Speed up backlinks' buffer creation?:: 175 * Why do I get ``Search failed with status 1'' when I search for backlinks?:: 176 177 Indices 178 179 * Function index:: 180 * Variable index:: 181 * Concept index:: 182 183 184 185 File: docvTU8YZ.info, Node: Overview, Next: Points of entry, Prev: Top, Up: Top 186 187 1 Overview 188 ********** 189 190 Denote aims to be a simple-to-use, focused-in-scope, and effective 191 note-taking tool for Emacs. It is based on the following core design 192 principles: 193 194 Predictability 195 File names must follow a consistent and descriptive naming 196 convention (*note The file-naming scheme::). The file name alone 197 should offer a clear indication of what the contents are, without 198 reference to any other metadatum. This convention is not specific 199 to note-taking, as it is pertinent to any form of file that is part 200 of the user’s long-term storage (*note Renaming files::). 201 202 Composability 203 Be a good Emacs citizen, by integrating with other packages or 204 built-in functionality instead of re-inventing functions such as 205 for filtering or greping. The author of Denote (Protesilaos, aka 206 “Prot”) writes ordinary notes in plain text (‘.txt’), switching on 207 demand to an Org file only when its expanded set of functionality 208 is required for the task at hand (*note Points of entry::). 209 210 Portability 211 Notes are plain text and should remain portable. The way Denote 212 writes file names, the front matter it includes in the note’s 213 header, and the links it establishes must all be adequately usable 214 with standard Unix tools. No need for a database or some 215 specialised software. As Denote develops and this manual is fully 216 fleshed out, there will be concrete examples on how to do the 217 Denote-equivalent on the command-line. 218 219 Flexibility 220 Do not assume the user’s preference for a note-taking methodology. 221 Denote is conceptually similar to the Zettelkasten Method, which 222 you can learn more about in this detailed introduction: 223 <https://zettelkasten.de/introduction/>. Notes are atomic (one 224 file per note) and have a unique identifier. However, Denote does 225 not enforce a particular methodology for knowledge management, such 226 as a restricted vocabulary or mutually exclusive sets of keywords. 227 Denote also does not check if the user writes thematically atomic 228 notes. It is up to the user to apply the requisite rigor and/or 229 creativity in pursuit of their preferred workflow (*note Writing 230 metanotes::). 231 232 Hackability 233 Denote’s code base consists of small and reusable functions. They 234 all have documentation strings. The idea is to make it easier for 235 users of varying levels of expertise to understand what is going on 236 and make surgical interventions where necessary (e.g. to tweak 237 some formatting). In this manual, we provide concrete examples on 238 such user-level configurations (*note Keep a journal or diary::). 239 240 Now the important part... “Denote” is the familiar word, though it 241 also is a play on the “note” concept. Plus, we can come up with 242 acronyms, recursive or otherwise, of increasingly dubious utility like: 243 244 • Don’t Ever Note Only The Epiphenomenal 245 • Denote Everything Neatly; Omit The Excesses 246 247 But we’ll let you get back to work. Don’t Eschew or Neglect your 248 Obligations, Tasks, and Engagements. 249 250 251 File: docvTU8YZ.info, Node: Points of entry, Next: Renaming files, Prev: Overview, Up: Top 252 253 2 Points of entry 254 ***************** 255 256 There are five ways to write a note with Denote: invoke the ‘denote’, 257 ‘denote-type’, ‘denote-date’, ‘denote-subdirectory’, ‘denote-template’ 258 commands, or leverage the ‘org-capture-templates’ by setting up a 259 template which calls the function ‘denote-org-capture’. We explain all 260 of those in the subsequent sections. 261 262 * Menu: 263 264 * Standard note creation:: 265 * Create note using Org capture:: 266 * Maintain separate directory silos for notes:: 267 * Exclude certain directories from all operations:: 268 * Exclude certain keywords from being inferred:: 269 270 271 File: docvTU8YZ.info, Node: Standard note creation, Next: Create note using Org capture, Up: Points of entry 272 273 2.1 Standard note creation 274 ========================== 275 276 The ‘denote’ command will prompt for a title. If a region is active, 277 the text of the region becomes the default at the minibuffer prompt 278 (meaning that typing ‘RET’ without any input will use the default 279 value). Once the title is supplied, the ‘denote’ command will then ask 280 for keywords. The resulting note will have a file name as already 281 explained: *note The file naming scheme: The file-naming scheme. 282 283 The file type of the new note is determined by the user option 284 ‘denote-file-type’ (*note Front matter::). 285 286 The keywords’ prompt supports minibuffer completion. Available 287 candidates are those defined in the user option ‘denote-known-keywords’. 288 More candidates can be inferred from the names of existing notes, by 289 setting ‘denote-infer-keywords’ to non-nil (which is the case by 290 default). 291 292 Multiple keywords can be inserted by separating them with a comma (or 293 whatever the value of the ‘crm-separator’ is—which should be a comma). 294 When the user option ‘denote-sort-keywords’ is non-nil (the default), 295 keywords are sorted alphabetically (technically, the sorting is done 296 with ‘string-lessp’). 297 298 The interactive behaviour of the ‘denote’ command is influenced by 299 the user option ‘denote-prompts’ (*note The denote-prompts option: The 300 denote-prompts option.). 301 302 The ‘denote’ command can also be called from Lisp. Read its doc 303 string for the technicalities. 304 305 In the interest of discoverability, ‘denote’ is also available under 306 the alias ‘denote-create-note’. 307 308 * Menu: 309 310 * The denote-prompts option:: 311 * The denote-templates option:: 312 * Convenience commands for note creation:: 313 * The denote-date-prompt-use-org-read-date option:: 314 * Add or remove keywords interactively:: 315 316 317 File: docvTU8YZ.info, Node: The denote-prompts option, Next: The denote-templates option, Up: Standard note creation 318 319 2.1.1 The ‘denote-prompts’ option 320 --------------------------------- 321 322 The user option ‘denote-prompts’ determines how the ‘denote’ command 323 will behave interactively (*note Standard note creation::). 324 325 The value is a list of symbols, which includes any of the following: 326 327 • ‘title’: Prompt for the title of the new note. 328 329 • ‘keywords’: Prompts with completion for the keywords of the new 330 note. Available candidates are those specified in the user option 331 ‘denote-known-keywords’. If the user option 332 ‘denote-infer-keywords’ is non-nil, keywords in existing note file 333 names are included in the list of candidates. The ‘keywords’ 334 prompt uses ‘completing-read-multiple’, meaning that it can accept 335 multiple keywords separated by a comma (or whatever the value of 336 ‘crm-sepator’ is). 337 338 • ‘file-type’: Prompts with completion for the file type of the new 339 note. Available candidates are those specified in the user option 340 ‘denote-file-type’. Without this prompt, ‘denote’ uses the value 341 of ‘denote-file-type’. 342 343 • ‘subdirectory’: Prompts with completion for a subdirectory in which 344 to create the note. Available candidates are the value of the user 345 option ‘denote-directory’ and all of its subdirectories. Any 346 subdirectory must already exist: Denote will not create it. 347 348 • ‘date’: Prompts for the date of the new note. It will expect an 349 input like 2022-06-16 or a date plus time: 2022-06-16 14:30. 350 Without the ‘date’ prompt, the ‘denote’ command uses the 351 ‘current-time’. 352 353 *note The denote-date-prompt-use-org-read-date option: The 354 denote-date-prompt-use-org-read-date option. 355 356 • ‘template’: Prompts for a KEY among the ‘denote-templates’. The 357 value of that KEY is used to populate the new note with content, 358 which is added after the front matter (*note The denote-templates 359 option: The denote-templates option.). 360 361 The prompts occur in the given order. 362 363 If the value of this user option is nil, no prompts are used. The 364 resulting file name will consist of an identifier (i.e. the date and 365 time) and a supported file type extension (per ‘denote-file-type’). 366 367 Recall that Denote’s standard file-naming scheme is defined as 368 follows (*note The file-naming scheme::): 369 370 DATE--TITLE__KEYWORDS.EXT 371 372 If either or both of the ‘title’ and ‘keywords’ prompts are not 373 included in the value of this variable, file names will be any of those 374 permutations: 375 376 DATE.EXT 377 DATE--TITLE.EXT 378 DATE__KEYWORDS.EXT 379 380 When in doubt, always include the ‘title’ and ‘keywords’ prompts. 381 382 Finally, this user option only affects the interactive use of the 383 ‘denote’ command (advanced users can call it from Lisp). For ad-hoc 384 interactive actions that do not change the default behaviour of the 385 ‘denote’ command, users can invoke these convenience commands: 386 ‘denote-type’, ‘denote-subdirectory’, ‘denote-date’. They are described 387 in the subsequent section (*note Convenience commands for note 388 creation::). 389 390 391 File: docvTU8YZ.info, Node: The denote-templates option, Next: Convenience commands for note creation, Prev: The denote-prompts option, Up: Standard note creation 392 393 2.1.2 The ‘denote-templates’ option 394 ----------------------------------- 395 396 The user option ‘denote-templates’ is an alist of content templates for 397 new notes. A template is arbitrary text that Denote will add to a newly 398 created note right below the front matter. 399 400 Templates are expressed as a ‘(KEY . STRING)’ association. 401 402 • The ‘KEY’ is the name which identifies the template. It is an 403 arbitrary symbol, such as ‘report’, ‘memo’, ‘statement’. 404 405 • The ‘STRING’ is ordinary text that Denote will insert as-is. It 406 can contain newline characters to add spacing. Below we show some 407 concrete examples. 408 409 The user can choose a template either by invoking the command 410 ‘denote-template’ or by changing the user option ‘denote-prompts’ to 411 always prompt for a template when calling the ‘denote’ command. 412 413 *note The denote-prompts option: The denote-prompts option. 414 415 *note Convenience commands for note creation::. 416 417 Templates can be written directly as one large string. For example 418 (the ‘\n’ character is read as a newline): 419 420 (setq denote-templates 421 '((report . "* Some heading\n\n* Another heading") 422 (memo . "* Some heading 423 424 * Another heading 425 426 "))) 427 428 Long strings may be easier to type but interpret indentation 429 literally. Also, they do not scale well. A better way is to use some 430 Elisp code to construct the string. This would typically be the 431 ‘concat’ function, which joins multiple strings into one. The following 432 is the same as the previous example: 433 434 (setq denote-templates 435 `((report . "* Some heading\n\n* Another heading") 436 (memo . ,(concat "* Some heading" 437 "\n\n" 438 "* Another heading" 439 "\n\n")))) 440 441 Notice that to evaluate a function inside of an alist we use the 442 backtick to quote the alist (NOT the straight quote) and then prepend a 443 comma to the expression that should be evaluated. The ‘concat’ form 444 here is not sensitive to indentation, so it is easier to adjust for 445 legibility. 446 447 DEV NOTE: We do not provide more examples at this point, though feel 448 welcome to ask for help if the information provided herein is not 449 sufficient. We shall expand the manual accordingly. 450 451 452 File: docvTU8YZ.info, Node: Convenience commands for note creation, Next: The denote-date-prompt-use-org-read-date option, Prev: The denote-templates option, Up: Standard note creation 453 454 2.1.3 Convenience commands for note creation 455 -------------------------------------------- 456 457 Sometimes the user needs to create a note that has different 458 requirements from those of ‘denote’ (*note Standard note creation::). 459 While this can be achieved globally by changing the ‘denote-prompts’ 460 user option, there are cases where an ad-hoc method is the appropriate 461 one (*note The denote-prompts option: The denote-prompts option.). 462 463 To this end, Denote provides the following convenience interactive 464 commands for note creation: 465 466 Create note by specifying file type 467 The ‘denote-type’ command creates a note while prompting for a file 468 type. 469 470 This is the equivalent to calling ‘denote’ when ‘denote-prompts’ is 471 set to ‘'(file-type title keywords)’. In practical terms, this 472 lets you produce, say, a note in Markdown even though you normally 473 write in Org (*note Standard note creation::). 474 475 The ‘denote-create-note-using-type’ is an alias of ‘denote-type’. 476 477 Create note using a date 478 Normally, Denote reads the current date and time to construct the 479 unique identifier of a newly created note (*note Standard note 480 creation::). Sometimes, however, the user needs to set an explicit 481 date+time value. 482 483 This is where the ‘denote-date’ command comes in. It creates a 484 note while prompting for a date. The date can be in YEAR-MONTH-DAY 485 notation like ‘2022-06-30’ or that plus the time: ‘2022-06-16 486 14:30’. 487 488 *note The denote-date-prompt-use-org-read-date option: The 489 denote-date-prompt-use-org-read-date option. 490 491 This is the equivalent to calling ‘denote’ when ‘denote-prompts’ is 492 set to ‘'(date title keywords)’. 493 494 The ‘denote-create-note-using-date’ is an alias of ‘denote-date’. 495 496 Create note in a specific directory 497 The ‘denote-subdirectory’ command creates a note while prompting 498 for a subdirectory. Available candidates include the value of the 499 variable ‘denote-directory’ and any subdirectory thereof (Denote 500 does not create subdirectories). 501 502 This is equivalent to calling ‘denote’ when ‘denote-prompts’ is set 503 to ‘'(subdirectory title keywords)’. 504 505 The ‘denote-create-note-in-subdirectory’ is a more descriptive 506 alias of ‘denote-subdirectory’. 507 508 Create note and add a template 509 The ‘denote-template’ command creates a new note and inserts the 510 specified template below the front matter (*note The 511 denote-templates option: The denote-templates option.). Available 512 candidates for templates are specified in the user option 513 ‘denote-templates’. 514 515 This is equivalent to calling ‘denote’ when ‘denote-prompts’ is set 516 to ‘'(template title keywords)’. 517 518 The ‘denote-create-note-with-template’ is an alias of the command 519 ‘denote-template’, meant to help with discoverability. 520 521 1. Write your own convenience commands 522 523 The convenience commands we provide only cover some basic use-cases 524 (*note Convenience commands for note creation::). The user may 525 require combinations that are not covered, such as to prompt for a 526 template and for a subdirectory, instead of only one of the two. 527 To this end, we show how to follow the code we use in Denote to 528 write your own variants of those commands. 529 530 First let’s take a look at the definition of one of those commands. 531 They all look the same, but we use ‘denote-subdirectory’ for this 532 example: 533 534 (defun denote-subdirectory () 535 "Create note while prompting for a subdirectory. 536 537 Available candidates include the value of the variable 538 `denote-directory' and any subdirectory thereof. 539 540 This is equivalent to calling `denote' when `denote-prompts' is 541 set to '(subdirectory title keywords)." 542 (declare (interactive-only t)) 543 (interactive) 544 (let ((denote-prompts '(subdirectory title keywords))) 545 (call-interactively #'denote))) 546 547 The hyphenated word after ‘defun’ is the name of the function. It 548 has to be unique. Then we have the documentation string (or “doc 549 string”) which is for the user’s convenience. 550 551 This function is ‘interactive’, meaning that it can be called via 552 ‘M-x’ or be assigned to a key binding. Then we have the local 553 binding of the ‘denote-prompts’ to the desired combination (“local” 554 means specific to this function without affecting other contexts). 555 Lastly, it calls the standard ‘denote’ command interactively, so it 556 uses all the prompts in their specified order. 557 558 Now let’s say we want to have a command that (i) asks for a 559 template and (ii) for a subdirectory (*note The denote-templates 560 option: The denote-templates option.). All we need to do is tweak 561 the ‘let’ bound value of ‘denote-prompts’ and give our command a 562 unique name: 563 564 ;; Like `denote-subdirectory' but also ask for a template 565 (defun denote-subdirectory-with-template () 566 "Create note while also prompting for a template and subdirectory. 567 568 This is equivalent to calling `denote' when `denote-prompts' is 569 set to '(template subdirectory title keywords)." 570 (declare (interactive-only t)) 571 (interactive) 572 (let ((denote-prompts '(template subdirectory title keywords))) 573 (call-interactively #'denote))) 574 575 The tweaks to ‘denote-prompts’ determine how the command will 576 behave (*note The denote-prompts option: The denote-prompts 577 option.). Use this paradigm to write your own variants which you 578 can then assign to keys or invoke with ‘M-x’. 579 580 581 File: docvTU8YZ.info, Node: The denote-date-prompt-use-org-read-date option, Next: Add or remove keywords interactively, Prev: Convenience commands for note creation, Up: Standard note creation 582 583 2.1.4 The ‘denote-date-prompt-use-org-read-date’ option 584 ------------------------------------------------------- 585 586 By default, Denote uses its own simple prompt for date or date+time 587 input (*note The denote-prompts option: The denote-prompts option.). 588 This is done when the ‘denote-prompts’ option includes a ‘date’ symbol 589 and/or when the user invokes the ‘denote-date’ command. 590 591 Users who want to benefit from the more advanced date selection 592 method that is common in interactions with Org mode, can set the user 593 option ‘denote-date-prompt-use-org-read-date’ to a non-nil value. 594 595 596 File: docvTU8YZ.info, Node: Add or remove keywords interactively, Prev: The denote-date-prompt-use-org-read-date option, Up: Standard note creation 597 598 2.1.5 Add or remove keywords interactively 599 ------------------------------------------ 600 601 The commands ‘denote-keywords-add’ and ‘denote-keywords-remove’ 602 streamline the process of interactively updating a file’s keywords in 603 the front matter and renaming it accordingly. 604 605 The ‘denote-keywords-add’ asks for keywords using the familiar 606 minibuffer prompt (*note Standard note creation::). It then renames the 607 file (*note Rename a single file based on its front matter::). 608 609 Similarly, the ‘denote-keywords-remove’ removes one or more keywords 610 from the list of existing keywords and then renames the file 611 accordingly. 612 613 614 File: docvTU8YZ.info, Node: Create note using Org capture, Next: Maintain separate directory silos for notes, Prev: Standard note creation, Up: Points of entry 615 616 2.2 Create note using Org capture 617 ================================= 618 619 For integration with ‘org-capture’, the user must first add the relevant 620 template. Such as: 621 622 (with-eval-after-load 'org-capture 623 (add-to-list 'org-capture-templates 624 '("n" "New note (with Denote)" plain 625 (file denote-last-path) 626 #'denote-org-capture 627 :no-save t 628 :immediate-finish nil 629 :kill-buffer t 630 :jump-to-captured t))) 631 632 [ In the future, we might develop Denote in ways which do not require 633 such manual intervention. More user feedback is required to identify 634 the relevant workflows. ] 635 636 Once the template is added, it is accessed from the specified key. 637 If, for instance, ‘org-capture’ is bound to ‘C-c c’, then the note 638 creation is initiated with ‘C-c c n’, per the above snippet. After 639 that, the process is the same as with invoking ‘denote’ directly, 640 namely: a prompt for a title followed by a prompt for keywords (*note 641 Standard note creation::). 642 643 Users may prefer to leverage ‘org-capture’ in order to extend file 644 creation with the specifiers described in the ‘org-capture-templates’ 645 documentation (such as to capture the active region and/or create a 646 hyperlink pointing to the given context). 647 648 IMPORTANT. Due to the particular file-naming scheme of Denote, which 649 is derived dynamically, such specifiers or other arbitrary text cannot 650 be written directly in the template. Instead, they have to be assigned 651 to the user option ‘denote-org-capture-specifiers’, which is interpreted 652 by the function ‘denote-org-capture’. Example with our default value: 653 654 (setq denote-org-capture-specifiers "%l\n%i\n%?") 655 656 Note that ‘denote-org-capture’ ignores the ‘denote-file-type’: it 657 always sets the Org file extension for the created note to ensure that 658 the capture process works as intended, especially for the desired output 659 of the ‘denote-org-capture-specifiers’. 660 661 662 File: docvTU8YZ.info, Node: Maintain separate directory silos for notes, Next: Exclude certain directories from all operations, Prev: Create note using Org capture, Up: Points of entry 663 664 2.3 Maintain separate directory silos for notes 665 =============================================== 666 667 The user option ‘denote-directory’ accepts a value that represents the 668 path to a directory, such as ‘~/Documents/notes’. Normally, the user 669 will have one place where they store all their notes, in which case this 670 arrangement shall suffice. 671 672 There is, however, the possibility to maintain separate directories 673 of notes. By “separate”, we mean that they do not communicate with each 674 other: no linking between them, no common keywords, nothing. Think of 675 the scenario where one set of notes is for private use and another is 676 for an employer. We call these separate directories “silos”. 677 678 To create silos, the user must specify a local variable at the root 679 of the desired directory. This is done by creating a ‘.dir-locals.el’ 680 file, with the following contents: 681 682 ;;; Directory Local Variables. For more information evaluate: 683 ;;; 684 ;;; (info "(emacs) Directory Variables") 685 686 ((nil . ((denote-directory . default-directory)))) 687 688 When inside the directory that contains this ‘.dir-locals.el’ file, 689 all Denote commands/functions for note creation, linking, the inference 690 of available keywords, et cetera will use the silo as their point of 691 reference. They will not read the global value of ‘denote-directory’. 692 The global value of ‘denote-directory’ is read everywhere else except 693 the silos. 694 695 In concrete terms, this is a representation of the directory 696 structures (notice the ‘.dir-locals.el’ file is needed only for the 697 silos): 698 699 ;; This is the global value of 'denote-directory' (no need for a .dir-locals.el) 700 ~/Documents/notes 701 |-- 20210303T120534--this-is-a-test__journal_philosophy.txt 702 |-- 20220303T120534--another-sample__journal_testing.md 703 `-- 20220620T181255--the-third-test__keyword.org 704 705 ;; A silo with notes for the employer 706 ~/different/path/to/notes-for-employer 707 |-- .dir-locals.el 708 |-- 20210303T120534--this-is-a-test__conference.txt 709 |-- 20220303T120534--another-sample__meeting.md 710 `-- 20220620T181255--the-third-test__keyword.org 711 712 ;; Another silo with notes for my volunteering 713 ~/different/path/to/notes-for-volunteering 714 |-- .dir-locals.el 715 |-- 20210303T120534--this-is-a-test__activism.txt 716 |-- 20220303T120534--another-sample__teambuilding.md 717 `-- 20220620T181255--the-third-test__keyword.org 718 719 It is possible to configure other user options of Denote to have a 720 silo-specific value. For example, this one changes the 721 ‘denote-known-keywords’ only for this particular silo: 722 723 ;;; Directory Local Variables. For more information evaluate: 724 ;;; 725 ;;; (info "(emacs) Directory Variables") 726 727 ((nil . ((denote-directory . default-directory) 728 (denote-known-keywords . ("food" "drink"))))) 729 730 This one is like the above, but also disables 731 ‘denote-infer-keywords’: 732 733 ;;; Directory Local Variables. For more information evaluate: 734 ;;; 735 ;;; (info "(emacs) Directory Variables") 736 737 ((nil . ((denote-directory . default-directory) 738 (denote-known-keywords . ("food" "drink")) 739 (denote-infer-keywords . nil)))) 740 741 To expand the list of local variables to, say, cover specific major 742 modes, we can do something like this: 743 744 ;;; Directory Local Variables. For more information evaluate: 745 ;;; 746 ;;; (info "(emacs) Directory Variables") 747 748 ((nil . ((denote-directory . default-directory) 749 (denote-known-keywords . ("food" "drink")) 750 (denote-infer-keywords . nil))) 751 (org-mode . ((org-hide-emphasis-markers . t) 752 (org-hide-macro-markers . t) 753 (org-hide-leading-stars . t)))) 754 755 As not all user options have a “safe” local value, Emacs will ask the 756 user to confirm their choice and to store it in the Custom code snippet 757 that is normally appended to init file (or added to the file specified 758 by the user option ‘custom-file’). 759 760 Finally, it is possible to have a ‘.dir-locals.el’ for subdirectories 761 of any ‘denote-directory’. Perhaps to specify a different set of known 762 keywords, while not making the subdirectory a silo in its own right. We 763 shall not expand on such an example, as we trust the user to experiment 764 with the best setup for their workflow. 765 766 Feel welcome to ask for help if the information provided herein is 767 not sufficient. The manual shall be expanded accordingly. 768 769 770 File: docvTU8YZ.info, Node: Exclude certain directories from all operations, Next: Exclude certain keywords from being inferred, Prev: Maintain separate directory silos for notes, Up: Points of entry 771 772 2.4 Exclude certain directories from all operations 773 =================================================== 774 775 The user option ‘denote-excluded-directories-regexp’ instructs all 776 Denote functions that read or check file/directory names to omit 777 directories that match the given regular expression. The regexp needs 778 to match only the name of the directory, not its full path. 779 780 Affected operations include file prompts and functions that return 781 the available files in the value of the user option ‘denote-directory’ 782 (*note Maintain separate directory silos for notes::). 783 784 File prompts are used by several commands, such as ‘denote-link’ and 785 ‘denote-subdirectory’. 786 787 Functions that check for files include ‘denote-directory-files’ and 788 ‘denote-directory-subdirectories’. 789 790 The match is performed with ‘string-match-p’. 791 792 *note For developers or advanced users::. 793 794 795 File: docvTU8YZ.info, Node: Exclude certain keywords from being inferred, Prev: Exclude certain directories from all operations, Up: Points of entry 796 797 2.5 Exclude certain keywords from being inferred 798 ================================================ 799 800 The user option ‘denote-excluded-keywords-regexp’ omits keywords that 801 match a regular expression from the list of inferred keywords. 802 803 Keywords are inferred from file names and provided at relevant 804 prompts as completion candidates when the user option 805 ‘denote-infer-keywords’ is non-nil. 806 807 The match is performed with ‘string-match-p’. 808 809 810 File: docvTU8YZ.info, Node: Renaming files, Next: The file-naming scheme, Prev: Points of entry, Up: Top 811 812 3 Renaming files 813 **************** 814 815 Denote provides commands to rename files and update their front matter 816 where relevant. For Denote to work, only the file name needs to be in 817 order, by following our naming conventions (*note The file-naming 818 scheme::). The linking mechanism, in particular, needs just the 819 identifier in the file name (*note Linking notes::). 820 821 We write front matter in notes for the user’s convenience and for 822 other tools to make use of that information (e.g. Org’s export 823 mechanism). The renaming mechanism takes care to keep this data in sync 824 with the file name, when the user performs a change. 825 826 Renaming is useful for managing existing files created with Denote, 827 but also for converting older text files to Denote notes. 828 829 Lastly, Denote’s file-naming scheme is not specific to notes or text 830 files: it is useful for all sorts of items, such as multimedia and PDFs 831 that form part of the user’s longer-term storage. While Denote does not 832 manage such files (e.g. doesn’t create links to them), it already has 833 all the mechanisms to facilitate the task of renaming them. 834 835 * Menu: 836 837 * Rename a single file:: 838 * Rename multiple files at once:: 839 * Rename a single file based on its front matter:: 840 * Rename multiple files based on their front matter:: 841 842 843 File: docvTU8YZ.info, Node: Rename a single file, Next: Rename multiple files at once, Up: Renaming files 844 845 3.1 Rename a single file 846 ======================== 847 848 The ‘denote-rename-file’ command renames a file and updates existing 849 front matter if appropriate. 850 851 If in Dired, the ‘FILE’ to be renamed is the one at point, else the 852 command prompts with minibuffer completion for a target file. 853 854 If ‘FILE’ has a Denote-compliant identifier, retain it while updating 855 the ‘TITLE’ and ‘KEYWORDS’ fields of the file name. Else create an 856 identifier based on the following conditions: 857 858 • If ‘FILE’ does not have an identifier and optional ‘DATE’ is 859 non-nil (such as with a prefix argument), invoke the function 860 ‘denote-prompt-for-date-return-id’. It prompts for a date and uses 861 it to derive the identifier. 862 863 • If ‘FILE’ does not have an identifier and optional ‘DATE’ is nil 864 (this is the case without a prefix argument), use the file 865 attributes to determine the last modified date and format it as an 866 identifier. 867 868 • As a fallback, derive an identifier from the current time. 869 870 The default ‘TITLE’ is retrieved from a line starting with a title 871 field in the file’s contents, depending on the given file type (*note 872 Front matter::). Else, the file name is used as a default value at the 873 minibuffer prompt. 874 875 As a final step after the ‘FILE’, ‘TITLE’, and ‘KEYWORDS’ prompts, 876 ask for confirmation, showing the difference between old and new file 877 names. For example: 878 879 Rename sample.txt to 20220612T052900--my-sample-title__testing.txt? (y or n) 880 881 The file type extension (e.g. ‘.txt’) is read from the underlying 882 file and is preserved through the renaming process. Files that have no 883 extension are simply left without one. 884 885 Renaming only occurs relative to the current directory. Files are 886 not moved between directories. 887 888 If the ‘FILE’ has Denote-style front matter for the ‘TITLE’ and 889 ‘KEYWORDS’, this command asks to rewrite their values in order to 890 reflect the new input (this step always requires confirmation and the 891 underlying buffer is not saved, so consider invoking 892 ‘diff-buffer-with-file’ to double-check the effect). The rewrite of the 893 ‘FILE’ and ‘KEYWORDS’ in the front matter should not affect the rest of 894 the block. 895 896 If the file doesn’t have front matter but is among the supported file 897 types (per ‘denote-file-type’), the ‘denote-rename-file’ command adds 898 front matter at the top of it and leaves the buffer unsaved for further 899 inspection. 900 901 This command is intended to (i) rename existing Denote notes while 902 updating their title and keywords in the front matter, (ii) convert 903 existing supported file types to Denote notes, and (ii) rename non-note 904 files (e.g. PDF) that can benefit from Denote’s file-naming scheme. 905 The latter is a convenience we provide, since we already have all the 906 requisite mechanisms in place (though Denote does not—and will 907 not—manage such files). 908 909 910 File: docvTU8YZ.info, Node: Rename multiple files at once, Next: Rename a single file based on its front matter, Prev: Rename a single file, Up: Renaming files 911 912 3.2 Rename multiple files at once 913 ================================= 914 915 The ‘denote-dired-rename-marked-files’ command renames marked files in 916 Dired to conform with our file-naming scheme. The operation does the 917 following: 918 919 • the file’s existing file name is retained and becomes the ‘TITLE’ 920 field, per Denote’s file-naming scheme; 921 922 • the ‘TITLE’ is sluggified and downcased, per our conventions; 923 924 • an identifier is prepended to the ‘TITLE’; 925 926 • the file’s extension is retained; 927 928 • a prompt is asked once for the ‘KEYWORDS’ field and the input is 929 applied to all file names; 930 931 • if the file is recognized as a Denote note, this command adds or 932 rewrites front matter to include the new keywords. A confirmation 933 to carry out this step is performed once at the outset. Note that 934 the affected buffers are not saved. The user can thus check them 935 to confirm that the new front matter does not cause any problems 936 (e.g. with the command ‘diff-buffer-with-file’). Multiple buffers 937 can be saved with ‘save-some-buffers’ (read its doc string). The 938 addition of front matter takes place only if the given file has the 939 appropriate file type extension (per the user option 940 ‘denote-file-type’). 941 942 943 File: docvTU8YZ.info, Node: Rename a single file based on its front matter, Next: Rename multiple files based on their front matter, Prev: Rename multiple files at once, Up: Renaming files 944 945 3.3 Rename a single file based on its front matter 946 ================================================== 947 948 In the previous section, we covered the more general mechanism of the 949 command ‘denote-rename-file’ (*note Rename a single file::). There is 950 also a way to have the same outcome by making Denote read the data in 951 the current file’s front matter and use it to construct/update the file 952 name. The command for this is ‘denote-rename-file-using-front-matter’. 953 It is only relevant for files that (i) are among the supported file 954 types, per ‘denote-file-type’, and (ii) have the requisite front matter 955 in place. 956 957 Suppose you have an ‘.org’ file with this front matter (*note Front 958 matter::): 959 960 #+title: My sample note file 961 #+date: [2022-08-05 Fri 13:10] 962 #+filetags: :testing: 963 #+identifier: 20220805T131044 964 965 Its file name reflects this information: 966 967 20220805T131044--my-sample-note-file__testing.org 968 969 You want to change its title and keywords manually, so you modify it 970 thus: 971 972 #+title: My modified sample note file 973 #+date: [2022-08-05 Fri 13:10] 974 #+filetags: :testing:denote:emacs: 975 #+identifier: 20220805T131044 976 977 The file name still shows the old title and keywords. So after 978 saving the buffer, you invoke ‘denote-rename-file-using-front-matter’ 979 and it updates the file name to: 980 981 20220805T131044--my-modified-sample-note-file__testing_denote_emacs.org 982 983 The renaming is subject to a “yes or no” prompt that shows the old 984 and new names, just so the user is certain about the change. 985 986 If called interactively with a prefix argument ‘C-u’ or from Lisp 987 with a non-nil ‘AUTO-CONFIRM’ argument, this “yes or no” prompt is 988 skipped. 989 990 The identifier of the file, if any, is never modified even if it is 991 edited in the front matter: Denote considers the file name to be the 992 source of truth in this case, to avoid potential breakage with typos and 993 the like. 994 995 996 File: docvTU8YZ.info, Node: Rename multiple files based on their front matter, Prev: Rename a single file based on its front matter, Up: Renaming files 997 998 3.4 Rename multiple files based on their front matter 999 ===================================================== 1000 1001 As already noted, Denote can rename a file based on the data in its 1002 front matter (*note Rename a single file based on its front matter::). 1003 The command ‘denote-dired-rename-marked-files-using-front-matter’ 1004 extends this principle to a batch operation which applies to all marked 1005 files in Dired. 1006 1007 Marked files must count as notes for the purposes of Denote, which 1008 means that they at least have an identifier in their file name and use a 1009 supported file type, per ‘denote-file-type’. Files that do not meet 1010 this criterion are ignored. 1011 1012 The operation does the following: 1013 1014 • the title in the front matter becomes the ‘TITLE’ component of the 1015 file name (*note The file-naming scheme::); 1016 1017 • the keywords in the front matter are used for the ‘KEYWORDS’ 1018 component of the file name and are processed accordingly, if 1019 needed; 1020 1021 • the identifier remains unchanged in the file name even if it is 1022 modified in the front matter (this is done to avoid breakage caused 1023 by typos and the like). 1024 1025 NOTE that files must be saved, because Denote reads from the 1026 underlying file, not a modified buffer (this is done to avoid potential 1027 mistakes). The return value of a modified buffer is the one prior to 1028 the modification, i.e. the one already written on disk. 1029 1030 This command is useful for synchronizing multiple file names with 1031 their respective front matter. 1032 1033 1034 File: docvTU8YZ.info, Node: The file-naming scheme, Next: Front matter, Prev: Renaming files, Up: Top 1035 1036 4 The file-naming scheme 1037 ************************ 1038 1039 Notes are stored the ‘denote-directory’. The default path is 1040 ‘~/Documents/notes’. The ‘denote-directory’ can be a flat listing, 1041 meaning that it has no subdirectories, or it can be a directory tree. 1042 Either way, Denote takes care to only consider “notes” as valid 1043 candidates in the relevant operations and will omit other files or 1044 directories. 1045 1046 Every note produced by Denote follows this pattern (*note Points of 1047 entry::): 1048 1049 DATE--TITLE__KEYWORDS.EXTENSION 1050 1051 The ‘DATE’ field represents the date in year-month-day format 1052 followed by the capital letter ‘T’ (for “time”) and the current time in 1053 hour-minute-second notation. The presentation is compact: 1054 ‘20220531T091625’. The ‘DATE’ serves as the unique identifier of each 1055 note. 1056 1057 The ‘TITLE’ field is the title of the note, as provided by the user. 1058 It automatically gets downcased and hyphenated. An entry about 1059 “Economics in the Euro Area” produces an ‘economics-in-the-euro-area’ 1060 string for the ‘TITLE’ of the file name. 1061 1062 The ‘KEYWORDS’ field consists of one or more entries demarcated by an 1063 underscore (the separator is inserted automatically). Each keyword is a 1064 string provided by the user at the relevant prompt which broadly 1065 describes the contents of the entry. Keywords that need to be more than 1066 one-word-long must be written with hyphens: any other character, such as 1067 spaces or the plus sign is automatically converted into a hyphen. So 1068 when ‘emacs_library’ appears in a file name, it is interpreted as two 1069 distinct keywords, whereas ‘emacs-library’ is one keyword. This is 1070 reflected in how the keywords are recorded in the note (*note Front 1071 matter::). While Denote supports multi-word keywords by default, the 1072 user option ‘denote-allow-multi-word-keywords’ can be set to nil to 1073 forcibly join all words into one, meaning that an input of ‘word1 word2’ 1074 will be written as ‘word1word2’. 1075 1076 The ‘EXTENSION’ is the file type. By default, it is ‘.org’ 1077 (‘org-mode’) though the user option ‘denote-file-type’ provides support 1078 for Markdown with YAML or TOML variants (‘.md’ which runs 1079 ‘markdown-mode’) and plain text (‘.txt’ via ‘text-mode’). Consult its 1080 doc string for the minutiae. While files end in the ‘.org’ extension by 1081 default, the Denote code base does not actually depend on org.el and/or 1082 its accoutrements. 1083 1084 Examples: 1085 1086 20220610T043241--initial-thoughts-on-the-zettelkasten-method__notetaking.org 1087 20220610T062201--define-custom-org-hyperlink-type__denote_emacs_package.md 1088 20220610T162327--on-hierarchy-and-taxis__notetaking_philosophy.txt 1089 1090 The different field separators, namely ‘--’ and ‘__’ introduce an 1091 efficient way to anchor searches (such as with Emacs commands like 1092 ‘isearch’ or from the command-line with ‘find’ and related). A query 1093 for ‘_word’ always matches a keyword, while a regexp in the form of, 1094 say, ‘"\\([0-9T]+?\\)--\\(.*?\\)_"’ captures the date in group ‘\1’ and 1095 the title in ‘\2’ (test any regular expression in the current buffer by 1096 invoking ‘M-x re-builder’). 1097 1098 *note Features of the file-naming scheme for searching or 1099 filtering::. 1100 1101 While Denote is an Emacs package, notes should work long-term and not 1102 depend on the functionality of a specific program. The file-naming 1103 scheme we apply guarantees that a listing is readable in a variety of 1104 contexts. 1105 1106 * Menu: 1107 1108 * Sluggified title and keywords:: 1109 * Features of the file-naming scheme for searching or filtering:: 1110 1111 1112 File: docvTU8YZ.info, Node: Sluggified title and keywords, Next: Features of the file-naming scheme for searching or filtering, Up: The file-naming scheme 1113 1114 4.1 Sluggified title and keywords 1115 ================================= 1116 1117 Denote has to be highly opinionated about which characters can be used 1118 in file names and the file’s front matter in order to enforce its 1119 file-naming scheme. The private variable ‘denote--punctuation-regexp’ 1120 holds the relevant value. In simple terms: 1121 1122 • What we count as “illegal characters” are converted into hyphens. 1123 1124 • Input for a file title is hyphenated and downcased. The original 1125 value is preserved in the note’s contents (*note Front matter::). 1126 1127 • Keywords should not have spaces or other delimiters. If they do, 1128 they are converted into hyphens. Keywords are always downcased. 1129 1130 1131 File: docvTU8YZ.info, Node: Features of the file-naming scheme for searching or filtering, Prev: Sluggified title and keywords, Up: The file-naming scheme 1132 1133 4.2 Features of the file-naming scheme for searching or filtering 1134 ================================================================= 1135 1136 File names have three fields and two sets of field delimiters between 1137 them: 1138 1139 DATE--TITLE__KEYWORDS.EXTENSION 1140 1141 The first field delimiter is the double hyphen, while the second is 1142 the double underscore. These practically serve as anchors for easier 1143 searching. Consider this example: 1144 1145 20220621T062327--introduction-to-denote__denote_emacs.txt 1146 1147 You will notice that there are two matches for the word ‘denote’: one 1148 in the title field and another in the keywords’ field. Because of the 1149 distinct field delimiters, if we search for ‘-denote’ we only match the 1150 first instance while ‘_denote’ targets the second one. When sorting 1151 through your notes, this kind of specificity is invaluable—and you get 1152 it for free from the file names alone! 1153 1154 Users can get a lot of value out of this simple arrangement, even if 1155 they have no knowledge of regular expressions. One thing to consider, 1156 for maximum effect, is to avoid using multi-word keywords as those get 1157 hyphenated like the title and will thus interfere with the above: either 1158 set the user option ‘denote-allow-multi-word-keywords’ to nil or simply 1159 insert single words at the relevant prompts. 1160 1161 1162 File: docvTU8YZ.info, Node: Front matter, Next: Linking notes, Prev: The file-naming scheme, Up: Top 1163 1164 5 Front matter 1165 ************** 1166 1167 Notes have their own “front matter”. This is a block of data at the top 1168 of the file, with no empty lines between the entries, which is 1169 automatically generated at the creation of a new note. The front matter 1170 includes the title and keywords (aka “tags” or “filetags”, depending on 1171 the file type) which the user specified at the relevant prompt, as well 1172 as the date and unique identifier, which are derived automatically. 1173 1174 This is how it looks for Org mode (when ‘denote-file-type’ is nil or 1175 the ‘org’ symbol): 1176 1177 #+title: This is a sample note 1178 #+date: [2022-06-30 Thu 16:09] 1179 #+filetags: :denote:testing: 1180 #+identifier: 20220630T160934 1181 1182 For Markdown with YAML (‘denote-file-type’ has the ‘markdown-yaml’ 1183 value), the front matter looks like this: 1184 1185 --- 1186 title: "This is a sample note" 1187 date: 2022-06-30T16:09:58+03:00 1188 tags: ["denote", "testing"] 1189 identifier: "20220630T160958" 1190 --- 1191 1192 For Markdown with TOML (‘denote-file-type’ has the ‘markdown-toml’ 1193 value), it is: 1194 1195 +++ 1196 title = "This is a sample note" 1197 date = 2022-06-30T16:10:13+03:00 1198 tags = ["denote", "testing"] 1199 identifier = "20220630T161013" 1200 +++ 1201 1202 And for plain text (‘denote-file-type’ has the ‘text’ value), we have 1203 the following: 1204 1205 title: This is a sample note 1206 date: 2022-06-30 1207 tags: denote testing 1208 identifier: 20220630T161028 1209 --------------------------- 1210 1211 The format of the date in the front matter is controlled by the user 1212 option ‘denote-date-format’. When nil, Denote uses a file-type-specific 1213 format: 1214 1215 • For Org, an inactive timestamp is used, such as ‘[2022-06-30 Wed 1216 15:31]’. 1217 1218 • For Markdown, the RFC3339 standard is applied: 1219 ‘2022-06-30T15:48:00+03:00’. 1220 1221 • For plain text, the format is that of ISO 8601: ‘2022-06-30’. 1222 1223 If the value is a string, ignore the above and use it instead. The 1224 string must include format specifiers for the date. These are described 1225 in the doc string of ‘format-time-string’.. 1226 1227 * Menu: 1228 1229 * Change the front matter format:: 1230 * Regenerate front matter:: 1231 1232 1233 File: docvTU8YZ.info, Node: Change the front matter format, Next: Regenerate front matter, Up: Front matter 1234 1235 5.1 Change the front matter format 1236 ================================== 1237 1238 Per Denote’s design principles, the code is hackable. All front matter 1239 is stored in variables that are intended for public use. We do not 1240 declare those as “user options” because (i) they expect the user to have 1241 some degree of knowledge in Emacs Lisp and (ii) implement custom code. 1242 1243 [ NOTE for tinkerers: code intended for internal use includes double 1244 hyphens in its symbol. “Internal use” means that it can be changed 1245 without warning and with no further reference in the change log. Do not 1246 use any of it without understanding the consequences. ] 1247 1248 The variables which hold the front matter format are: 1249 1250 • ‘denote-org-front-matter’ 1251 1252 • ‘denote-text-front-matter’ 1253 1254 • ‘denote-toml-front-matter’ 1255 1256 • ‘denote-yaml-front-matter’ 1257 1258 These variables have a string value with specifiers that are used by 1259 the ‘format’ function. The formatting operation passes four arguments 1260 which include the values of the given entries. If you are an advanced 1261 user who wants to edit this variable to affect how front matter is 1262 produced, consider using something like ‘%2$s’ to control where the Nth 1263 argument is placed. 1264 1265 When editing the value, make sure to: 1266 1267 1. Not use empty lines inside the front matter block. 1268 1269 2. Insert at least one empty line after the front matter block and do 1270 not use any empty line before it. 1271 1272 These help with consistency and might prove useful if we ever need to 1273 operate on the front matter as a whole. 1274 1275 With those granted, below are some examples. The approach is the 1276 same for all variables. 1277 1278 ;; Like the default, but upcase the entries 1279 (setq denote-org-front-matter 1280 "#+TITLE: %s 1281 #+DATE: %s 1282 #+FILETAGS: %s 1283 #+IDENTIFIER: %s 1284 \n") 1285 1286 ;; Change the order (notice the %N$s notation) 1287 (setq denote-org-front-matter 1288 "#+title: %1$s 1289 #+filetags: %3$s 1290 #+date: %2$s 1291 #+identifier: %4$s 1292 \n") 1293 1294 ;; Remove the date 1295 (setq denote-org-front-matter 1296 "#+title: %1$s 1297 #+filetags: %3$s 1298 #+identifier: %4$s 1299 \n") 1300 1301 ;; Remove the date and the identifier 1302 (setq denote-org-front-matter 1303 "#+title: %1$s 1304 #+filetags: %3$s 1305 \n") 1306 1307 Note that ‘setq’ has a global effect: it affects the creation of all 1308 new notes. Depending on the workflow, it may be preferrable to have a 1309 custom command which ‘let’ binds the different format. We shall not 1310 provide examples at this point as this is a more advanced feature and we 1311 are not yet sure what the user’s needs are. Please provide feedback and 1312 we shall act accordingly. 1313 1314 1315 File: docvTU8YZ.info, Node: Regenerate front matter, Prev: Change the front matter format, Up: Front matter 1316 1317 5.2 Regenerate front matter 1318 =========================== 1319 1320 Sometimes the user needs to produce new front matter for an existing 1321 note. Perhaps because they accidentally deleted a line and could not 1322 undo the operation. The command ‘denote-add-front-matter’ can be used 1323 for this very purpose. 1324 1325 In interactive use, ‘denote-add-front-matter’ must be invoked from a 1326 buffer that visits a Denote note. It prompts for a title and then for 1327 keywords. These are the standard prompts we already use for note 1328 creation, so the keywords’ prompt allows minibuffer completion and the 1329 input of multiple entries, each separated by a comma (*note Points of 1330 entry::). 1331 1332 The newly created front matter is added to the top of the file. 1333 1334 This command does not rename the file (e.g. to update the keywords). 1335 To rename a file by reading its front matter as input, the user can rely 1336 on ‘denote-rename-file-using-front-matter’ (*note Renaming files::). 1337 1338 Note that ‘denote-add-front-matter’ is useful only for existing 1339 Denote notes. If the user needs to convert a generic text file to a 1340 Denote note, they can use one of the command which first rename the file 1341 to make it comply with our file-naming scheme and then add the relevant 1342 front matter. 1343 1344 1345 File: docvTU8YZ.info, Node: Linking notes, Next: Fontification in Dired, Prev: Front matter, Up: Top 1346 1347 6 Linking notes 1348 *************** 1349 1350 Denote offers several commands for linking between notes. 1351 1352 All links target files which are Denote notes. This means that they 1353 have our file-naming scheme, are writable/regular (not directory, named 1354 pipe, etc.), and use the appropriate file type extension (per 1355 ‘denote-file-type’). Furthermore, the files need to be inside the 1356 ‘denote-directory’ or one of its subdirectories. No other file is 1357 recognised. 1358 1359 The following sections delve into the details. 1360 1361 * Menu: 1362 1363 * Adding a single link:: 1364 * Insert links matching a regexp:: 1365 * Insert links, but only those missing from current buffer: Insert links but only those missing from current buffer. 1366 * Insert links from marked files in Dired:: 1367 * Link to an existing note or create a new one:: 1368 * The backlinks' buffer:: 1369 * Writing metanotes:: 1370 * Visiting linked files via the minibuffer:: 1371 * Miscellaneous information about links:: 1372 1373 1374 File: docvTU8YZ.info, Node: Adding a single link, Next: Insert links matching a regexp, Up: Linking notes 1375 1376 6.1 Adding a single link 1377 ======================== 1378 1379 The ‘denote-link’ command inserts a link at point to an entry specified 1380 at the minibuffer prompt. Links are formatted depending on the file 1381 type of current note. In Org and plain text buffers, links are 1382 formatted thus: ‘[[denote:IDENTIFIER][TITLE]]’. While in Markdown they 1383 are expressed as ‘[TITLE](denote:IDENTIFIER)’. 1384 1385 When ‘denote-link’ is called with a prefix argument (‘C-u’ by 1386 default), it formats links like ‘[[denote:IDENTIFIER]]’. The user might 1387 prefer its simplicity. 1388 1389 The description of the link is taken from the target file’s front 1390 matter or, if that is not available, from the file name. If the region 1391 is active, its text is used as the link’s description instead. If the 1392 active region has no text, the inserted link used just the identifier, 1393 as with the ‘C-u’ prefix mentioned above. 1394 1395 Inserted links are automatically buttonized and remain active for as 1396 long as the buffer is available. In Org this is handled by the major 1397 mode: the ‘denote:’ hyperlink type works exactly like the standard 1398 ‘file:’. In Markdown and plain text, Denote performs the buttonization 1399 of those links. To buttonize links in existing files while visiting 1400 them, the user must add this snippet to their setup (it already excludes 1401 Org): 1402 1403 (add-hook 'find-file-hook #'denote-link-buttonize-buffer) 1404 1405 The ‘denote-link-buttonize-buffer’ is also an interactive function in 1406 case the user needs it. 1407 1408 Links are created only for files which qualify as a “note” for our 1409 purposes (*note Linking notes::). 1410 1411 Links are styled with the ‘denote-faces-link’ face, which looks 1412 exactly like an ordinary link by default. This is just a convenience 1413 for the user/theme in case they want ‘denote:’ links to remain distinct 1414 from other links. 1415 1416 1417 File: docvTU8YZ.info, Node: Insert links matching a regexp, Next: Insert links but only those missing from current buffer, Prev: Adding a single link, Up: Linking notes 1418 1419 6.2 Insert links matching a regexp 1420 ================================== 1421 1422 The command ‘denote-link-add-links’ adds links at point matching a 1423 regular expression or plain string. The links are inserted as a 1424 typographic list, such as: 1425 1426 - link1 1427 - link2 1428 - link3 1429 1430 Each link is formatted according to the file type of the current 1431 note, as explained further above about the ‘denote-link’ command. The 1432 current note is excluded from the matching entries (adding a link to 1433 itself is pointless). 1434 1435 When called with a prefix argument (‘C-u’) ‘denote-link-add-links’ 1436 will format all links as ‘[[denote:IDENTIFIER]]’, hence a typographic 1437 list: 1438 1439 - [[denote:IDENTIFIER-1]] 1440 - [[denote:IDENTIFIER-2]] 1441 - [[denote:IDENTIFIER-3]] 1442 1443 Same examples of a regular expression that can be used with this 1444 command: 1445 1446 • ‘journal’ match all files which include ‘journal’ anywhere in their 1447 name. 1448 1449 • ‘_journal’ match all files which include ‘journal’ as a keyword. 1450 1451 • ‘^2022.*_journal’ match all file names starting with ‘2022’ and 1452 including the keyword ‘journal’. 1453 1454 • ‘\.txt’ match all files including ‘.txt’. In practical terms, this 1455 only applies to the file extension, as Denote automatically removes 1456 dots (and other characters) from the base file name. 1457 1458 If files are created with ‘denote-sort-keywords’ as non-nil (the 1459 default), then it is easy to write a regexp that includes multiple 1460 keywords in alphabetic order: 1461 1462 • ‘_denote.*_package’ match all files that include both the ‘denote’ 1463 and ‘package’ keywords, in this order. 1464 1465 • ‘\(.*denote.*package.*\)\|\(.*package.*denote.*\)’ is the same as 1466 above, but out-of-order. 1467 1468 Remember that regexp constructs only need to be escaped once (like 1469 ‘\|’) when done interactively but twice when called from Lisp. What we 1470 show above is for interactive usage. 1471 1472 Links are created only for files which qualify as a “note” for our 1473 purposes (*note Linking notes::). 1474 1475 1476 File: docvTU8YZ.info, Node: Insert links but only those missing from current buffer, Next: Insert links from marked files in Dired, Prev: Insert links matching a regexp, Up: Linking notes 1477 1478 6.3 Insert links, but only those missing from current buffer 1479 ============================================================ 1480 1481 As a variation on the ‘denote-link-add-links’ command, one may wish to 1482 only include ’missing links’, i.e. links that are not yet present in 1483 the current file. 1484 1485 This can be achieved with ‘denote-link-add-missing-links’. The 1486 command is similar to ‘denote-link-add-links’, but will only include 1487 links to notes that are not yet linked to (*note Insert links matching a 1488 regexp::). 1489 1490 1491 File: docvTU8YZ.info, Node: Insert links from marked files in Dired, Next: Link to an existing note or create a new one, Prev: Insert links but only those missing from current buffer, Up: Linking notes 1492 1493 6.4 Insert links from marked files in Dired 1494 =========================================== 1495 1496 The command ‘denote-link-dired-marked-notes’ is similar to 1497 ‘denote-link-add-links’ in that it inserts in the buffer a typographic 1498 list of links to Denote notes (*note Insert links matching a regexp::). 1499 Though instead of reading a regular expression, it lets the user mark 1500 files in Dired and link to them. This should be easier for users of all 1501 skill levels, instead of having to write a potentially complex regular 1502 expression. 1503 1504 If there are multiple buffers that visit a Denote note, this command 1505 will ask to select one among them, using minibuffer completion. If 1506 there is only one buffer, it will operate in it outright. If there are 1507 no buffers, it will produce an error. 1508 1509 With optional ‘ID-ONLY’ as a prefix argument (‘C-u’ by default), the 1510 command inserts links with just the identifier, which is the same 1511 principle as with ‘denote-link’ and others (*note Adding a single 1512 link::). 1513 1514 The command ‘denote-link-dired-marked-notes’ is meant to be used from 1515 a Dired buffer. 1516 1517 As always, links are created only for files which qualify as a “note” 1518 for our purposes (*note Linking notes::). 1519 1520 1521 File: docvTU8YZ.info, Node: Link to an existing note or create a new one, Next: The backlinks' buffer, Prev: Insert links from marked files in Dired, Up: Linking notes 1522 1523 6.5 Link to an existing note or create a new one 1524 ================================================ 1525 1526 In one’s note-taking workflow, there may come a point where they are 1527 expounding on a certain topic but have an idea about another subject 1528 they would like to link to (*note Linking notes::). The user can always 1529 rely on the other linking facilities we have covered herein to target 1530 files that already exist. Though they may not know whether they already 1531 have notes covering the subject or whether they would need to write new 1532 ones. To this end, Denote provides two convenience commands: 1533 1534 ‘denote-link-after-creating’ 1535 Create new note in the background and link to it directly. 1536 1537 Use ‘denote’ interactively to produce the new note. Its doc string 1538 or this manual explains which prompts will be used and under what 1539 conditions (*note Standard note creation::). 1540 1541 With optional ‘ID-ONLY’ as a prefix argument (this is the ‘C-u’ 1542 key, by default) create a link that consists of just the 1543 identifier. Else try to also include the file’s title. This has 1544 the same meaning as in ‘denote-link’ (*note Adding a single 1545 link::). 1546 1547 IMPORTANT NOTE: Normally, ‘denote’ does not save the buffer it 1548 produces for the new note. This is a safety precaution to not 1549 write to disk unless the user wants it (e.g. the user may choose 1550 to kill the buffer, thus cancelling the creation of the note). 1551 However, for this command the creation of the note happens in the 1552 background and the user may miss the step of saving their buffer. 1553 We thus have to save the buffer in order to (i) establish valid 1554 links, and (ii) retrieve whatever front matter from the target 1555 file. 1556 1557 ‘denote-link-or-create’ 1558 Use ‘denote-link’ on ‘TARGET’ file, creating it if necessary. 1559 1560 If ‘TARGET’ file does not exist, call ‘denote-link-after-creating’ 1561 which runs the ‘denote’ command interactively to create the file. 1562 The established link will then be targeting that new file. 1563 1564 If ‘TARGET’ file does not exist, add the user input that was used 1565 to search for it to the history of the ‘denote-title-prompt’. The 1566 user can then retrieve and possibly further edit their last input, 1567 using it as the newly created note’s actual title. At the 1568 ‘denote-title-prompt’ type ‘M-p’ with the default key bindings, 1569 which calls ‘previous-history-element’. 1570 1571 With optional ‘ID-ONLY’ as a prefix argument create a link with 1572 just the file’s identifier. This has the same meaning as in 1573 ‘denote-link’. 1574 1575 This command has the alias ‘denote-link-to-existing-or-new-note’, 1576 which helps with discoverability. 1577 1578 1579 File: docvTU8YZ.info, Node: The backlinks' buffer, Next: Writing metanotes, Prev: Link to an existing note or create a new one, Up: Linking notes 1580 1581 6.6 The backlinks’ buffer 1582 ========================= 1583 1584 The command ‘denote-link-backlinks’ produces a bespoke buffer which 1585 displays backlinks to the current note. A “backlink” is a link back to 1586 the present entry. 1587 1588 By default, the backlinks’ buffer is desinged to display the file 1589 name of the note linking to the current entry. Each file name is 1590 presented on its own line, like this: 1591 1592 Backlinks to "On being honest" (20220614T130812) 1593 ------------------------------------------------ 1594 1595 20220614T145606--let-this-glance-become-a-stare__journal.txt 1596 20220616T182958--feeling-butterflies-in-your-stomach__journal.txt 1597 1598 When the user option ‘denote-backlinks-show-context’ is non-nil, the 1599 backlinks’ buffer displays the line on which a link to the current note 1600 occurs. It also shows multiple occurances, if present. It looks like 1601 this (and has the appropriate fontification): 1602 1603 Backlinks to "On being honest" (20220614T130812) 1604 ------------------------------------------------ 1605 1606 20220614T145606--let-this-glance-become-a-stare__journal.txt 1607 37: growing into it: [[denote:20220614T130812][On being honest]]. 1608 64: As I said in [[denote:20220614T130812][On being honest]] I have never 1609 20220616T182958--feeling-butterflies-in-your-stomach__journal.txt 1610 62: indifference. In [[denote:20220614T130812][On being honest]] I alluded 1611 1612 Note that the width of the lines in the context depends on the 1613 underlying file. In the above example, the lines are split at the 1614 ‘fill-column’. Long lines will show up just fine. Also note that the 1615 built-in user option ‘xref-truncation-width’ can truncate long lines to 1616 a given maximum number of characters. 1617 1618 *note Speed up backlinks' buffer creation?:: 1619 1620 The backlinks’ buffer runs the major-mode ‘denote-backlinks-mode’. 1621 It binds keys to move between links with ‘n’ (next) and ‘p’ (previous). 1622 These are stored in the ‘denote-backlinks-mode-map’ (use ‘M-x 1623 describe-mode’ (‘C-h m’) in an unfamiliar buffer to learn more about 1624 it). When the user option ‘denote-backlinks-show-context’ is non-nil, 1625 all relevant Xref key bindings are fully functional: again, check 1626 ‘describe-mode’. 1627 1628 The backlinking facility uses Emacs’ built-in Xref infrastructure. 1629 On some operating systems, the user may need to add certain executables 1630 to the relevant environment variable. 1631 1632 *note Why do I get ``Search failed with status 1'' when I search for 1633 backlinks?:: 1634 1635 Backlinks to the current file can also be visited by using the 1636 minibuffer completion interface with the ‘denote-link-find-backlink’ 1637 command (*note Visiting linked files via the minibuffer::). 1638 1639 The placement of the backlinks’ buffer is subject to the user option 1640 ‘denote-link-backlinks-display-buffer-action’. Due to the nature of the 1641 underlying ‘display-buffer’ mechanism, this inevitably is a relatively 1642 advanced feature. By default, the backlinks’ buffer is displayed below 1643 the current window. The doc string of our user option includes a sample 1644 configuration that places the buffer in a left side window instead. 1645 Reproducing it here for the sake of convenience: 1646 1647 (setq denote-link-backlinks-display-buffer-action 1648 '((display-buffer-reuse-window 1649 display-buffer-in-side-window) 1650 (side . left) 1651 (slot . 99) 1652 (window-width . 0.3))) 1653 1654 1655 File: docvTU8YZ.info, Node: Writing metanotes, Next: Visiting linked files via the minibuffer, Prev: The backlinks' buffer, Up: Linking notes 1656 1657 6.7 Writing metanotes 1658 ===================== 1659 1660 A “metanote” is an entry that describes other entries who have something 1661 in common. Writing metanotes can be part of a workflow where the user 1662 periodically reviews their work in search of patterns and deeper 1663 insights. For example, you might want to read your journal entries from 1664 the past year to reflect on your experiences, evolution as a person, and 1665 the like. 1666 1667 The commands ‘denote-link-add-links’, 1668 ‘denote-link-dired-marked-notes’ are suited for this task. 1669 1670 *note Insert links matching a regexp::. 1671 1672 *note Insert links from marked files in Dired::. 1673 1674 You will create your metanote the way you use Denote ordinarily 1675 (metanotes may have the ‘metanote’ keyword, among others), write an 1676 introduction or however you want to go about it, invoke the command 1677 which inserts multiple links at once (see the above-cited nodes), and 1678 continue writing. 1679 1680 Metanotes can serve as entry points to groupings of individual notes. 1681 They are not the same as a filtered list of files, i.e. what you would 1682 do in Dired or the minibuffer where you narrow the list of notes to a 1683 given query. Metanotes contain the filtered list plus your thoughts 1684 about it. The act of purposefully grouping notes together and 1685 contemplating on their shared patterns is what adds value. 1686 1687 Your future self will appreciate metanotes for the function they 1688 serve in encapsulating knowledge, while current you will be equipped 1689 with the knowledge derived from the deliberate self-reflection. 1690 1691 1692 File: docvTU8YZ.info, Node: Visiting linked files via the minibuffer, Next: Miscellaneous information about links, Prev: Writing metanotes, Up: Linking notes 1693 1694 6.8 Visiting linked files via the minibuffer 1695 ============================================ 1696 1697 Denote has a major-mode-agnostic mechanism to collect all linked file 1698 references in the current buffer and return them as an appropriately 1699 formatted list. This list can then be used in interactive commands. 1700 The ‘denote-link-find-file’ is such a command. It uses minibuffer 1701 completion to visit a file that is linked to from the current note. The 1702 candidates have the correct metadata, which is ideal for integration 1703 with other standards-compliant tools (*note Extending Denote::). For 1704 instance, a package such as ‘marginalia’ will display accurate 1705 annotations, while the ‘embark’ package will be able to work its magic 1706 such as in exporting the list into a filtered Dired buffer (i.e. a 1707 familiar Dired listing with only the files of the current minibuffer 1708 session). 1709 1710 To visit backlinks to the current note via the minibuffer, use 1711 ‘denote-link-find-backlink’. This is an alternative to placing 1712 backlinks in a dedicated buffer (*note The backlinks' buffer::). 1713 1714 1715 File: docvTU8YZ.info, Node: Miscellaneous information about links, Prev: Visiting linked files via the minibuffer, Up: Linking notes 1716 1717 6.9 Miscellaneous information about links 1718 ========================================= 1719 1720 For convenience, the ‘denote-link’ command has an alias called 1721 ‘denote-link-insert-link’. The ‘denote-link-backlinks’ can also be used 1722 as ‘denote-link-show-backlinks-buffer’. While ‘denote-link-add-links’ 1723 is aliased ‘denote-link-insert-links-matching-regexp’. The purpose of 1724 these aliases is to offer alternative, more descriptive names of select 1725 commands. 1726 1727 1728 File: docvTU8YZ.info, Node: Fontification in Dired, Next: Use Org dynamic blocks, Prev: Linking notes, Up: Top 1729 1730 7 Fontification in Dired 1731 ************************ 1732 1733 One of the upsides of Denote’s file-naming scheme is the predictable 1734 pattern it establishes, which appears as a near-tabular presentation in 1735 a listing of notes (i.e. in Dired). The ‘denote-dired-mode’ can help 1736 enhance this impression, by fontifying the components of the file name 1737 to make the date (identifier) and keywords stand out. 1738 1739 There are two ways to set the mode. Either use it for all 1740 directories, which probably is not needed: 1741 1742 (add-hook 'dired-mode-hook #'denote-dired-mode) 1743 1744 Or configure the user option ‘denote-dired-directories’ and then set 1745 up the function ‘denote-dired-mode-in-directories’: 1746 1747 ;; We use different ways to specify a path for demo purposes. 1748 (setq denote-dired-directories 1749 (list denote-directory 1750 (thread-last denote-directory (expand-file-name "attachments")) 1751 (expand-file-name "~/Documents/vlog"))) 1752 1753 (add-hook 'dired-mode-hook #'denote-dired-mode-in-directories) 1754 1755 The faces we define for this purpose are: 1756 1757 • ‘denote-faces-date’ 1758 • ‘denote-faces-delimiter’ 1759 • ‘denote-faces-extension’ 1760 • ‘denote-faces-keywords’ 1761 • ‘denote-faces-subdirectory’ 1762 • ‘denote-faces-time’ 1763 • ‘denote-faces-title’ 1764 1765 For the time being, the ‘diredfl’ package is not compatible with this 1766 facility. 1767 1768 The ‘denote-dired-mode’ does not only fontify note files that were 1769 created by Denote: it covers every file name that follows our naming 1770 conventions (*note The file-naming scheme::). This is particularly 1771 useful for scenaria where, say, one wants to organise their collection 1772 of PDFs and multimedia in a systematic way (and, perhaps, use them as 1773 attachments for the notes Denote produces if you are writing Org notes 1774 and are using its standand attachments’ facility). 1775 1776 1777 File: docvTU8YZ.info, Node: Use Org dynamic blocks, Next: Minibuffer histories, Prev: Fontification in Dired, Up: Top 1778 1779 8 Use Org dynamic blocks 1780 ************************ 1781 1782 Denote can optionally integrate with Org mode’s “dynamic blocks” 1783 facility. Start by loading the relevant library: 1784 1785 ;; Register Denote's Org dynamic blocks 1786 (require 'denote-org-dblock) 1787 1788 A dynamic block gets its contents by evaluating a given function, 1789 depending on the type of block. The type of block and its parameters 1790 are stated in the opening ‘#+BEGIN’ line of the block. Typing ‘C-c C-c’ 1791 with point on that line runs the function, with the given arguments, and 1792 populates the block’s contents accordingly. 1793 1794 Denote leverages Org dynamic blocks to streamline the inclusion of 1795 (i) links to notes whose name matches a given search query (like 1796 ‘denote-link-add-links’) and (ii) backlinks to the current note (similar 1797 to ‘denote-link-find-backlink’). 1798 1799 These two types of blocks are named ‘denote-links’ and 1800 ‘denote-backlinks’ respectively. The latter does not accept any 1801 parameters, while the former does, which we explain below by also 1802 demonstrating how dynamic blocks are written. 1803 1804 A dynamic block looks like this: 1805 1806 #+BEGIN: denote-links :regexp "_journal" 1807 1808 #+END: 1809 1810 Here we have the ‘denote-links’ type, with the ‘:regexp’ parameter. 1811 The value of the ‘:regexp’ parameter is the same as that of the command 1812 ‘denote-link-add-links’ (*note Insert links matching a regexp::). The 1813 linked entry provides practical examples of patterns that make good use 1814 of Denote’s file-naming scheme (*note The file-naming scheme::). 1815 1816 In this example, we instruct Org to produce a list of all notes that 1817 include the ‘journal’ keyword in their file name (keywords in file names 1818 are prefixed with the underscore). So the following: 1819 1820 #+BEGIN: denote-links :regexp "_journal" 1821 1822 #+END: 1823 1824 Becomes something like this once we type ‘C-c C-c’ with point on the 1825 ‘#+BEGIN’ line (Org makes the links look prettier by default): 1826 1827 #+BEGIN: denote-links :regexp "_journal" 1828 - [[denote:20220616T182958][Feeling butterflies in your stomach]] 1829 - [[denote:20220818T221036][Between friend and stranger]] 1830 #+END: 1831 1832 The dynamic block takes care to keep the list in order and to add any 1833 missing links when the block is evaluated anew. 1834 1835 Depending on one’s workflow, the dynamic block can be instructed to 1836 list only those links which are missing from the current buffer (similar 1837 to ‘denote-link-add-missing-links’). Adding the ‘:missing-only’ 1838 parameter with a non-‘nil’ value achieves this effect. The ‘#+BEGIN’ 1839 line looks like this: 1840 1841 #+BEGIN: denote-links :regexp "_journal" :missing-only t 1842 1843 To reverse the order links appear in, add ‘:reverse t’ to the 1844 ‘#+BEGIN’ line. 1845 1846 The ‘denote-links’ block can also accept a ‘:block-name’ parameter 1847 with a string value that names the block. Once the dynamic block is 1848 evaluated, a ‘#+NAME’ is prepended to the block’s contents. This can be 1849 referenced in other source blocks to parse the named block’s contents as 1850 input of another process. The details are beyond the scope of Denote. 1851 1852 As for the ‘denote-backlinks’ dynamic block type, it simply produces 1853 a list of notes that link to the current file. It accepts no parameters 1854 and looks like this: 1855 1856 #+BEGIN: denote-backlinks 1857 1858 #+END: 1859 1860 The Org manual describes the technicalities of Dynamic Blocks. 1861 Evaluate: 1862 1863 (info "(org) Dynamic Blocks") 1864 1865 Dynamic blocks are particularly useful for metanote entries that 1866 reflect on the status of earlier notes (*note Writing metanotes::). 1867 1868 1869 File: docvTU8YZ.info, Node: Minibuffer histories, Next: Extending Denote, Prev: Use Org dynamic blocks, Up: Top 1870 1871 9 Minibuffer histories 1872 ********************** 1873 1874 Denote has a dedicated minibuffer history for each one of its prompts. 1875 This practically means that using ‘M-p’ (‘previous-history-element’) and 1876 ‘M-n’ (‘next-history-element’) will only cycle through the relevant 1877 record of inputs, such as your latest titles in the ‘TITLE’ prompt, and 1878 keywords in the ‘KEYWORDS’ prompt. 1879 1880 The built-in ‘savehist’ library saves minibuffer histories. Sample 1881 configuration: 1882 1883 (require 'savehist) 1884 (setq savehist-file (locate-user-emacs-file "savehist")) 1885 (setq history-length 500) 1886 (setq history-delete-duplicates t) 1887 (setq savehist-save-minibuffer-history t) 1888 (add-hook 'after-init-hook #'savehist-mode) 1889 1890 1891 File: docvTU8YZ.info, Node: Extending Denote, Next: Installation, Prev: Minibuffer histories, Up: Top 1892 1893 10 Extending Denote 1894 ******************* 1895 1896 Denote is a tool with a narrow scope: create notes and link between 1897 them, based on the aforementioned file-naming scheme. For other common 1898 operations the user is advised to rely on standard Emacs facilities or 1899 specialised third-party packages. This section covers the details. 1900 1901 * Menu: 1902 1903 * Keep a journal or diary:: 1904 * Create a note with the region's contents:: 1905 * Split an Org subtree into its own note:: 1906 * Narrow the list of files in Dired:: 1907 * Use dired-virtual-mode for arbitrary file listings:: 1908 * Use Embark to collect minibuffer candidates:: 1909 * Search file contents:: 1910 * Bookmark the directory with the notes:: 1911 * Use the citar-denote package for bibliography notes:: 1912 * Use the consult-notes package:: 1913 * Treat your notes as a project:: 1914 * Variants of denote-open-or-create:: 1915 * Variants of denote-link-or-create:: 1916 1917 1918 File: docvTU8YZ.info, Node: Keep a journal or diary, Next: Create a note with the region's contents, Up: Extending Denote 1919 1920 10.1 Keep a journal or diary 1921 ============================ 1922 1923 While there are subtle technical differences between a journal and a 1924 diary, we will consider those equivalent in the interest of brevity: 1925 they both describe a personal space that holds a record of your thoughts 1926 about your experiences and/or view of events in the world. 1927 1928 Suppose you are committed to writing an entry every day. Unlike what 1929 we demonstrated before, your writing will follow a regular naming 1930 pattern. You know that the title of the new note must always look like 1931 ‘Tuesday 14 June 2022’ and the keyword has to be ‘journal’ or ‘diary’. 1932 As such, you want to automate the task instead of being prompted each 1933 time, as is the norm with ‘denote’ and the relevant commands (*note 1934 Points of entry::). This is easy to accomplish because ‘denote’ can be 1935 called from Lisp and given the required arguments of ‘TITLE’ and 1936 ‘KEYWORDS’ directly. All you need is a simple wrapper function: 1937 1938 (defun my-denote-journal () 1939 "Create an entry tagged 'journal' with the date as its title." 1940 (interactive) 1941 (denote 1942 (format-time-string "%A %e %B %Y") ; format like Tuesday 14 June 2022 1943 '("journal"))) ; multiple keywords are a list of strings: '("one" "two") 1944 1945 By invoking ‘my-denote-journal’ you will go straight into the newly 1946 created note and commit to your writing outright. 1947 1948 Of course, you can always set up the function so that it asks for a 1949 ‘TITLE’ but still automatically applies the ‘journal’ tag: 1950 1951 (defun denote-journal-with-title () 1952 "Create an entry tagged 'journal', while prompting for a title." 1953 (interactive) 1954 (denote 1955 (denote--title-prompt) ; ask for title, instead of using human-readable date 1956 '("journal"))) 1957 1958 Sometimes journaling is done with the intent to hone one’s writing 1959 skills. Perhaps you are learning a new language or wish to communicate 1960 your ideas with greater clarity and precision. As with everything that 1961 requires a degree of sophistication, you have to work for it—write, 1962 write, write! 1963 1964 One way to test your progress is to set a timer. It helps you gauge 1965 your output and its quality. To use a timer with Emacs, consider the 1966 ‘tmr’ package: 1967 1968 (defun my-denote-journal-with-tmr () 1969 "Like `my-denote-journal', but also set a 10-minute timer. 1970 The `tmr' command is part of the `tmr' package." 1971 (interactive) 1972 (denote 1973 (format-time-string "%A %e %B %Y") 1974 '("journal")) 1975 (tmr "10" "Practice writing in my journal")) ; set 10 minute timer with a description 1976 1977 Once the timer elapses, stop writing and review your performance. 1978 Practice makes perfect! 1979 1980 [ As Denote matures, we may add hooks to control what happens before 1981 or after the creation of a new note. We shall also document more 1982 examples of tasks that can be accomplished with this package. ] 1983 1984 Sources for ‘tmr’: 1985 1986 • Package name (GNU ELPA): ‘tmr’ 1987 • Official manual: <https://protesilaos.com/emacs/tmr> 1988 • Change log: <https://protesilaos.com/emacs/denote-changelog> 1989 • Git repo on SourceHut: <https://git.sr.ht/~protesilaos/tmr> 1990 • Mirrors: 1991 • GitHub: <https://github.com/protesilaos/tmr> 1992 • GitLab: <https://gitlab.com/protesilaos/tmr> 1993 • Mailing list: <https://lists.sr.ht/~protesilaos/tmr> 1994 1995 1996 File: docvTU8YZ.info, Node: Create a note with the region's contents, Next: Split an Org subtree into its own note, Prev: Keep a journal or diary, Up: Extending Denote 1997 1998 10.2 Create a note with the region’s contents 1999 ============================================= 2000 2001 Sometimes it makes sense to gather notes in a single file and later 2002 review it to make multiple notes out of it. With the following code, 2003 the user marks a region and then invokes the command 2004 ‘my-denote-create-new-note-from-region’: it prompts for a title and 2005 keywords and then uses the region’s contents to fill in the newly 2006 created note. 2007 2008 (defun my-denote-create-new-note-from-region (beg end) 2009 "Create note whose contents include the text between BEG and END. 2010 Prompt for title and keywords of the new note." 2011 (interactive "r") 2012 (if-let (((region-active-p)) 2013 (text (buffer-substring-no-properties beg end))) 2014 (progn 2015 (denote (denote--title-prompt) (denote--keywords-prompt)) 2016 (insert text)) 2017 (user-error "No region is available"))) 2018 2019 Have a different workflow? Feel welcome to discuss it in any of our 2020 official channels (*note Contributing::). 2021 2022 2023 File: docvTU8YZ.info, Node: Split an Org subtree into its own note, Next: Narrow the list of files in Dired, Prev: Create a note with the region's contents, Up: Extending Denote 2024 2025 10.3 Split an Org subtree into its own note 2026 =========================================== 2027 2028 With Org files in particular, it is common to have nested headings which 2029 could be split off into their own standalone notes. In Org parlance, an 2030 entry with all its subheadings is a “subtree”. With the following code, 2031 the user places the point inside the heading they want to split off and 2032 invokes the command ‘my-denote-org-extract-subtree’. It will create a 2033 note using the heading’s text and tags for the new file. The contents 2034 of the subtree become the contents of the new note and are removed from 2035 the old one. 2036 2037 (defun my-denote-org-extract-subtree () 2038 "Create new Denote note using current Org subtree. 2039 Make the new note use the Org file type, regardless of the value 2040 of `denote-file-type'. 2041 2042 Use the subtree title as the note's title. If available, use the 2043 tags of the heading are used as note keywords. 2044 2045 Delete the original subtree." 2046 (interactive) 2047 (if-let ((text (org-get-entry)) 2048 (heading (org-get-heading :no-tags :no-todo :no-priority :no-comment))) 2049 (progn 2050 (delete-region (org-entry-beginning-position) (org-entry-end-position)) 2051 (denote heading (org-get-tags) 'org) 2052 (insert text)) 2053 (user-error "No subtree to extract; aborting"))) 2054 2055 Have a different workflow? Feel welcome to discuss it in any of our 2056 official channels (*note Contributing::). 2057 2058 2059 File: docvTU8YZ.info, Node: Narrow the list of files in Dired, Next: Use dired-virtual-mode for arbitrary file listings, Prev: Split an Org subtree into its own note, Up: Extending Denote 2060 2061 10.4 Narrow the list of files in Dired 2062 ====================================== 2063 2064 Emacs’ standard file manager (or directory editor) can read a regular 2065 expression to mark the matching files. This is the command 2066 ‘dired-mark-files-regexp’, which is bound to ‘% m’ by default. For 2067 example, ‘% m _denote’ will match all files that have the ‘denote’ 2068 keyword (*note Features of the file-naming scheme for searching or 2069 filtering::). 2070 2071 Once the files are matched, the user has to options: (i) narrow the 2072 list to the matching items or (ii) exclude the matching items from the 2073 list. 2074 2075 For the former, we want to toggle the marks by typing ‘t’ (calls the 2076 command ‘dired-toggle-marks’ by default) and then hit the letter ‘k’ 2077 (for ‘dired-do-kill-lines’). The remaining files are those that match 2078 the regexp that was provided earlier. 2079 2080 For the latter approach of filtering out the matching items, simply 2081 involves the use of the ‘k’ command (‘dired-do-kill-lines’) to omit the 2082 marked files from the list. 2083 2084 These sequences can be combined to incrementally narrow the list. 2085 Note that ‘dired-do-kill-lines’ does not delete files: it simply hides 2086 them from the current view. 2087 2088 Revert to the original listing with ‘g’ (‘revert-buffer’). 2089 2090 For a convenient wrapper, consider this example: 2091 2092 (defvar prot-dired--limit-hist '() 2093 "Minibuffer history for `prot-dired-limit-regexp'.") 2094 2095 ;;;###autoload 2096 (defun prot-dired-limit-regexp (regexp omit) 2097 "Limit Dired to keep files matching REGEXP. 2098 2099 With optional OMIT argument as a prefix (\\[universal-argument]), 2100 exclude files matching REGEXP. 2101 2102 Restore the buffer with \\<dired-mode-map>`\\[revert-buffer]'." 2103 (interactive 2104 (list 2105 (read-regexp 2106 (concat "Files " 2107 (when current-prefix-arg 2108 (propertize "NOT " 'face 'warning)) 2109 "matching PATTERN: ") 2110 nil 'prot-dired--limit-hist) 2111 current-prefix-arg)) 2112 (dired-mark-files-regexp regexp) 2113 (unless omit (dired-toggle-marks)) 2114 (dired-do-kill-lines)) 2115 2116 2117 File: docvTU8YZ.info, Node: Use dired-virtual-mode for arbitrary file listings, Next: Use Embark to collect minibuffer candidates, Prev: Narrow the list of files in Dired, Up: Extending Denote 2118 2119 10.5 Use ‘dired-virtual-mode’ for arbitrary file listings 2120 ========================================================= 2121 2122 Emacs’ Dired is a powerful file manager that builds its functionality on 2123 top of the Unix ‘ls’ command. As noted elsewhere in this manual, the 2124 user can update the ‘ls’ flags that Dired uses to display its contents 2125 (*note I want to sort by last modified, why won’t Denote let me?: I want 2126 to sort by last modified why won't Denote let me?.). 2127 2128 What Dired cannot do is parse the output of a result that is produced 2129 by piped commands, such as ‘ls -l | sort -t _ -k2’. This specific 2130 example targets the second underscore-separated field of the file name, 2131 per our conventions (*note The file-naming scheme::). Conceretely, it 2132 matches the “alpha” as the sorting key in something like this: 2133 2134 20220929T200432--testing-file-one__alpha.txt 2135 2136 Consider then, how Dired will sort those files by their identifier: 2137 2138 20220929T200432--testing-file-one__alpha.txt 2139 20220929T200532--testing-file-two__beta.txt 2140 20220929T200632--testing-file-three__alpha.txt 2141 20220929T200732--testing-file-four__beta.txt 2142 2143 Whereas on the command line, we can get the following: 2144 2145 $ ls | sort -t _ -k 2 2146 20220929T200432--testing-file-one__alpha.txt 2147 20220929T200632--testing-file-three__alpha.txt 2148 20220929T200532--testing-file-two__beta.txt 2149 20220929T200732--testing-file-four__beta.txt 2150 2151 This is where ‘dired-virtual-mode’ shows its utility. If we tweak 2152 our command-line invocation to include ‘ls -l’, this mode can behave 2153 like Dired on the listed files. (We omit the output of the ‘-l’ flag 2154 from this tutorial, as it is too verbose.) 2155 2156 What we now need is to capture the output of ‘ls -l | sort -t _ -k 2’ 2157 in an Emacs buffer and then enable ‘dired-virtual-mode’. To do that, we 2158 can rely on either ‘M-x shell’ or ‘M-x eshell’ and then manually copy 2159 the relevant contents. 2160 2161 For the user’s convenience, I share what I have for Eshell to quickly 2162 capture the last command’s output in a dedicated buffer: 2163 2164 (defcustom prot-eshell-output-buffer "*Exported Eshell output*" 2165 "Name of buffer with the last output of Eshell command. 2166 Used by `prot-eshell-export'." 2167 :type 'string 2168 :group 'prot-eshell) 2169 2170 (defcustom prot-eshell-output-delimiter "* * *" 2171 "Delimiter for successive `prot-eshell-export' outputs. 2172 This is formatted internally to have newline characters before 2173 and after it." 2174 :type 'string 2175 :group 'prot-eshell) 2176 2177 (defun prot-eshell--command-prompt-output () 2178 "Capture last command prompt and its output." 2179 (let ((beg (save-excursion 2180 (goto-char (eshell-beginning-of-input)) 2181 (goto-char (point-at-bol))))) 2182 (when (derived-mode-p 'eshell-mode) 2183 (buffer-substring-no-properties beg (eshell-end-of-output))))) 2184 2185 ;;;###autoload 2186 (defun prot-eshell-export () 2187 "Produce a buffer with output of the last Eshell command. 2188 If `prot-eshell-output-buffer' does not exist, create it. Else 2189 append to it, while separating multiple outputs with 2190 `prot-eshell-output-delimiter'." 2191 (interactive) 2192 (let ((eshell-output (prot-eshell--command-prompt-output))) 2193 (with-current-buffer (get-buffer-create prot-eshell-output-buffer) 2194 (let ((inhibit-read-only t)) 2195 (goto-char (point-max)) 2196 (unless (eq (point-min) (point-max)) 2197 (insert (format "\n%s\n\n" prot-eshell-output-delimiter))) 2198 (goto-char (point-at-bol)) 2199 (insert eshell-output) 2200 (switch-to-buffer-other-window (current-buffer)))))) 2201 2202 Bind ‘prot-eshell-export’ to a key in the ‘eshell-mode-map’ and give 2203 it a try (I use ‘C-c C-e’). In the produced buffer, activate the 2204 ‘dired-virtual-mode’. 2205 2206 2207 File: docvTU8YZ.info, Node: Use Embark to collect minibuffer candidates, Next: Search file contents, Prev: Use dired-virtual-mode for arbitrary file listings, Up: Extending Denote 2208 2209 10.6 Use Embark to collect minibuffer candidates 2210 ================================================ 2211 2212 ‘embark’ is a remarkable package that lets you perform relevant, 2213 context-dependent actions using a prefix key (simplifying in the 2214 interest of brevity). 2215 2216 For our purposes, Embark can be used to produce a Dired listing 2217 directly from the minibuffer. Suppose the current note has links to 2218 three other notes. You might use the ‘denote-link-find-file’ command to 2219 pick one via the minibuffer. But why not turn those three links into 2220 their own Dired listing? While in the minibuffer, invoke ‘embark-act’ 2221 which you may have already bound to ‘C-.’ and then follow it up with ‘E’ 2222 (for the ‘embark-export’ command). 2223 2224 This pattern can be repeated with any list of candidates, meaning 2225 that you can narrow the list by providing some input before eventually 2226 exporting the results with Embark. 2227 2228 Overall, this is very powerful and you might prefer it over doing the 2229 same thing directly in Dired, since you also benefit from all the power 2230 of the minibuffer (*note Narrow the list of files in Dired::). 2231 2232 2233 File: docvTU8YZ.info, Node: Search file contents, Next: Bookmark the directory with the notes, Prev: Use Embark to collect minibuffer candidates, Up: Extending Denote 2234 2235 10.7 Search file contents 2236 ========================= 2237 2238 Emacs provides built-in commands which are wrappers of standard Unix 2239 tools: ‘M-x grep’ lets the user input the flags of a ‘grep’ call and 2240 pass a regular expression to the ‘-e’ flag. 2241 2242 The author of Denote uses this thin wrapper instead: 2243 2244 (defvar prot-search--grep-hist '() 2245 "Input history of grep searches.") 2246 2247 ;;;###autoload 2248 (defun prot-search-grep (regexp &optional recursive) 2249 "Run grep for REGEXP. 2250 2251 Search in the current directory using `lgrep'. With optional 2252 prefix argument (\\[universal-argument]) for RECURSIVE, run a 2253 search starting from the current directory with `rgrep'." 2254 (interactive 2255 (list 2256 (read-from-minibuffer (concat (if current-prefix-arg 2257 (propertize "Recursive" 'face 'warning) 2258 "Local") 2259 " grep for PATTERN: ") 2260 nil nil nil 'prot-search--grep-hist) 2261 current-prefix-arg)) 2262 (unless grep-command 2263 (grep-compute-defaults)) 2264 (if recursive 2265 (rgrep regexp "*" default-directory) 2266 (lgrep regexp "*" default-directory))) 2267 2268 Rather than maintain custom code, consider using the excellent 2269 ‘consult’ package: it provides commands such as ‘consult-grep’ and 2270 ‘consult-find’ which provide live results and are generally easier to 2271 use than the built-in commands. 2272 2273 2274 File: docvTU8YZ.info, Node: Bookmark the directory with the notes, Next: Use the citar-denote package for bibliography notes, Prev: Search file contents, Up: Extending Denote 2275 2276 10.8 Bookmark the directory with the notes 2277 ========================================== 2278 2279 Part of the reason Denote does not reinvent existing functionality is to 2280 encourage you to learn more about Emacs. You do not need a bespoke 2281 “jump to my notes” directory because such commands do not scale well. 2282 Will you have a “jump to my downloads” then another for multimedia and 2283 so on? No. 2284 2285 Emacs has a built-in framework for recording persistent markers to 2286 locations. Visit the ‘denote-directory’ (or any dir/file for that 2287 matter) and invoke the ‘bookmark-set’ command (bound to ‘C-x r m’ by 2288 default). It lets you create a bookmark. 2289 2290 The list of bookmarks can be reviewed with the ‘bookmark-bmenu-list’ 2291 command (bound to ‘C-x r l’ by default). A minibuffer interface is 2292 available with ‘bookmark-jump’ (‘C-x r b’). 2293 2294 If you use the ‘consult’ package, its default ‘consult-buffer’ 2295 command has the means to group together buffers, recent files, and 2296 bookmarks. Each of those types can be narrowed to with a prefix key. 2297 The package ‘consult-dir’ is an extension to ‘consult’ which provides 2298 useful extras for working with directories, including bookmarks. 2299 2300 2301 File: docvTU8YZ.info, Node: Use the citar-denote package for bibliography notes, Next: Use the consult-notes package, Prev: Bookmark the directory with the notes, Up: Extending Denote 2302 2303 10.9 Use the ‘citar-denote’ package for bibliography notes 2304 ========================================================== 2305 2306 Peter Prevos has produced the ‘citar-denote’ package which makes it 2307 possible to write notes on BibTeX entries with the help of the ‘citar’ 2308 package. These notes have the citation’s unique key associated with 2309 them in the file’s front matter. They also get a configurable keyword 2310 in their file name, making it easy to find them in Dired and/or retrieve 2311 them with the various Denote methods. 2312 2313 With ‘citar-denote’, the user leverages standard minibuffer 2314 completion mechanisms (e.g. with the help of the ‘vertico’ and ‘embark’ 2315 packages) to manage bibliographic notes and access those notes with 2316 ease. The package’s documentation covers the details: 2317 <https://github.com/pprevos/citar-denote/>. 2318 2319 2320 File: docvTU8YZ.info, Node: Use the consult-notes package, Next: Treat your notes as a project, Prev: Use the citar-denote package for bibliography notes, Up: Extending Denote 2321 2322 10.10 Use the ‘consult-notes’ package 2323 ===================================== 2324 2325 If you are already using ‘consult’ (which is a brilliant package), you 2326 will probably like its ‘consult-notes’ extension. It uses the familiar 2327 mechanisms of Consult to filter searches via a prefix key. For example: 2328 2329 (setq consult-notes-sources 2330 `(("Notes" ?n ,denote-directory) 2331 ("Books" ?b "~/Documents/books"))) 2332 2333 With the above, ‘M-x consult-notes’ will list the files in those two 2334 directories. If you type ‘n’ and space, it narrows the list to just the 2335 notes, while ‘b’ does the same for books. 2336 2337 To search all your notes with grep (or ripgrep if installed – see 2338 ‘consult-notes-use-rg’ variable) use the command 2339 ‘consult-notes-search-in-all-notes’. This will employ grep/ripgrep for 2340 searching terms in all the directories set in ‘consult-notes-sources’. 2341 2342 Note that ‘consult-notes’ is in its early stages of development. 2343 Expect improvements in the near future (written on 2022-06-22 16:48 2344 +0300). 2345 2346 2347 File: docvTU8YZ.info, Node: Treat your notes as a project, Next: Variants of denote-open-or-create, Prev: Use the consult-notes package, Up: Extending Denote 2348 2349 10.11 Treat your notes as a project 2350 =================================== 2351 2352 Emacs has a built-in library for treating a directory tree as a 2353 “project”. This means that the contents of this tree are seen as part 2354 of the same set, so commands like ‘project-switch-to-buffer’ (‘C-x p b’ 2355 by default) will only consider buffers in the current project (e.g. 2356 three notes that are currently being visited). 2357 2358 Normally, a “project” is a directory tree whose root is under version 2359 control. For our purposes, all you need is to navigate to the 2360 ‘denote-directory’ (for the shell or via Dired) and use the command-line 2361 to run this (requires the ‘git’ executable): 2362 2363 git init 2364 2365 From Dired, you can type ‘M-!’ which invokes 2366 ‘dired-smart-shell-command’ and then run the git call there. 2367 2368 The project can then be registered by invoking any project-related 2369 command inside of it, such as ‘project-find-file’ (‘C-x p f’). 2370 2371 It is a good idea to keep your notes under version control, as that 2372 gives you a history of changes for each file. We shall not delve into 2373 the technicalities here, though suffice to note that Emacs’ built-in 2374 version control framework or the exceptionally well-crafted ‘magit’ 2375 package will get the job done (VC can work with other backends besides 2376 Git). 2377 2378 2379 File: docvTU8YZ.info, Node: Variants of denote-open-or-create, Next: Variants of denote-link-or-create, Prev: Treat your notes as a project, Up: Extending Denote 2380 2381 10.12 Variants of ‘denote-open-or-create’ 2382 ========================================= 2383 2384 The command ‘denote-open-or-create’ prompts to visit a file in the 2385 ‘denote-directory’. If the user input does not have any matches, 2386 ‘denote-open-or-create’ will call the ‘denote’ command interactively. 2387 It will then use whatever prompts ‘denote’ normally has, per the user 2388 option ‘denote-prompts’ (*note Standard note creation::). 2389 2390 To speed up the process or to maintain variants that suit one’s 2391 workflow, we provide these ready-to-use commands that one can add to 2392 their Emacs init file. They can be assigned to key bindings or be used 2393 via ‘M-x’ after they have been evaluated. 2394 2395 ;;;###autoload 2396 (defun denote-open-or-create-with-date () 2397 "Invoke `denote-open-or-create' but also prompt for date. 2398 2399 The date can be in YEAR-MONTH-DAY notation like 2022-06-30 or 2400 that plus the time: 2022-06-16 14:30. When the user option 2401 `denote-date-prompt-use-org-read-date' is non-nil, the date 2402 prompt uses the more powerful Org+calendar system. 2403 2404 This is the equivalent to calling `denote-open-or-create' when 2405 `denote-prompts' is set to \\='(date title keywords)." 2406 (declare (interactive-only t)) 2407 (interactive) 2408 (let ((denote-prompts '(date title keywords))) 2409 (call-interactively #'denote-open-or-create))) 2410 2411 ;;;###autoload 2412 (defun denote-open-or-create-with-type () 2413 "Invoke `denote-open-or-create' but also prompt for file type. 2414 This is the equivalent to calling `denote-open-or-create' when 2415 `denote-prompts' is set to \\='(type title keywords)." 2416 (declare (interactive-only t)) 2417 (interactive) 2418 (let ((denote-prompts '(type title keywords))) 2419 (call-interactively #'denote-open-or-create))) 2420 2421 ;;;###autoload 2422 (defun denote-open-or-create-with-subdirectory () 2423 "Invoke `denote-open-or-create' but also prompt for subdirectory. 2424 This is the equivalent to calling `denote-open-or-create' when 2425 `denote-prompts' is set to \\='(subdirectory title keywords)." 2426 (declare (interactive-only t)) 2427 (interactive) 2428 (let ((denote-prompts '(subdirectory title keywords))) 2429 (call-interactively #'denote-open-or-create))) 2430 2431 ;;;###autoload 2432 (defun denote-open-or-create-with-template () 2433 "Invoke `denote-open-or-create' but also prompt for template. 2434 This is the equivalent to calling `denote-open-or-create' when 2435 `denote-prompts' is set to \\='(template title keywords). 2436 2437 For templates, refer to `denote-templates'." 2438 (declare (interactive-only t)) 2439 (interactive) 2440 (let ((denote-prompts '(template title keywords))) 2441 (call-interactively #'denote-open-or-create))) 2442 2443 2444 File: docvTU8YZ.info, Node: Variants of denote-link-or-create, Prev: Variants of denote-open-or-create, Up: Extending Denote 2445 2446 10.13 Variants of ‘denote-link-or-create’ 2447 ========================================= 2448 2449 The command ‘denote-link-or-create’ uses ‘denote-link’ on a ‘TARGET’ 2450 file, creating it if necessary. The ‘TARGET’ matches the user input at 2451 a minibuffer prompt: it is a file in the ‘denote-directory’. 2452 2453 If ‘TARGET’ file does not exist, The ‘denote-link-or-create’ calls 2454 ‘denote-link-after-creating’ which runs the standard ‘denote’ command 2455 interactively to create the file (*note Standard note creation::). The 2456 established link will then be targeting that new file. 2457 2458 When called with an optional prefix argument (‘C-u’ by default) 2459 ‘denote-link-or-create’ creates a link that consists of just the 2460 identifier. Else it tries to also include the file’s title. This has 2461 the same meaning as in ‘denote-link’ (*note Linking notes::). 2462 2463 To speed up the process or to maintain variants that suit one’s 2464 workflow, we provide these ready-to-use commands that one can add to 2465 their Emacs init file. They can be assigned to key bindings or be used 2466 via ‘M-x’ after they have been evaluated. 2467 2468 ;;;###autoload 2469 (defun denote-link-or-create-with-date () 2470 "Invoke `denote-link-or-create' but also prompt for date. 2471 2472 The date can be in YEAR-MONTH-DAY notation like 2022-06-30 or 2473 that plus the time: 2022-06-16 14:30. When the user option 2474 `denote-date-prompt-use-org-read-date' is non-nil, the date 2475 prompt uses the more powerful Org+calendar system. 2476 2477 This is the equivalent to calling `denote-link-or-create' when 2478 `denote-prompts' is set to \\='(date title keywords)." 2479 (declare (interactive-only t)) 2480 (interactive) 2481 (let ((denote-prompts '(date title keywords))) 2482 (call-interactively #'denote-link-or-create))) 2483 2484 ;;;###autoload 2485 (defun denote-link-or-create-with-type () 2486 "Invoke `denote-link-or-create' but also prompt for file type. 2487 This is the equivalent to calling `denote-link-or-create' when 2488 `denote-prompts' is set to \\='(type title keywords)." 2489 (declare (interactive-only t)) 2490 (interactive) 2491 (let ((denote-prompts '(type title keywords))) 2492 (call-interactively #'denote-link-or-create))) 2493 2494 ;;;###autoload 2495 (defun denote-link-or-create-with-subdirectory () 2496 "Invoke `denote-link-or-create' but also prompt for subdirectory. 2497 This is the equivalent to calling `denote-link-or-create' when 2498 `denote-prompts' is set to \\='(subdirectory title keywords)." 2499 (declare (interactive-only t)) 2500 (interactive) 2501 (let ((denote-prompts '(subdirectory title keywords))) 2502 (call-interactively #'denote-link-or-create))) 2503 2504 ;;;###autoload 2505 (defun denote-link-or-create-with-template () 2506 "Invoke `denote-link-or-create' but also prompt for template. 2507 This is the equivalent to calling `denote-link-or-create' when 2508 `denote-prompts' is set to \\='(template title keywords). 2509 2510 For templates, refer to `denote-templates'." 2511 (declare (interactive-only t)) 2512 (interactive) 2513 (let ((denote-prompts '(template title keywords))) 2514 (call-interactively #'denote-link-or-create))) 2515 2516 2517 File: docvTU8YZ.info, Node: Installation, Next: Sample configuration, Prev: Extending Denote, Up: Top 2518 2519 11 Installation 2520 *************** 2521 2522 * Menu: 2523 2524 * GNU ELPA package:: 2525 * Manual installation:: 2526 2527 2528 File: docvTU8YZ.info, Node: GNU ELPA package, Next: Manual installation, Up: Installation 2529 2530 11.1 GNU ELPA package 2531 ===================== 2532 2533 The package is available as ‘denote’. Simply do: 2534 2535 M-x package-refresh-contents 2536 M-x package-install 2537 2538 And search for it. 2539 2540 GNU ELPA provides the latest stable release. Those who prefer to 2541 follow the development process in order to report bugs or suggest 2542 changes, can use the version of the package from the GNU-devel ELPA 2543 archive. Read: 2544 <https://protesilaos.com/codelog/2022-05-13-emacs-elpa-devel/>. 2545 2546 2547 File: docvTU8YZ.info, Node: Manual installation, Prev: GNU ELPA package, Up: Installation 2548 2549 11.2 Manual installation 2550 ======================== 2551 2552 Assuming your Emacs files are found in ‘~/.emacs.d/’, execute the 2553 following commands in a shell prompt: 2554 2555 cd ~/.emacs.d 2556 2557 # Create a directory for manually-installed packages 2558 mkdir manual-packages 2559 2560 # Go to the new directory 2561 cd manual-packages 2562 2563 # Clone this repo, naming it "denote" 2564 git clone https://git.sr.ht/~protesilaos/denote denote 2565 2566 Finally, in your ‘init.el’ (or equivalent) evaluate this: 2567 2568 ;; Make Elisp files in that directory available to the user. 2569 (add-to-list 'load-path "~/.emacs.d/manual-packages/denote") 2570 2571 Everything is in place to set up the package. 2572 2573 2574 File: docvTU8YZ.info, Node: Sample configuration, Next: For developers or advanced users, Prev: Installation, Up: Top 2575 2576 12 Sample configuration 2577 *********************** 2578 2579 (require 'denote) 2580 2581 ;; Remember to check the doc strings of those variables. 2582 (setq denote-directory (expand-file-name "~/Documents/notes/")) 2583 (setq denote-known-keywords '("emacs" "philosophy" "politics" "economics")) 2584 (setq denote-infer-keywords t) 2585 (setq denote-sort-keywords t) 2586 (setq denote-file-type nil) ; Org is the default, set others here 2587 (setq denote-prompts '(title keywords)) 2588 (setq denote-excluded-directories-regexp nil) 2589 (setq denote-excluded-keywords-regexp nil) 2590 2591 ;; Pick dates, where relevant, with Org's advanced interface: 2592 (setq denote-date-prompt-use-org-read-date t) 2593 2594 2595 ;; Read this manual for how to specify `denote-templates'. We do not 2596 ;; include an example here to avoid potential confusion. 2597 2598 2599 ;; We allow multi-word keywords by default. The author's personal 2600 ;; preference is for single-word keywords for a more rigid workflow. 2601 (setq denote-allow-multi-word-keywords t) 2602 2603 (setq denote-date-format nil) ; read doc string 2604 2605 ;; By default, we do not show the context of links. We just display 2606 ;; file names. This provides a more informative view. 2607 (setq denote-backlinks-show-context t) 2608 2609 ;; Also see `denote-link-backlinks-display-buffer-action' which is a bit 2610 ;; advanced. 2611 2612 ;; If you use Markdown or plain text files (Org renders links as buttons 2613 ;; right away) 2614 (add-hook 'find-file-hook #'denote-link-buttonize-buffer) 2615 2616 ;; We use different ways to specify a path for demo purposes. 2617 (setq denote-dired-directories 2618 (list denote-directory 2619 (thread-last denote-directory (expand-file-name "attachments")) 2620 (expand-file-name "~/Documents/books"))) 2621 2622 ;; Generic (great if you rename files Denote-style in lots of places): 2623 ;; (add-hook 'dired-mode-hook #'denote-dired-mode) 2624 ;; 2625 ;; OR if only want it in `denote-dired-directories': 2626 (add-hook 'dired-mode-hook #'denote-dired-mode-in-directories) 2627 2628 ;; Here is a custom, user-level command from one of the examples we 2629 ;; showed in this manual. We define it here and add it to a key binding 2630 ;; below. 2631 (defun my-denote-journal () 2632 "Create an entry tagged 'journal', while prompting for a title." 2633 (interactive) 2634 (denote 2635 (denote--title-prompt) 2636 '("journal"))) 2637 2638 ;; Denote DOES NOT define any key bindings. This is for the user to 2639 ;; decide. For example: 2640 (let ((map global-map)) 2641 (define-key map (kbd "C-c n j") #'my-denote-journal) ; our custom command 2642 (define-key map (kbd "C-c n n") #'denote) 2643 (define-key map (kbd "C-c n N") #'denote-type) 2644 (define-key map (kbd "C-c n d") #'denote-date) 2645 (define-key map (kbd "C-c n s") #'denote-subdirectory) 2646 (define-key map (kbd "C-c n t") #'denote-template) 2647 ;; If you intend to use Denote with a variety of file types, it is 2648 ;; easier to bind the link-related commands to the `global-map', as 2649 ;; shown here. Otherwise follow the same pattern for `org-mode-map', 2650 ;; `markdown-mode-map', and/or `text-mode-map'. 2651 (define-key map (kbd "C-c n i") #'denote-link) ; "insert" mnemonic 2652 (define-key map (kbd "C-c n I") #'denote-link-add-links) 2653 (define-key map (kbd "C-c n b") #'denote-link-backlinks) 2654 (define-key map (kbd "C-c n f f") #'denote-link-find-file) 2655 (define-key map (kbd "C-c n f b") #'denote-link-find-backlink) 2656 ;; Note that `denote-rename-file' can work from any context, not just 2657 ;; Dired bufffers. That is why we bind it here to the `global-map'. 2658 (define-key map (kbd "C-c n r") #'denote-rename-file) 2659 (define-key map (kbd "C-c n R") #'denote-rename-file-using-front-matter)) 2660 2661 ;; Key bindings specifically for Dired. 2662 (let ((map dired-mode-map)) 2663 (define-key map (kbd "C-c C-d C-i") #'denote-link-dired-marked-notes) 2664 (define-key map (kbd "C-c C-d C-r") #'denote-dired-rename-marked-files) 2665 (define-key map (kbd "C-c C-d C-R") #'denote-dired-rename-marked-files-using-front-matter)) 2666 2667 (with-eval-after-load 'org-capture 2668 (setq denote-org-capture-specifiers "%l\n%i\n%?") 2669 (add-to-list 'org-capture-templates 2670 '("n" "New note (with denote.el)" plain 2671 (file denote-last-path) 2672 #'denote-org-capture 2673 :no-save t 2674 :immediate-finish nil 2675 :kill-buffer t 2676 :jump-to-captured t))) 2677 2678 ;; Also check the commands `denote-link-after-creating', 2679 ;; `denote-link-or-create'. You may want to bind them to keys as well. 2680 2681 2682 File: docvTU8YZ.info, Node: For developers or advanced users, Next: Contributing, Prev: Sample configuration, Up: Top 2683 2684 13 For developers or advanced users 2685 *********************************** 2686 2687 Denote is in a stable state and can be relied upon as the basis for 2688 custom extensions. Further below is a list with the functions or 2689 variables we provide for public usage. Those are in addition to all 2690 user options and commands that are already documented in the various 2691 sections of this manual. 2692 2693 In this context “public” is any form with single hyphens in its 2694 symbol, such as ‘denote-directory-files’. We expressly support those, 2695 meaning that we consider them reliable and commit to documenting any 2696 changes in their particularities (such as through ‘make-obsolete’, a 2697 record in the change log, a blog post on the maintainer’s website, and 2698 the like). 2699 2700 By contradistinction, a “private” form is declared with two hyphens 2701 in its symbol such as ‘denote--file-extension’. Do not use those as we 2702 might change them without further notice. 2703 2704 Variable ‘denote-id-format’ 2705 Format of ID prefix of a note’s filename. The note’s ID is derived 2706 from the date and time of its creation (*note The file-naming 2707 scheme::). 2708 2709 Variable ‘denote-id-regexp’ 2710 Regular expression to match ‘denote-id-format’. 2711 2712 Variable ‘denote-title-regexp’ 2713 Regular expression to match the TITLE field in a file name (*note 2714 The file-naming scheme::). 2715 2716 Variable ‘denote-keywords-regexp’ 2717 Regular expression to match the KEYWORDS field in a file name 2718 (*note The file-naming scheme::). 2719 2720 Variable ‘denote-excluded-punctuation-regexp’ 2721 Punctionation that is removed from file names. We consider those 2722 characters illegal for our purposes. 2723 2724 Variable ‘denote-excluded-punctuation-extra-regexp’ 2725 Additional punctuation that is removed from file names. This 2726 variable is for advanced users who need to extend the 2727 ‘denote-excluded-punctuation-regexp’. Once we have a better 2728 understanding of what we should be omitting, we will update things 2729 accordingly. 2730 2731 Function ‘denote-file-is-note-p’ 2732 Return non-nil if ‘FILE’ is an actual Denote note. For our 2733 purposes, a note must not be a directory, must satisfy 2734 ‘file-regular-p’, its path must be part of the variable 2735 ‘denote-directory’, it must have a Denote identifier in its name, 2736 and use one of the extensions implied by ‘denote-file-type’. 2737 2738 Function ‘denote-file-has-identifier-p’ 2739 Return non-nil if ‘FILE’ has a Denote identifier. 2740 2741 Function ‘denote-file-has-supported-extension-p’ 2742 Return non-nil if ‘FILE’ has supported extension. Also account for 2743 the possibility of an added ‘.gpg’ suffix. Supported extensions 2744 are those implied by ‘denote-file-type’. 2745 2746 Function ‘denote-file-is-writable-and-supported-p’ 2747 Return non-nil if ‘FILE’ is writable and has supported extension. 2748 2749 Function ‘denote-keywords’ 2750 Return appropriate list of keyword candidates. If 2751 ‘denote-infer-keywords’ is non-nil, infer keywords from existing 2752 notes and combine them into a list with ‘denote-known-keywords’. 2753 Else use only the latter set of keywords (*note Standard note 2754 creation::). 2755 2756 Function ‘denote-keywords-sort’ 2757 Sort ‘KEYWORDS’ if ‘denote-sort-keywords’ is non-nil. ‘KEYWORDS’ 2758 is a list of strings, per ‘denote-keywords-prompt’. 2759 2760 Function ‘denote-directory’ 2761 Return path of the variable ‘denote-directory’ as a proper 2762 directory, also because it accepts a directory-local value for what 2763 we internally refer to as “silos” (*note Maintain separate 2764 directories for notes: Maintain separate directory silos for 2765 notes.). 2766 2767 Function ‘denote-directory-files’ 2768 Return list of absolute file paths in variable ‘denote-directory’. 2769 Files only need to have an identifier. The return value may thus 2770 include file types that are not implied by ‘denote-file-type’. To 2771 limit the return value to text files, use the function 2772 ‘denote-directory-text-only-files’. Remember that the 2773 ‘denote-directory’ accepts a directory-local value (*note Maintain 2774 separate directories for notes: Maintain separate directory silos 2775 for notes.). 2776 2777 Function ‘denote-directory-text-only-files’ 2778 Return list of text files in variable ‘denote-directory’. Filter 2779 ‘denote-directory-files’ using ‘denote-file-is-note-p’. 2780 2781 Function ‘denote-directory-subdirectories’ 2782 Return list of subdirectories in variable ‘denote-directory’. Omit 2783 dotfiles (such as .git) unconditionally. Also exclude whatever 2784 matches ‘denote-excluded-directories-regexp’. Note that the 2785 ‘denote-directory’ accepts a directory-local value for what we call 2786 “silos” (*note Maintain separate directories for notes: Maintain 2787 separate directory silos for notes.). 2788 2789 Function ‘denote-directory-files-matching-regexp’ 2790 Return list of files matching ‘REGEXP’ in ‘denote-directory-files’. 2791 2792 Function ‘denote-file-name-relative-to-denote-directory’ 2793 Return name of ‘FILE’ relative to the variable ‘denote-directory’. 2794 ‘FILE’ must be an absolute path. 2795 2796 Function ‘denote-get-path-by-id’ 2797 Return absolute path of ‘ID’ string in ‘denote-directory-files’. 2798 2799 Function ‘denote-barf-duplicate-id’ 2800 Throw a ‘user-error’ if ‘IDENTIFIER’ already exists. 2801 2802 Function ‘denote-sluggify’ 2803 Make ‘STR’ an appropriate slug for file names and related (*note 2804 Sluggified title and keywords::). 2805 2806 Function ‘denote-sluggify-and-join’ 2807 Sluggify ‘STR’ while joining separate words. 2808 2809 Function ‘denote-desluggify’ 2810 Upcase first char in ‘STR’ and dehyphenate ‘STR’, inverting 2811 ‘denote-sluggify’. Basically, convert ‘this-is-a-test’ to ‘This is 2812 a test’. 2813 2814 Function ‘denote-sluggify-keywords’ 2815 Sluggify ‘KEYWORDS’, which is a list of strings (*note Sluggified 2816 title and keywords::). 2817 2818 Function ‘denote-filetype-heuristics’ 2819 Return likely file type of ‘FILE’. Use the file extension to 2820 detect the file type of the file. 2821 2822 If more than one file type correspond to this file extension, use 2823 the first file type for which the key-title-kegexp matches in the 2824 file or, if none matches, use the first type with this file 2825 extension in ‘denote-file-type’. 2826 2827 If no file types in ‘denote-file-types’ has the file extension, the 2828 file type is assumed to be the first of ‘denote-file-types’. 2829 2830 Function ‘denote-format-file-name’ 2831 Format file name. ‘PATH’, ‘ID’, ‘KEYWORDS’, ‘TITLE-SLUG’ are 2832 expected to be supplied by ‘denote’ or equivalent: they will all be 2833 converted into a single string. ‘EXTENSION’ is the file type 2834 extension, as a string. 2835 2836 Function ‘denote-extract-keywords-from-path’ 2837 Extract keywords from ‘PATH’ and return them as a list of strings. 2838 ‘PATH’ must be a Denote-style file name where keywords are prefixed 2839 with an underscore. If ‘PATH’ has no such keywords, which is 2840 possible, return nil (*note The file-naming scheme::). 2841 2842 Function ‘denote-extract-id-from-string’ 2843 Return existing Denote identifier in ‘STRING’, else nil. 2844 2845 Function ‘denote-retrieve-filename-identifier’ 2846 Extract identifier from ‘FILE’ name. To return an existing 2847 identifier or create a new one, refer to the 2848 ‘denote-retrieve-or-create-file-identifier’ function. 2849 2850 Function ‘denote-retrieve-or-create-file-identifier’ 2851 Return ‘FILE’ identifier, generating one if appropriate. The 2852 conditions are as follows: 2853 2854 • If ‘FILE’ has an identifier, return it. 2855 2856 • If ‘FILE’ does not have an identifier and optional ‘DATE’ is 2857 non-nil, invoke ‘denote-prompt-for-date-return-id’. 2858 2859 • If ‘FILE’ does not have an identifier and DATE is nil, use the 2860 file attributes to determine the last modified date and format 2861 it as an identifier. 2862 2863 • As a fallback, derive an identifier from the current time. 2864 2865 To only return an existing identifier, refer to the function 2866 ‘denote-retrieve-filename-identifier’. 2867 2868 Function ‘denote-retrieve-filename-title’ 2869 Extract title from ‘FILE’ name, else return ‘file-name-base’. Run 2870 ‘denote-desluggify’ on the title if the extraction is successful. 2871 2872 Function ‘denote-retrieve-title-value’ 2873 Return title value from ‘FILE’ front matter per ‘FILE-TYPE’. 2874 2875 Function ‘denote-retrieve-title-line’ 2876 Return title line from ‘FILE’ front matter per ‘FILE-TYPE’. 2877 2878 Function ‘denote-retrieve-keywords-value’ 2879 Return keywords value from ‘FILE’ front matter per ‘FILE-TYPE’. 2880 2881 Function ‘denote-retrieve-keywords-line’ 2882 Return keywords line from ‘FILE’ front matter per ‘FILE-TYPE’. 2883 2884 Function ‘denote-file-prompt’ 2885 Prompt for file with identifier in variable ‘denote-directory’. 2886 With optional ‘INITIAL-TEXT’, use it to prepopulate the minibuffer. 2887 2888 Function ‘denote-keywords-prompt’ 2889 Prompt for one or more keywords. In the case of multiple entries, 2890 those are separated by the ‘crm-sepator’, which typically is a 2891 comma. In such a scenario, the output is sorted with 2892 ‘string-lessp’. To sort the return value, use 2893 ‘denote-keywords-sort’. 2894 2895 Function ‘denote-title-prompt’ 2896 Read file title for ‘denote’. With optional ‘DEFAULT-TITLE’ use it 2897 as the default value. 2898 2899 Function ‘denote-file-type-prompt’ 2900 Prompt for ‘denote-file-type’. Note that a non-nil value other 2901 than ‘text’, ‘markdown-yaml’, and ‘markdown-toml’ falls back to an 2902 Org file type. We use ‘org’ here for clarity. 2903 2904 Function ‘denote-date-prompt’ 2905 Prompt for date, expecting ‘YYYY-MM-DD’ or that plus ‘HH:MM’ (or 2906 even ‘HH:MM:SS’). Use Org’s more advanced date selection utility 2907 if the user option ‘denote-date-prompt-use-org-read-date’ is 2908 non-nil. It requires Org (*note The 2909 denote-date-prompt-use-org-read-date option: The 2910 denote-date-prompt-use-org-read-date option.). 2911 2912 Function ‘denote-prompt-for-date-return-id’ 2913 Use ‘denote-date-prompt’ and return it as ‘denote-id-format’. 2914 2915 Function ‘denote-template-prompt’ 2916 Prompt for template key in ‘denote-templates’ and return its value. 2917 2918 Function ‘denote-subdirectory-prompt’ 2919 Prompt for subdirectory of the variable ‘denote-directory’. The 2920 table uses the ‘file’ completion category (so it works with 2921 packages such as ‘marginalia’ and ‘embark’). 2922 2923 Function ‘denote-rename-file-prompt’ 2924 Prompt to rename file named ‘OLD-NAME’ to ‘NEW-NAME’. 2925 2926 Function ‘denote-rename-file-and-buffer’ 2927 Rename file named ‘OLD-NAME’ to ‘NEW-NAME’, updating buffer name. 2928 2929 Function ‘denote-update-dired-buffers’ 2930 Update Dired buffers of variable ‘denote-directory’. Note that the 2931 ‘denote-directory’ accepts a directory-local value for what we 2932 internally refer to as “silos” (*note Maintain separate directories 2933 for notes: Maintain separate directory silos for notes.). 2934 2935 Variable ‘denote-file-types’ 2936 Alist of ‘denote-file-type’ and their format properties. 2937 2938 Each element is of the form ‘(SYMBOL PROPERTY-LIST)’. ‘SYMBOL’ is 2939 one of those specified in ‘denote-file-type’ or an arbitrary symbol 2940 that defines a new file type. 2941 2942 ‘PROPERTY-LIST’ is a plist that consists of eight elements: 2943 2944 1. ‘:extension’ is a string with the file extension including the 2945 period. 2946 2947 2. ‘:date-function’ is a function that can format a date. See 2948 the functions ‘denote--date-iso-8601’, ‘denote--date-rfc3339’, 2949 and ‘denote--date-org-timestamp’. 2950 2951 3. ‘:front-matter’ is either a string passed to ‘format’ or a 2952 variable holding such a string. The ‘format’ function accepts 2953 four arguments, which come from ‘denote’ in this order: 2954 ‘TITLE’, ‘DATE’, ‘KEYWORDS’, ‘IDENTIFIER’. Read the doc 2955 string of ‘format’ on how to reorder arguments. 2956 2957 4. ‘:title-key-regexp’ is a regular expression that is used to 2958 retrieve the title line in a file. The first line matching 2959 this regexp is considered the title line. 2960 2961 5. ‘:title-value-function’ is the function used to format the raw 2962 title string for inclusion in the front matter (e.g. to 2963 surround it with quotes). Use the ‘identity’ function if no 2964 further processing is required. 2965 2966 6. ‘:title-value-reverse-function’ is the function used to 2967 retrieve the raw title string from the front matter. It 2968 performs the reverse of ‘:title-value-function’. 2969 2970 7. ‘:keywords-key-regexp’ is a regular expression used to 2971 retrieve the keywords’ line in the file. The first line 2972 matching this regexp is considered the keywords’ line. 2973 2974 8. ‘:keywords-value-function’ is the function used to format the 2975 keywords’ list of strings as a single string, with appropriate 2976 delimiters, for inclusion in the front matter. 2977 2978 9. ‘:keywords-value-reverse-function’ is the function used to 2979 retrieve the keywords’ value from the front matter. It 2980 performs the reverse of the ‘:keywords-value-function’. 2981 2982 10. ‘:link’ is a string, or variable holding a string, that 2983 specifies the format of a link. See the variables 2984 ‘denote-org-link-format’, ‘denote-md-link-format’. 2985 2986 11. ‘:link-in-context-regexp’ is a regular expression that is 2987 used to match the aforementioned link format. See the 2988 variables ‘denote-org-link-in-context-regexp’, 2989 ‘denote-md-link-in-context-regexp’. 2990 2991 If ‘denote-file-type’ is nil, use the first element of this list 2992 for new note creation. The default is ‘org’. 2993 2994 Variable ‘denote-org-front-matter’ 2995 Specifies the Org front matter. It is passed to ‘format’ with 2996 arguments ‘TITLE’, ‘DATE’, ‘KEYWORDS’, ‘ID’ (*note Change the front 2997 matter format::) 2998 2999 Variable ‘denote-yaml-front-matter’ 3000 Specifies the YAML (Markdown) front matter. It is passed to 3001 ‘format’ with arguments ‘TITLE’, ‘DATE’, ‘KEYWORDS’, ‘ID’ (*note 3002 Change the front matter format::) 3003 3004 Variable ‘denote-toml-front-matter’ 3005 Specifies the TOML (Markdown) front matter. It is passed to 3006 ‘format’ with arguments ‘TITLE’, ‘DATE’, ‘KEYWORDS’, ‘ID’ (*note 3007 Change the front matter format::) 3008 3009 Variable ‘denote-text-front-matter’ 3010 Specifies the plain text front matter. It is passed to ‘format’ 3011 with arguments ‘TITLE’, ‘DATE’, ‘KEYWORDS’, ‘ID’ (*note Change the 3012 front matter format::) 3013 3014 Variable ‘denote-org-link-format’ 3015 Format of Org link to note. The value is passed to ‘format’ with 3016 ‘IDENTIFIER’ and ‘TITLE’ arguments, in this order. Also see 3017 ‘denote-org-link-in-context-regexp’. 3018 3019 Variable ‘denote-md-link-format’ 3020 Format of Markdown link to note. The ‘%N$s’ notation used in the 3021 default value is for ‘format’ as the supplied arguments are 3022 ‘IDENTIFIER’ and ‘TITLE’, in this order. Also see 3023 ‘denote-md-link-in-context-regexp’. 3024 3025 Variable ‘denote-id-only-link-format’ 3026 Format of identifier-only link to note. The value is passed to 3027 ‘format’ with ‘IDENTIFIER’ as its sole argument. Also see 3028 ‘denote-id-only-link-in-context-regexp’. 3029 3030 Variable ‘denote-org-link-in-context-regexp’ 3031 Regexp to match an Org link in its context. The format of such 3032 links is ‘denote-org-link-format’. 3033 3034 Variable ‘denote-md-link-in-context-regexp’ 3035 Regexp to match an Markdown link in its context. The format of 3036 such links is ‘denote-md-link-format’. 3037 3038 Variable ‘denote-id-only-link-in-context-regexp’ 3039 Regexp to match an identifier-only link in its context. The format 3040 of such links is ‘denote-id-only-link-format’. 3041 3042 Function ‘denote-surround-with-quotes’ 3043 Surround string ‘S’ with quotes. This can be used in 3044 ‘denote-file-types’ to format front mattter. 3045 3046 Function ‘denote-date-org-timestamp’ 3047 Format ‘DATE’ using the Org inactive timestamp notation. 3048 3049 Function ‘denote-date-rfc3339’ 3050 Format ‘DATE’ using the RFC3339 specification. 3051 3052 Function ‘denote-date-iso-8601’ 3053 Format ‘DATE’ according to ISO 8601 standard. 3054 3055 Function ‘denote-trim-whitespace’ 3056 Trim whitespace around string ‘S’. This can be used in 3057 ‘denote-file-types’ to format front mattter. 3058 3059 Function ‘denote-trim-whitespace-then-quotes’ 3060 Trim whitespace then quotes around string ‘S’. This can be used in 3061 ‘denote-file-types’ to format front mattter. 3062 3063 Function ‘denote-format-keywords-for-md-front-matter’ 3064 Format front matter ‘KEYWORDS’ for markdown file type. ‘KEYWORDS’ 3065 is a list of strings. Consult the ‘denote-file-types’ for how this 3066 is used. 3067 3068 Function ‘denote-format-keywords-for-text-front-matter’ 3069 Format front matter ‘KEYWORDS’ for text file type. ‘KEYWORDS’ is a 3070 list of strings. Consult the ‘denote-file-types’ for how this is 3071 used. 3072 3073 Function ‘denote-format-keywords-for-org-front-matter’ 3074 Format front matter ‘KEYWORDS’ for org file type. ‘KEYWORDS’ is a 3075 list of strings. Consult the ‘denote-file-types’ for how this is 3076 used. 3077 3078 Function ‘denote-extract-keywords-from-front-matter’ 3079 Format front matter ‘KEYWORDS’ for org file type. ‘KEYWORDS’ is a 3080 list of strings. Consult the ‘denote-file-types’ for how this is 3081 used. 3082 3083 3084 File: docvTU8YZ.info, Node: Contributing, Next: Things to do, Prev: For developers or advanced users, Up: Top 3085 3086 14 Contributing 3087 *************** 3088 3089 Denote is a GNU ELPA package. As such, any significant change to the 3090 code requires copyright assignment to the Free Software Foundation (more 3091 below). 3092 3093 You do not need to be a programmer to contribute to this package. 3094 Sharing an idea or describing a workflow is equally helpful, as it 3095 teaches us something we may not know and might be able to cover either 3096 by extending Denote or expanding this manual (*note Things to do::). If 3097 you prefer to write a blog post, make sure you share it with us: we can 3098 add a section herein referencing all such articles. Everyone gets 3099 acknowledged (*note Acknowledgements::). There is no such thing as an 3100 “insignificant contribution”—they all matter. 3101 3102 • Package name (GNU ELPA): ‘denote’ 3103 • Official manual: <https://protesilaos.com/emacs/denote> 3104 • Change log: <https://protesilaos.com/emacs/denote-changelog> 3105 • Git repo on SourceHut: <https://git.sr.ht/~protesilaos/denote> 3106 • Mirrors: 3107 • GitHub: <https://github.com/protesilaos/denote> 3108 • GitLab: <https://gitlab.com/protesilaos/denote> 3109 • Mailing list: <https://lists.sr.ht/~protesilaos/denote> 3110 3111 If our public media are not suitable, you are welcome to contact me 3112 (Protesilaos) in private: <https://protesilaos.com/contact>. 3113 3114 Copyright assignment is a prerequisite to sharing code. It is a 3115 simple process. Check the request form below (please adapt it 3116 accordingly). You must write an email to the address mentioned in the 3117 form and then wait for the FSF to send you a legal agreement. Sign the 3118 document and file it back to them. This could all happen via email and 3119 take about a week. You are encouraged to go through this process. You 3120 only need to do it once. It will allow you to make contributions to 3121 Emacs in general. 3122 3123 Please email the following information to assign@gnu.org, and we 3124 will send you the assignment form for your past and future changes. 3125 3126 Please use your full legal name (in ASCII characters) as the subject 3127 line of the message. 3128 3129 REQUEST: SEND FORM FOR PAST AND FUTURE CHANGES 3130 3131 [What is the name of the program or package you're contributing to?] 3132 3133 GNU Emacs 3134 3135 [Did you copy any files or text written by someone else in these changes? 3136 Even if that material is free software, we need to know about it.] 3137 3138 Copied a few snippets from the same files I edited. Their author, 3139 Protesilaos Stavrou, has already assigned copyright to the Free Software 3140 Foundation. 3141 3142 [Do you have an employer who might have a basis to claim to own 3143 your changes? Do you attend a school which might make such a claim?] 3144 3145 3146 [For the copyright registration, what country are you a citizen of?] 3147 3148 3149 [What year were you born?] 3150 3151 3152 [Please write your email address here.] 3153 3154 3155 [Please write your postal address here.] 3156 3157 3158 3159 3160 3161 [Which files have you changed so far, and which new files have you written 3162 so far?] 3163 3164 3165 3166 File: docvTU8YZ.info, Node: Things to do, Next: Publications about Denote, Prev: Contributing, Up: Top 3167 3168 15 Things to do 3169 *************** 3170 3171 Denote should work well for what is described in this manual. Though we 3172 can always do better. This is a non-exhaustive list with some 3173 low-priority ideas you may want to help with (*note Contributing::). 3174 3175 • Support mutually-exclusive sets of tags. For example, a ‘home’ 3176 keyword would preclude ‘work’. Personally, I am not a fan of such 3177 arrangements as there may be a case where something applies to both 3178 ends of this prefigured binary. Though we can think about it. 3179 3180 • Add command that expands the identifier in links to a full file 3181 name. This would be useful for some sort of “export” operation 3182 where the absolute file path is necessary and where the Denote 3183 linking mechanism is not available. Though this could be handled 3184 by the exporter, by doing something like what 3185 ‘denote-link-find-file’ does. 3186 3187 • Add command that rewrites full names in links, if they are invalid. 3188 This would complement the renaming mechanism. Personally, I think 3189 old titles in links are not a problem, because they show you what 3190 was true at the time and are usually relevant to their context. 3191 Again though, it is an option worth exploring. 3192 3193 • Ensure integration between ‘denote:’ links and the ‘embark’ 3194 package. The idea is to allow Embark to understand the Denote 3195 buttons are links to files and correctly infer the absolute path. 3196 I am not sure what a user would want to do with this, but maybe 3197 there are some interesting possibilities. 3198 3199 You are welcome to suggest more ideas. If they do not broaden the 3200 scope of Denote, they can be added to denote.el. Otherwise we might 3201 think of extensions to the core package. 3202 3203 3204 File: docvTU8YZ.info, Node: Publications about Denote, Next: Alternatives to Denote, Prev: Things to do, Up: Top 3205 3206 16 Publications about Denote 3207 **************************** 3208 3209 The Emacs community is putting Denote to great use. This section 3210 includes publications that show how people configure their note-taking 3211 setup. If you have a blog post, video, or configuration file about 3212 Denote, feel welcome to tell us about it (*note Contributing::). 3213 3214 • David Wilson (SystemCrafters): _Generating a Blog Site from Denote 3215 Entries_, 2022-09-09, 3216 <https://www.youtube.com/watch?v=5R7ad5xz5wo>. 3217 3218 • David Wilson (SystemCrafters): _Trying Out Prot’s Denote, an Org 3219 Roam Alternative?_, 2022-07-15, 3220 <https://www.youtube.com/watch?v=QcRY_rsX0yY>. 3221 3222 • Jack Baty: _Keeping my Org Agenda updated based on Denote 3223 keywords_, 2022-11-30, 3224 <https://baty.net/2022/keeping-my-org-agenda-updated>. 3225 3226 • Jeremy Friesen: _Denote Emacs Configuration_, 2022-10-02, 3227 <https://takeonrules.com/2022/10/09/denote-emacs-configuration/> 3228 3229 • Jeremy Friesen: _Exploring the Denote Emacs Package_, 2022-10-01, 3230 <https://takeonrules.com/2022/10/01/exploring-the-denote-emacs-package/> 3231 3232 • Jeremy Friesen: _Migration Plan for Org-Roam Notes to Denote_, 3233 2022-10-02, 3234 <https://takeonrules.com/2022/10/02/migration-plan-for-org-roam-notes-to-denote/> 3235 3236 • Jeremy Friesen: _Project Dispatch Menu with Org Mode Metadata, 3237 Denote, and Transient_, 2022-11-19, 3238 <https://takeonrules.com/2022/11/19/project-dispatch-menu-with-org-mode-metadata-denote-and-transient/> 3239 3240 • Peter Prevos: _Simulating Text Files with R to Test the Emacs 3241 Denote Package_, 2022-07-28, 3242 <https://lucidmanager.org/productivity/testing-denote-package/>. 3243 3244 3245 File: docvTU8YZ.info, Node: Alternatives to Denote, Next: Frequently Asked Questions, Prev: Publications about Denote, Up: Top 3246 3247 17 Alternatives to Denote 3248 ************************* 3249 3250 What follows is a list of Emacs packages for note-taking. I 3251 (Protesilaos) have not used any of them, as I was manually applying my 3252 file-naming scheme beforehand and by the time those packages were 3253 available I was already hacking on the predecessor of Denote as a means 3254 of learning Emacs Lisp (a package which I called “Unassuming Sidenotes 3255 of Little Significance”, aka “USLS” which is pronounced as “U-S-L-S” or 3256 “useless”). As such, I cannot comment at length on the differences 3257 between Denote and each of those packages, beside what I gather from 3258 their documentation. 3259 3260 org-roam (https://github.com/org-roam/org-roam) 3261 The de facto standard in the Emacs milieu—and rightly so! It has a 3262 massive community, is featureful, and should be an excellent 3263 companion to anyone who is invested in the Org ecosystem and/or 3264 knows what “Roam” is (I don’t). It has been explained to me that 3265 Org Roam uses a database to store a cache about your notes. It 3266 otherwise uses standard Org files. The cache helps refer to the 3267 same node through aliases which can provide lots of options. 3268 Personally, I follow a single-topic-per-note approach, so anything 3269 beyond that is overkill. If the database is only for a cache, then 3270 maybe that has no downside, though I am careful with any kind of 3271 specialised program as it creates a dependency. If you ask me 3272 about database software in particular, I have no idea how to use 3273 one, let alone debug it or retrieve data from it if something goes 3274 awry (I could learn, but that is beside the point). 3275 3276 zk (or zk.el) (https://github.com/localauthor/zk) 3277 Reading its documentation makes me think that this is Denote’s 3278 sibling—the two projects have a lot of things in common, including 3279 the preference to rely on plain files and standard tools. The core 3280 difference is that Denote has a strict file-naming scheme. Other 3281 differences in available features are, in principle, matters of 3282 style or circumstance: both packages can have them. As its 3283 initials imply, ZK enables a zettelkasten-like workflow. It does 3284 not enforce it though, letting the user adapt the method to their 3285 needs and requirements. 3286 3287 zettelkasten (https://github.com/ymherklotz/emacs-zettelkasten) 3288 This is another one of Denote’s relatives, at least insofar as the 3289 goal of simplicity is concerned. The major difference is that 3290 according to its documentation “the name of the file that is 3291 created is just a unique ID”. This is not consistent with our 3292 file-naming scheme which is all about making sense of your files by 3293 their name alone and being able to visually parse a listing of them 3294 without any kind of specialised tool (e.g. ‘ls -l’ or ‘ls -C’ on 3295 the command-line from inside the ‘denote-directory’ give you a 3296 human-readable set of files names, while ‘find * -maxdepth 0 -type 3297 f’ is another approach). 3298 3299 zetteldeft (https://github.com/EFLS/zetteldeft) 3300 This is a zettelkasten note-taking system built on top of the 3301 ‘deft’ package. Deft provides a search interface to a directory, 3302 in this case the one holding the user’s ‘zetteldeft’ notes. Denote 3303 has no such dependency and is not opinionated about how the user 3304 prefers to search/access their notes: use Dired, Grep, the 3305 ‘consult’ package, or whatever else you already have set up for all 3306 things Emacs, not just your notes. 3307 3308 Searching through ‘M-x list-packages’ for “zettel” brings up more 3309 matches. ‘zetteldesk’ is an extension to Org Roam and, as such, I 3310 cannot possibly know what Org Roam truly misses and what the added-value 3311 of this package is. ‘neuron-mode’ builds on top of an external program 3312 called ‘neuron’, which I have never used. 3313 3314 Searching for “note” gives us a few more results. ‘notes-mode’ has 3315 precious little documentation and I cannot tell what it actually does 3316 (as I said in my presentation for LibrePlanet 2022, inadequate docs are 3317 a bug). ‘side-notes’ differs from what we try to do with Denote, as it 3318 basically gives you the means to record your thoughts about some other 3319 project you are working on and keep them on the side: so it and Denote 3320 should not be mutually exclusive. 3321 3322 If I missed something, please let me know. 3323 3324 * Menu: 3325 3326 * Alternative ideas with Emacs and further reading:: 3327 3328 3329 File: docvTU8YZ.info, Node: Alternative ideas with Emacs and further reading, Up: Alternatives to Denote 3330 3331 17.1 Alternative ideas with Emacs and further reading 3332 ===================================================== 3333 3334 This section covers blog posts from the Emacs community on the matter of 3335 note-taking. They may reference some of the packages covered in the 3336 previous section or provide their custom code (*note Alternatives to 3337 Denote::). The list is unsorted. 3338 3339 • José Antonio Ortega Ruiz (aka “jao”) explains a note-taking method 3340 that is simple like Denote but differs in other ways. An 3341 interesting approach overall: 3342 <https://jao.io/blog/2022-06-19-simple-note-taking.html>. 3343 3344 • Jethro Kuan (the main ‘org-roam’ developer) explains their 3345 note-taking techniques: 3346 <https://jethrokuan.github.io/org-roam-guide/>. Good ideas all 3347 round, regardless of the package/code you choose to use. 3348 3349 [ Development note: help expand this list. ] 3350 3351 3352 File: docvTU8YZ.info, Node: Frequently Asked Questions, Next: Acknowledgements, Prev: Alternatives to Denote, Up: Top 3353 3354 18 Frequently Asked Questions 3355 ***************************** 3356 3357 I (Protesilaos) answer some questions I have received or might get. It 3358 is assumed that you have read the rest of this manual: I will not go 3359 into the specifics of how Denote works. 3360 3361 * Menu: 3362 3363 * Why develop Denote when PACKAGE already exists?:: 3364 * Why not rely exclusively on Org?:: 3365 * Why care about Unix tools when you use Emacs?:: 3366 * Why many small files instead of few large ones?:: 3367 * Does Denote perform well at scale?:: 3368 * I add TODOs to my notes; will many files slow down the Org agenda?:: 3369 * I want to sort by last modified, why won’t Denote let me?: I want to sort by last modified why won't Denote let me?. 3370 * How do you handle the last modified case?:: 3371 * Speed up backlinks' buffer creation?:: 3372 * Why do I get ``Search failed with status 1'' when I search for backlinks?:: 3373 3374 3375 File: docvTU8YZ.info, Node: Why develop Denote when PACKAGE already exists?, Next: Why not rely exclusively on Org?, Up: Frequently Asked Questions 3376 3377 18.1 Why develop Denote when PACKAGE already exists? 3378 ==================================================== 3379 3380 I wrote Denote because I was using a variant of Denote’s file-naming 3381 scheme before I was even an Emacs user (I switched to Emacs from 3382 Tmux+Vim+CLI in the summer of 2019). I was originally inspired by 3383 Jekyll, the static site generator, which I started using for my website 3384 in 2016 (was on WordPress before). Jekyll’s files follow the 3385 ‘YYYY-MM-DD-TITLE.md’ pattern. I liked its efficiency relative to the 3386 unstructured mess I had before. Eventually, I started using that scheme 3387 outside the confines of my website’s source code. Over time I refined 3388 it and here we are. 3389 3390 Note-taking is something I take very seriously, as I am a prolific 3391 writer (just check my website, which only reveals the tip of the 3392 iceberg). As such, I need a program that does exactly what I want and 3393 which I know how to extend. I originally tried to use Org capture 3394 templates to create new files with a Denote-style file-naming scheme but 3395 never managed to achieve it. Maybe because ‘org-capture’ has some 3396 hard-coded assumptions or I simply am not competent enough to hack on 3397 core Org facilities. Whatever the case, an alternative was in order. 3398 3399 The existence of PACKAGE is never a good reason for me not to conduct 3400 my own experiments for recreational, educational, or practical purposes. 3401 When the question arises of “why not contribute to PACKAGE instead?” the 3402 answer is that without me experimenting in the first place, I would lack 3403 the skills for such a task. Furthermore, contributing to another 3404 package does not guarantee I get what I want in terms of workflow. 3405 3406 Whether you should use Denote or not is another matter altogether: 3407 choose whatever you want. 3408 3409 3410 File: docvTU8YZ.info, Node: Why not rely exclusively on Org?, Next: Why care about Unix tools when you use Emacs?, Prev: Why develop Denote when PACKAGE already exists?, Up: Frequently Asked Questions 3411 3412 18.2 Why not rely exclusively on Org? 3413 ===================================== 3414 3415 I think Org is one of Emacs’ killer apps. I also believe it is not the 3416 right tool for every job. When I write notes, I want to focus on 3417 writing. Nothing more. I thus have no need for stuff like org-babel, 3418 scheduling to-do items, clocking time, and so on. The more “mental 3419 dependencies” you add to your workflow, the heavier the burden you carry 3420 and the less focused you are on the task at hand: there is always that 3421 temptation to tweak the markup, tinker with some syntactic construct, 3422 obsess about what ought to be irrelevant to writing as such. 3423 3424 In technical terms, I also am not fond of Org’s code base (I 3425 understand why it is the way it is—just commenting on the fact). Ever 3426 tried to read it? You will routinely find functions that are 3427 tens-to-hundreds of lines long and have all sorts of special casing. As 3428 I am not a programmer and only learnt to write Elisp through trial and 3429 error, I have no confidence in my ability to make Org do what I want at 3430 that level, hence ‘denote’ instead of ‘org-denote’ or something. 3431 3432 Perhaps the master programmer is one who can deal with complexity and 3433 keep adding to it. I am of the opposite view, as language—code 3434 included—is at its communicative best when it is clear and accessible. 3435 3436 Make no mistake: I use Org for the agenda and also to write technical 3437 documentation that needs to be exported to various formats, including 3438 this very manual. 3439 3440 3441 File: docvTU8YZ.info, Node: Why care about Unix tools when you use Emacs?, Next: Why many small files instead of few large ones?, Prev: Why not rely exclusively on Org?, Up: Frequently Asked Questions 3442 3443 18.3 Why care about Unix tools when you use Emacs? 3444 ================================================== 3445 3446 My notes form part of my longer-term storage. I do not want to have to 3447 rely on a special program to be able to read them or filter them. Unix 3448 is universal, at least as far as I am concerned. 3449 3450 Denote streamlines some tasks and makes things easier in general, 3451 which is consistent with how Emacs provides a layer of interactivity on 3452 top of Unix. Still, Denote’s utilities can, in principle, be 3453 implemented as POSIX shell scripts (minus the Emacs-specific parts like 3454 fontification in Dired or the buttonization of links). 3455 3456 Portability matters. For example, in the future I might own a 3457 smartphone, so I prefer not to require Emacs, Org, or some other 3458 executable to access my files on the go. 3459 3460 Furthermore, I might want to share those files with someone. If I 3461 make Emacs a requirement, I am limiting my circle to a handful of 3462 relatively advanced users. 3463 3464 Please don’t misinterpret this: I am using Emacs full-time for my 3465 computing and maintain a growing list of packages for it. This is just 3466 me thinking long-term. 3467 3468 3469 File: docvTU8YZ.info, Node: Why many small files instead of few large ones?, Next: Does Denote perform well at scale?, Prev: Why care about Unix tools when you use Emacs?, Up: Frequently Asked Questions 3470 3471 18.4 Why many small files instead of few large ones? 3472 ==================================================== 3473 3474 I have read that Org favours the latter method. If true, I strongly 3475 disagree with it because of the implicit dependency it introduces and 3476 the way it favours machine-friendliness over human-readability in terms 3477 of accessing information. Notes are long-term storage. I might want to 3478 access them on (i) some device with limited features, (ii) print on 3479 paper, (iii) share with another person who is not a tech wizard. 3480 3481 There are good arguments for few large files, but all either 3482 prioritize machine-friendliness or presuppose the use of sophisticated 3483 tools like Emacs+Org. 3484 3485 Good luck using ‘less’ on a generic TTY to read a file with a zillion 3486 words, headings, sub-headings, sub-sub-headings, property drawers, and 3487 other constructs! You will not get the otherwise wonderful folding of 3488 headings the way you do in Emacs—do not take such features for granted. 3489 3490 My point is that notes should be atomic to help the user—and 3491 potentially the user’s family, friends, acquaintances—make sense of them 3492 in a wide range of scenaria. The more program-agnostic your file is, 3493 the better for you and/or everyone else you might share your writings 3494 with. 3495 3496 Human-readability means that we optimize for what matters to us. If 3497 (a) you are the only one who will ever read your notes, (b) always have 3498 access to good software like Emacs+Org, (c) do not care about printing 3499 on paper, then Denote’s model is not for you. Maybe you need to tweak 3500 some ‘org-capture’ template to append a new entry to one mega file (I do 3501 that for my Org agenda, by the way, as I explained before about using 3502 the right tool for the job). 3503 3504 3505 File: docvTU8YZ.info, Node: Does Denote perform well at scale?, Next: I add TODOs to my notes; will many files slow down the Org agenda?, Prev: Why many small files instead of few large ones?, Up: Frequently Asked Questions 3506 3507 18.5 Does Denote perform well at scale? 3508 ======================================= 3509 3510 Denote does not do anything fancy and has no special requirements: it 3511 uses standard tools to accomplish ordinary tasks. If Emacs can cope 3512 with lots of files, then that is all you need to know: Denote will work. 3513 3514 To put this to the test, Peter Prevos is running simulations with R 3515 that generate large volumes of notes. You can read the technicalities 3516 here: <https://lucidmanager.org/productivity/testing-denote-package/>. 3517 Excerpt: 3518 3519 Using this code I generated ten thousands notes and used this to 3520 test the Denote package to see it if works at a large scale. This 3521 tests shows that Prot’s approach is perfectly capable of working 3522 with thousands of notes. 3523 3524 Of course, we are always prepared to make refinements to the code, 3525 where necessary, without compromising on the project’s principles. 3526 3527 3528 File: docvTU8YZ.info, Node: I add TODOs to my notes; will many files slow down the Org agenda?, Next: I want to sort by last modified why won't Denote let me?, Prev: Does Denote perform well at scale?, Up: Frequently Asked Questions 3529 3530 18.6 I add TODOs to my notes; will many files slow down the Org agenda? 3531 ======================================================================= 3532 3533 Yes, many files will slow down the agenda due to how that works. Org 3534 collects all files specified in the ‘org-agenda-files’, searches through 3535 their contents for timestamped entries, and then loops through all days 3536 to determine where each entry belongs. The more days and more files, 3537 the longer it takes to build the agenda. Doing this with potentially 3538 hundreds of files will have a noticeable impact on performance. 3539 3540 This is not a deficiency of Denote. It happens with generic Org 3541 files. The way the agenda is built is heavily favoring the use of a 3542 single file that holds all your timestamped entries (or at least a few 3543 such files). Tens or hundreds of files are inefficient for this job. 3544 Plus doing so has the side-effect of making Emacs open all those files, 3545 which you probably do not need. 3546 3547 If you want my opinion though, be more forceful with the separation 3548 of concerns. Decouple your knowledge base from your ephemeral to-do 3549 list: Denote (and others) can be used for the former, while you let 3550 standard Org work splendidly for the latter—that is what I do, anyway. 3551 3552 Org has a powerful linking facility, whether you use ‘org-store-link’ 3553 or do it via an ‘org-capture’ template. If you want a certain note to 3554 be associated with a task, just store the task in a single ‘tasks.org’ 3555 (or however you name it) and link to the relevant context. 3556 3557 Do not mix your knowledge base with your to-do items. If you need 3558 help figuring out the specifics of this workflow, you are welcome to ask 3559 for help in our relevant channels (*note Contributing::). 3560 3561 3562 File: docvTU8YZ.info, Node: I want to sort by last modified why won't Denote let me?, Next: How do you handle the last modified case?, Prev: I add TODOs to my notes; will many files slow down the Org agenda?, Up: Frequently Asked Questions 3563 3564 18.7 I want to sort by last modified, why won’t Denote let me? 3565 ============================================================== 3566 3567 Denote does not sort files and will not reinvent tools that handle such 3568 functionality. This is the job of the file manager or command-line 3569 executable that lists files. 3570 3571 I encourage you to read the manpage of the ‘ls’ executable. It will 3572 help you in general, while it applies to Emacs as well via Dired. The 3573 gist is that you can update the ‘ls’ flags that Dired uses on-the-fly: 3574 type ‘C-u M-x dired-sort-toggle-or-edit’ (‘C-u s’ by default) and append 3575 ‘--sort=time’ at the prompt. To reverse the order, add the ‘-r’ flag. 3576 The user option ‘dired-listing-switches’ sets your default preference. 3577 3578 There is also “virtual Dired” if you need something that cannot be 3579 done with Dired (*note Use dired-virtual-mode for arbitrary file 3580 listings: Use dired-virtual-mode for arbitrary file listings.). 3581 3582 3583 File: docvTU8YZ.info, Node: How do you handle the last modified case?, Next: Speed up backlinks' buffer creation?, Prev: I want to sort by last modified why won't Denote let me?, Up: Frequently Asked Questions 3584 3585 18.8 How do you handle the last modified case? 3586 ============================================== 3587 3588 Denote does not insert any meta data or heading pertaining to edits in 3589 the file. I am of the view that these either do not scale well or are 3590 not descriptive enough. Suppose you use a “lastmod” heading with a 3591 timestamp: which lines where edited and what did the change amount to? 3592 3593 This is where an external program can be helpful. Use a Version 3594 Control System, such as Git, to keep track of all your notes. Every 3595 time you add a new file, record the addition. Same for post-creation 3596 edits. Your VCS will let you review the history of those changes. For 3597 instance, Emacs’ built-in version control framework has a command that 3598 produces a log of changes for the current file: ‘M-x vc-print-log’, 3599 bound to ‘C-x v l’ by default. From there one can access the 3600 corresponding diff output (use ‘M-x describe-mode’ (‘C-h m’) in an 3601 unfamiliar buffer to learn more about it). With Git in particular, 3602 Emacs users have the option of the all-round excellent ‘magit’ package. 3603 3604 In short: let Denote (or equivalent) create notes and link between 3605 them, the file manager organise and provide access to files, search 3606 programs deal with searching and narrowing, and version control software 3607 handle the tracking of changes. 3608 3609 3610 File: docvTU8YZ.info, Node: Speed up backlinks' buffer creation?, Next: Why do I get ``Search failed with status 1'' when I search for backlinks?, Prev: How do you handle the last modified case?, Up: Frequently Asked Questions 3611 3612 18.9 Speed up backlinks’ buffer creation? 3613 ========================================= 3614 3615 Denotes leverages the built-in ‘xref’ library to search for the 3616 identifier of the current file and return any links to it. For users of 3617 Emacs version 28 or higher, there exists a user option to specify the 3618 program that performs this search: ‘xref-search-program’. The default 3619 is ‘grep’, which can be slow, though one may opt for ‘ugrep’, ‘ripgrep’, 3620 or even specify something else (read the doc string of that user option 3621 for the details). 3622 3623 Try either for these for better results: 3624 3625 (setq xref-search-program 'ripgrep) 3626 3627 ;; OR 3628 3629 (setq xref-search-program 'ugrep) 3630 3631 To use whatever executable is available on your system, use something 3632 like this: 3633 3634 ;; Prefer ripgrep, then ugrep, and fall back to regular grep. 3635 (setq xref-search-program 3636 (cond 3637 ((or (executable-find "ripgrep") 3638 (executable-find "rg")) 3639 'ripgrep) 3640 ((executable-find "ugrep") 3641 'ugrep) 3642 (t 3643 'grep))) 3644 3645 3646 File: docvTU8YZ.info, Node: Why do I get ``Search failed with status 1'' when I search for backlinks?, Prev: Speed up backlinks' buffer creation?, Up: Frequently Asked Questions 3647 3648 18.10 Why do I get “Search failed with status 1” when I search for backlinks? 3649 ============================================================================= 3650 3651 Denote uses *note Emacs’ Xref: (emacs)Xref. to find backlinks. Xref 3652 requires ‘xargs’ and one of ‘grep’ or ‘ripgrep’, depending on your 3653 configuration. 3654 3655 This is usually not an issue on *nix systems, but the necessary 3656 executables are not available on Windows Emacs distributions. Please 3657 ensure that you have both ‘xargs’ and either ‘grep’ or ‘ripgrep’ 3658 available within your ‘PATH’ environment variable. 3659 3660 If you have ‘git’ on Windows installed, then you may use the 3661 following code (adjust the git’s installation path if necessary): 3662 (setenv "PATH" (concat (getenv "PATH") ";" "C:\\Program Files\\Git\\usr\\bin")) 3663 3664 3665 File: docvTU8YZ.info, Node: Acknowledgements, Next: GNU Free Documentation License, Prev: Frequently Asked Questions, Up: Top 3666 3667 19 Acknowledgements 3668 ******************* 3669 3670 Denote is meant to be a collective effort. Every bit of help matters. 3671 3672 Author/maintainer 3673 Protesilaos Stavrou. 3674 3675 Contributions to code or the manual 3676 Abin Simon, Alan Schmitt, Benjamin Kästner, Charanjit Singh, 3677 Clemens Radermacher, Colin McLear, Damien Cassou, Elias Storms, 3678 Eshel Yaron, Florian, Graham Marlow, Hilde Rhyne, Jack Baty, 3679 Jean-Philippe Gagné Guay, Jürgen Hötzel, Kaushal Modi, Kyle Meyer, 3680 Marc Fargas, Noboru Ota (nobiot), Peter Prevos, Philip Kaludercic, 3681 Quiliro Ordóñez, Stefan Monnier, Thibaut Benjamin. 3682 3683 Ideas and/or user feedback 3684 Abin Simon, Alan Schmitt, Alfredo Borrás, Benjamin Kästner, Colin 3685 McLear, Damien Cassou, Elias Storms, Federico Stilman, Florian, 3686 Frank Ehmsen, Guo Yong, Hanspeter Gisler, Jack Baty, Jeremy 3687 Friesen, Juanjo Presa, Johan Bolmsjö, Kaushal Modi, M. Hadi 3688 Timachi, Paul van Gelder, Peter Prevos, Shreyas Ragavan, Stefan 3689 Thesing, Summer Emacs, Sven Seebeck, Taoufik, Viktor Haag, Yi Liu, 3690 Ypot, atanasj, hpgisler, pRot0ta1p, sienic, sundar bp. 3691 3692 Special thanks to Peter Povinec who helped refine the file-naming 3693 scheme, which is the cornerstone of this project. 3694 3695 Special thanks to Jean-Philippe Gagné Guay for the numerous 3696 contributions to the code base. 3697 3698 3699 File: docvTU8YZ.info, Node: GNU Free Documentation License, Next: Indices, Prev: Acknowledgements, Up: Top 3700 3701 Appendix A GNU Free Documentation License 3702 ***************************************** 3703 3704 Version 1.3, 3 November 2008 3705 3706 Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. 3707 <https://fsf.org/> 3708 3709 Everyone is permitted to copy and distribute verbatim copies 3710 of this license document, but changing it is not allowed. 3711 3712 0. PREAMBLE 3713 3714 The purpose of this License is to make a manual, textbook, or other 3715 functional and useful document “free” in the sense of freedom: to 3716 assure everyone the effective freedom to copy and redistribute it, 3717 with or without modifying it, either commercially or 3718 noncommercially. Secondarily, this License preserves for the 3719 author and publisher a way to get credit for their work, while not 3720 being considered responsible for modifications made by others. 3721 3722 This License is a kind of “copyleft”, which means that derivative 3723 works of the document must themselves be free in the same sense. 3724 It complements the GNU General Public License, which is a copyleft 3725 license designed for free software. 3726 3727 We have designed this License in order to use it for manuals for 3728 free software, because free software needs free documentation: a 3729 free program should come with manuals providing the same freedoms 3730 that the software does. But this License is not limited to 3731 software manuals; it can be used for any textual work, regardless 3732 of subject matter or whether it is published as a printed book. We 3733 recommend this License principally for works whose purpose is 3734 instruction or reference. 3735 3736 1. APPLICABILITY AND DEFINITIONS 3737 3738 This License applies to any manual or other work, in any medium, 3739 that contains a notice placed by the copyright holder saying it can 3740 be distributed under the terms of this License. Such a notice 3741 grants a world-wide, royalty-free license, unlimited in duration, 3742 to use that work under the conditions stated herein. The 3743 “Document”, below, refers to any such manual or work. Any member 3744 of the public is a licensee, and is addressed as “you”. You accept 3745 the license if you copy, modify or distribute the work in a way 3746 requiring permission under copyright law. 3747 3748 A “Modified Version” of the Document means any work containing the 3749 Document or a portion of it, either copied verbatim, or with 3750 modifications and/or translated into another language. 3751 3752 A “Secondary Section” is a named appendix or a front-matter section 3753 of the Document that deals exclusively with the relationship of the 3754 publishers or authors of the Document to the Document’s overall 3755 subject (or to related matters) and contains nothing that could 3756 fall directly within that overall subject. (Thus, if the Document 3757 is in part a textbook of mathematics, a Secondary Section may not 3758 explain any mathematics.) The relationship could be a matter of 3759 historical connection with the subject or with related matters, or 3760 of legal, commercial, philosophical, ethical or political position 3761 regarding them. 3762 3763 The “Invariant Sections” are certain Secondary Sections whose 3764 titles are designated, as being those of Invariant Sections, in the 3765 notice that says that the Document is released under this License. 3766 If a section does not fit the above definition of Secondary then it 3767 is not allowed to be designated as Invariant. The Document may 3768 contain zero Invariant Sections. If the Document does not identify 3769 any Invariant Sections then there are none. 3770 3771 The “Cover Texts” are certain short passages of text that are 3772 listed, as Front-Cover Texts or Back-Cover Texts, in the notice 3773 that says that the Document is released under this License. A 3774 Front-Cover Text may be at most 5 words, and a Back-Cover Text may 3775 be at most 25 words. 3776 3777 A “Transparent” copy of the Document means a machine-readable copy, 3778 represented in a format whose specification is available to the 3779 general public, that is suitable for revising the document 3780 straightforwardly with generic text editors or (for images composed 3781 of pixels) generic paint programs or (for drawings) some widely 3782 available drawing editor, and that is suitable for input to text 3783 formatters or for automatic translation to a variety of formats 3784 suitable for input to text formatters. A copy made in an otherwise 3785 Transparent file format whose markup, or absence of markup, has 3786 been arranged to thwart or discourage subsequent modification by 3787 readers is not Transparent. An image format is not Transparent if 3788 used for any substantial amount of text. A copy that is not 3789 “Transparent” is called “Opaque”. 3790 3791 Examples of suitable formats for Transparent copies include plain 3792 ASCII without markup, Texinfo input format, LaTeX input format, 3793 SGML or XML using a publicly available DTD, and standard-conforming 3794 simple HTML, PostScript or PDF designed for human modification. 3795 Examples of transparent image formats include PNG, XCF and JPG. 3796 Opaque formats include proprietary formats that can be read and 3797 edited only by proprietary word processors, SGML or XML for which 3798 the DTD and/or processing tools are not generally available, and 3799 the machine-generated HTML, PostScript or PDF produced by some word 3800 processors for output purposes only. 3801 3802 The “Title Page” means, for a printed book, the title page itself, 3803 plus such following pages as are needed to hold, legibly, the 3804 material this License requires to appear in the title page. For 3805 works in formats which do not have any title page as such, “Title 3806 Page” means the text near the most prominent appearance of the 3807 work’s title, preceding the beginning of the body of the text. 3808 3809 The “publisher” means any person or entity that distributes copies 3810 of the Document to the public. 3811 3812 A section “Entitled XYZ” means a named subunit of the Document 3813 whose title either is precisely XYZ or contains XYZ in parentheses 3814 following text that translates XYZ in another language. (Here XYZ 3815 stands for a specific section name mentioned below, such as 3816 “Acknowledgements”, “Dedications”, “Endorsements”, or “History”.) 3817 To “Preserve the Title” of such a section when you modify the 3818 Document means that it remains a section “Entitled XYZ” according 3819 to this definition. 3820 3821 The Document may include Warranty Disclaimers next to the notice 3822 which states that this License applies to the Document. These 3823 Warranty Disclaimers are considered to be included by reference in 3824 this License, but only as regards disclaiming warranties: any other 3825 implication that these Warranty Disclaimers may have is void and 3826 has no effect on the meaning of this License. 3827 3828 2. VERBATIM COPYING 3829 3830 You may copy and distribute the Document in any medium, either 3831 commercially or noncommercially, provided that this License, the 3832 copyright notices, and the license notice saying this License 3833 applies to the Document are reproduced in all copies, and that you 3834 add no other conditions whatsoever to those of this License. You 3835 may not use technical measures to obstruct or control the reading 3836 or further copying of the copies you make or distribute. However, 3837 you may accept compensation in exchange for copies. If you 3838 distribute a large enough number of copies you must also follow the 3839 conditions in section 3. 3840 3841 You may also lend copies, under the same conditions stated above, 3842 and you may publicly display copies. 3843 3844 3. COPYING IN QUANTITY 3845 3846 If you publish printed copies (or copies in media that commonly 3847 have printed covers) of the Document, numbering more than 100, and 3848 the Document’s license notice requires Cover Texts, you must 3849 enclose the copies in covers that carry, clearly and legibly, all 3850 these Cover Texts: Front-Cover Texts on the front cover, and 3851 Back-Cover Texts on the back cover. Both covers must also clearly 3852 and legibly identify you as the publisher of these copies. The 3853 front cover must present the full title with all words of the title 3854 equally prominent and visible. You may add other material on the 3855 covers in addition. Copying with changes limited to the covers, as 3856 long as they preserve the title of the Document and satisfy these 3857 conditions, can be treated as verbatim copying in other respects. 3858 3859 If the required texts for either cover are too voluminous to fit 3860 legibly, you should put the first ones listed (as many as fit 3861 reasonably) on the actual cover, and continue the rest onto 3862 adjacent pages. 3863 3864 If you publish or distribute Opaque copies of the Document 3865 numbering more than 100, you must either include a machine-readable 3866 Transparent copy along with each Opaque copy, or state in or with 3867 each Opaque copy a computer-network location from which the general 3868 network-using public has access to download using public-standard 3869 network protocols a complete Transparent copy of the Document, free 3870 of added material. If you use the latter option, you must take 3871 reasonably prudent steps, when you begin distribution of Opaque 3872 copies in quantity, to ensure that this Transparent copy will 3873 remain thus accessible at the stated location until at least one 3874 year after the last time you distribute an Opaque copy (directly or 3875 through your agents or retailers) of that edition to the public. 3876 3877 It is requested, but not required, that you contact the authors of 3878 the Document well before redistributing any large number of copies, 3879 to give them a chance to provide you with an updated version of the 3880 Document. 3881 3882 4. MODIFICATIONS 3883 3884 You may copy and distribute a Modified Version of the Document 3885 under the conditions of sections 2 and 3 above, provided that you 3886 release the Modified Version under precisely this License, with the 3887 Modified Version filling the role of the Document, thus licensing 3888 distribution and modification of the Modified Version to whoever 3889 possesses a copy of it. In addition, you must do these things in 3890 the Modified Version: 3891 3892 A. Use in the Title Page (and on the covers, if any) a title 3893 distinct from that of the Document, and from those of previous 3894 versions (which should, if there were any, be listed in the 3895 History section of the Document). You may use the same title 3896 as a previous version if the original publisher of that 3897 version gives permission. 3898 3899 B. List on the Title Page, as authors, one or more persons or 3900 entities responsible for authorship of the modifications in 3901 the Modified Version, together with at least five of the 3902 principal authors of the Document (all of its principal 3903 authors, if it has fewer than five), unless they release you 3904 from this requirement. 3905 3906 C. State on the Title page the name of the publisher of the 3907 Modified Version, as the publisher. 3908 3909 D. Preserve all the copyright notices of the Document. 3910 3911 E. Add an appropriate copyright notice for your modifications 3912 adjacent to the other copyright notices. 3913 3914 F. Include, immediately after the copyright notices, a license 3915 notice giving the public permission to use the Modified 3916 Version under the terms of this License, in the form shown in 3917 the Addendum below. 3918 3919 G. Preserve in that license notice the full lists of Invariant 3920 Sections and required Cover Texts given in the Document’s 3921 license notice. 3922 3923 H. Include an unaltered copy of this License. 3924 3925 I. Preserve the section Entitled “History”, Preserve its Title, 3926 and add to it an item stating at least the title, year, new 3927 authors, and publisher of the Modified Version as given on the 3928 Title Page. If there is no section Entitled “History” in the 3929 Document, create one stating the title, year, authors, and 3930 publisher of the Document as given on its Title Page, then add 3931 an item describing the Modified Version as stated in the 3932 previous sentence. 3933 3934 J. Preserve the network location, if any, given in the Document 3935 for public access to a Transparent copy of the Document, and 3936 likewise the network locations given in the Document for 3937 previous versions it was based on. These may be placed in the 3938 “History” section. You may omit a network location for a work 3939 that was published at least four years before the Document 3940 itself, or if the original publisher of the version it refers 3941 to gives permission. 3942 3943 K. For any section Entitled “Acknowledgements” or “Dedications”, 3944 Preserve the Title of the section, and preserve in the section 3945 all the substance and tone of each of the contributor 3946 acknowledgements and/or dedications given therein. 3947 3948 L. Preserve all the Invariant Sections of the Document, unaltered 3949 in their text and in their titles. Section numbers or the 3950 equivalent are not considered part of the section titles. 3951 3952 M. Delete any section Entitled “Endorsements”. Such a section 3953 may not be included in the Modified Version. 3954 3955 N. Do not retitle any existing section to be Entitled 3956 “Endorsements” or to conflict in title with any Invariant 3957 Section. 3958 3959 O. Preserve any Warranty Disclaimers. 3960 3961 If the Modified Version includes new front-matter sections or 3962 appendices that qualify as Secondary Sections and contain no 3963 material copied from the Document, you may at your option designate 3964 some or all of these sections as invariant. To do this, add their 3965 titles to the list of Invariant Sections in the Modified Version’s 3966 license notice. These titles must be distinct from any other 3967 section titles. 3968 3969 You may add a section Entitled “Endorsements”, provided it contains 3970 nothing but endorsements of your Modified Version by various 3971 parties—for example, statements of peer review or that the text has 3972 been approved by an organization as the authoritative definition of 3973 a standard. 3974 3975 You may add a passage of up to five words as a Front-Cover Text, 3976 and a passage of up to 25 words as a Back-Cover Text, to the end of 3977 the list of Cover Texts in the Modified Version. Only one passage 3978 of Front-Cover Text and one of Back-Cover Text may be added by (or 3979 through arrangements made by) any one entity. If the Document 3980 already includes a cover text for the same cover, previously added 3981 by you or by arrangement made by the same entity you are acting on 3982 behalf of, you may not add another; but you may replace the old 3983 one, on explicit permission from the previous publisher that added 3984 the old one. 3985 3986 The author(s) and publisher(s) of the Document do not by this 3987 License give permission to use their names for publicity for or to 3988 assert or imply endorsement of any Modified Version. 3989 3990 5. COMBINING DOCUMENTS 3991 3992 You may combine the Document with other documents released under 3993 this License, under the terms defined in section 4 above for 3994 modified versions, provided that you include in the combination all 3995 of the Invariant Sections of all of the original documents, 3996 unmodified, and list them all as Invariant Sections of your 3997 combined work in its license notice, and that you preserve all 3998 their Warranty Disclaimers. 3999 4000 The combined work need only contain one copy of this License, and 4001 multiple identical Invariant Sections may be replaced with a single 4002 copy. If there are multiple Invariant Sections with the same name 4003 but different contents, make the title of each such section unique 4004 by adding at the end of it, in parentheses, the name of the 4005 original author or publisher of that section if known, or else a 4006 unique number. Make the same adjustment to the section titles in 4007 the list of Invariant Sections in the license notice of the 4008 combined work. 4009 4010 In the combination, you must combine any sections Entitled 4011 “History” in the various original documents, forming one section 4012 Entitled “History”; likewise combine any sections Entitled 4013 “Acknowledgements”, and any sections Entitled “Dedications”. You 4014 must delete all sections Entitled “Endorsements.” 4015 4016 6. COLLECTIONS OF DOCUMENTS 4017 4018 You may make a collection consisting of the Document and other 4019 documents released under this License, and replace the individual 4020 copies of this License in the various documents with a single copy 4021 that is included in the collection, provided that you follow the 4022 rules of this License for verbatim copying of each of the documents 4023 in all other respects. 4024 4025 You may extract a single document from such a collection, and 4026 distribute it individually under this License, provided you insert 4027 a copy of this License into the extracted document, and follow this 4028 License in all other respects regarding verbatim copying of that 4029 document. 4030 4031 7. AGGREGATION WITH INDEPENDENT WORKS 4032 4033 A compilation of the Document or its derivatives with other 4034 separate and independent documents or works, in or on a volume of a 4035 storage or distribution medium, is called an “aggregate” if the 4036 copyright resulting from the compilation is not used to limit the 4037 legal rights of the compilation’s users beyond what the individual 4038 works permit. When the Document is included in an aggregate, this 4039 License does not apply to the other works in the aggregate which 4040 are not themselves derivative works of the Document. 4041 4042 If the Cover Text requirement of section 3 is applicable to these 4043 copies of the Document, then if the Document is less than one half 4044 of the entire aggregate, the Document’s Cover Texts may be placed 4045 on covers that bracket the Document within the aggregate, or the 4046 electronic equivalent of covers if the Document is in electronic 4047 form. Otherwise they must appear on printed covers that bracket 4048 the whole aggregate. 4049 4050 8. TRANSLATION 4051 4052 Translation is considered a kind of modification, so you may 4053 distribute translations of the Document under the terms of section 4054 4. Replacing Invariant Sections with translations requires special 4055 permission from their copyright holders, but you may include 4056 translations of some or all Invariant Sections in addition to the 4057 original versions of these Invariant Sections. You may include a 4058 translation of this License, and all the license notices in the 4059 Document, and any Warranty Disclaimers, provided that you also 4060 include the original English version of this License and the 4061 original versions of those notices and disclaimers. In case of a 4062 disagreement between the translation and the original version of 4063 this License or a notice or disclaimer, the original version will 4064 prevail. 4065 4066 If a section in the Document is Entitled “Acknowledgements”, 4067 “Dedications”, or “History”, the requirement (section 4) to 4068 Preserve its Title (section 1) will typically require changing the 4069 actual title. 4070 4071 9. TERMINATION 4072 4073 You may not copy, modify, sublicense, or distribute the Document 4074 except as expressly provided under this License. Any attempt 4075 otherwise to copy, modify, sublicense, or distribute it is void, 4076 and will automatically terminate your rights under this License. 4077 4078 However, if you cease all violation of this License, then your 4079 license from a particular copyright holder is reinstated (a) 4080 provisionally, unless and until the copyright holder explicitly and 4081 finally terminates your license, and (b) permanently, if the 4082 copyright holder fails to notify you of the violation by some 4083 reasonable means prior to 60 days after the cessation. 4084 4085 Moreover, your license from a particular copyright holder is 4086 reinstated permanently if the copyright holder notifies you of the 4087 violation by some reasonable means, this is the first time you have 4088 received notice of violation of this License (for any work) from 4089 that copyright holder, and you cure the violation prior to 30 days 4090 after your receipt of the notice. 4091 4092 Termination of your rights under this section does not terminate 4093 the licenses of parties who have received copies or rights from you 4094 under this License. If your rights have been terminated and not 4095 permanently reinstated, receipt of a copy of some or all of the 4096 same material does not give you any rights to use it. 4097 4098 10. FUTURE REVISIONS OF THIS LICENSE 4099 4100 The Free Software Foundation may publish new, revised versions of 4101 the GNU Free Documentation License from time to time. Such new 4102 versions will be similar in spirit to the present version, but may 4103 differ in detail to address new problems or concerns. See 4104 <https://www.gnu.org/licenses/>. 4105 4106 Each version of the License is given a distinguishing version 4107 number. If the Document specifies that a particular numbered 4108 version of this License “or any later version” applies to it, you 4109 have the option of following the terms and conditions either of 4110 that specified version or of any later version that has been 4111 published (not as a draft) by the Free Software Foundation. If the 4112 Document does not specify a version number of this License, you may 4113 choose any version ever published (not as a draft) by the Free 4114 Software Foundation. If the Document specifies that a proxy can 4115 decide which future versions of this License can be used, that 4116 proxy’s public statement of acceptance of a version permanently 4117 authorizes you to choose that version for the Document. 4118 4119 11. RELICENSING 4120 4121 “Massive Multiauthor Collaboration Site” (or “MMC Site”) means any 4122 World Wide Web server that publishes copyrightable works and also 4123 provides prominent facilities for anybody to edit those works. A 4124 public wiki that anybody can edit is an example of such a server. 4125 A “Massive Multiauthor Collaboration” (or “MMC”) contained in the 4126 site means any set of copyrightable works thus published on the MMC 4127 site. 4128 4129 “CC-BY-SA” means the Creative Commons Attribution-Share Alike 3.0 4130 license published by Creative Commons Corporation, a not-for-profit 4131 corporation with a principal place of business in San Francisco, 4132 California, as well as future copyleft versions of that license 4133 published by that same organization. 4134 4135 “Incorporate” means to publish or republish a Document, in whole or 4136 in part, as part of another Document. 4137 4138 An MMC is “eligible for relicensing” if it is licensed under this 4139 License, and if all works that were first published under this 4140 License somewhere other than this MMC, and subsequently 4141 incorporated in whole or in part into the MMC, (1) had no cover 4142 texts or invariant sections, and (2) were thus incorporated prior 4143 to November 1, 2008. 4144 4145 The operator of an MMC Site may republish an MMC contained in the 4146 site under CC-BY-SA on the same site at any time before August 1, 4147 2009, provided the MMC is eligible for relicensing. 4148 4149 ADDENDUM: How to use this License for your documents 4150 ==================================================== 4151 4152 To use this License in a document you have written, include a copy of 4153 the License in the document and put the following copyright and license 4154 notices just after the title page: 4155 4156 Copyright (C) YEAR YOUR NAME. 4157 Permission is granted to copy, distribute and/or modify this document 4158 under the terms of the GNU Free Documentation License, Version 1.3 4159 or any later version published by the Free Software Foundation; 4160 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover 4161 Texts. A copy of the license is included in the section entitled ``GNU 4162 Free Documentation License''. 4163 4164 If you have Invariant Sections, Front-Cover Texts and Back-Cover 4165 Texts, replace the “with...Texts.” line with this: 4166 4167 with the Invariant Sections being LIST THEIR TITLES, with 4168 the Front-Cover Texts being LIST, and with the Back-Cover Texts 4169 being LIST. 4170 4171 If you have Invariant Sections without Cover Texts, or some other 4172 combination of the three, merge those two alternatives to suit the 4173 situation. 4174 4175 If your document contains nontrivial examples of program code, we 4176 recommend releasing these examples in parallel under your choice of free 4177 software license, such as the GNU General Public License, to permit 4178 their use in free software. 4179 4180 4181 File: docvTU8YZ.info, Node: Indices, Prev: GNU Free Documentation License, Up: Top 4182 4183 B Indices 4184 ********* 4185 4186 * Menu: 4187 4188 * Function index:: 4189 * Variable index:: 4190 * Concept index:: 4191 4192 4193 File: docvTU8YZ.info, Node: Function index, Next: Variable index, Up: Indices 4194 4195 B.1 Function index 4196 ================== 4197 4198 4199 * Menu: 4200 4201 * denote: Points of entry. (line 6) 4202 * denote-add-front-matter: Regenerate front matter. 4203 (line 6) 4204 * denote-backlinks-mode: The backlinks' buffer. 4205 (line 42) 4206 * denote-barf-duplicate-id: For developers or advanced users. 4207 (line 118) 4208 * denote-create-note: Standard note creation. 4209 (line 35) 4210 * denote-create-note-in-subdirectory: Convenience commands for note creation. 4211 (line 54) 4212 * denote-create-note-using-date: Convenience commands for note creation. 4213 (line 43) 4214 * denote-create-note-using-type: Convenience commands for note creation. 4215 (line 24) 4216 * denote-create-note-with-template: Convenience commands for note creation. 4217 (line 67) 4218 * denote-date: Points of entry. (line 6) 4219 * denote-date-iso-8601: For developers or advanced users. 4220 (line 371) 4221 * denote-date-org-timestamp: For developers or advanced users. 4222 (line 365) 4223 * denote-date-prompt: For developers or advanced users. 4224 (line 223) 4225 * denote-date-rfc3339: For developers or advanced users. 4226 (line 368) 4227 * denote-desluggify: For developers or advanced users. 4228 (line 128) 4229 * denote-directory: For developers or advanced users. 4230 (line 79) 4231 * denote-directory-files: For developers or advanced users. 4232 (line 86) 4233 * denote-directory-files-matching-regexp: For developers or advanced users. 4234 (line 108) 4235 * denote-directory-subdirectories: For developers or advanced users. 4236 (line 100) 4237 * denote-directory-text-only-files: For developers or advanced users. 4238 (line 96) 4239 * denote-dired-mode: Fontification in Dired. 4240 (line 6) 4241 * denote-dired-mode-in-directories: Fontification in Dired. 4242 (line 17) 4243 * denote-dired-rename-marked-files: Rename multiple files at once. 4244 (line 6) 4245 * denote-dired-rename-marked-files-using-front-matter: Rename multiple files based on their front matter. 4246 (line 6) 4247 * denote-extract-id-from-string: For developers or advanced users. 4248 (line 161) 4249 * denote-extract-keywords-from-front-matter: For developers or advanced users. 4250 (line 397) 4251 * denote-extract-keywords-from-path: For developers or advanced users. 4252 (line 155) 4253 * denote-file-has-identifier-p: For developers or advanced users. 4254 (line 57) 4255 * denote-file-has-supported-extension-p: For developers or advanced users. 4256 (line 60) 4257 * denote-file-is-note-p: For developers or advanced users. 4258 (line 50) 4259 * denote-file-is-writable-and-supported-p: For developers or advanced users. 4260 (line 65) 4261 * denote-file-name-relative-to-denote-directory: For developers or advanced users. 4262 (line 111) 4263 * denote-file-prompt: For developers or advanced users. 4264 (line 203) 4265 * denote-file-type-prompt: For developers or advanced users. 4266 (line 218) 4267 * denote-filetype-heuristics: For developers or advanced users. 4268 (line 137) 4269 * denote-format-file-name: For developers or advanced users. 4270 (line 149) 4271 * denote-format-keywords-for-md-front-matter: For developers or advanced users. 4272 (line 382) 4273 * denote-format-keywords-for-org-front-matter: For developers or advanced users. 4274 (line 392) 4275 * denote-format-keywords-for-text-front-matter: For developers or advanced users. 4276 (line 387) 4277 * denote-get-path-by-id: For developers or advanced users. 4278 (line 115) 4279 * denote-keywords: For developers or advanced users. 4280 (line 68) 4281 * denote-keywords-add: Add or remove keywords interactively. 4282 (line 6) 4283 * denote-keywords-prompt: For developers or advanced users. 4284 (line 207) 4285 * denote-keywords-remove: Add or remove keywords interactively. 4286 (line 6) 4287 * denote-keywords-sort: For developers or advanced users. 4288 (line 75) 4289 * denote-link: Adding a single link. 4290 (line 6) 4291 * denote-link-add-links: Insert links matching a regexp. 4292 (line 6) 4293 * denote-link-add-missing-links: Insert links but only those missing from current buffer. 4294 (line 6) 4295 * denote-link-after-creating: Link to an existing note or create a new one. 4296 (line 14) 4297 * denote-link-after-creating <1>: Variants of denote-link-or-create. 4298 (line 10) 4299 * denote-link-backlinks: The backlinks' buffer. 4300 (line 6) 4301 * denote-link-buttonize-buffer: Adding a single link. 4302 (line 30) 4303 * denote-link-dired-marked-notes: Insert links from marked files in Dired. 4304 (line 6) 4305 * denote-link-find-backlink: Visiting linked files via the minibuffer. 4306 (line 19) 4307 * denote-link-find-file: Visiting linked files via the minibuffer. 4308 (line 6) 4309 * denote-link-insert-link: Miscellaneous information about links. 4310 (line 6) 4311 * denote-link-insert-links-matching-regexp: Miscellaneous information about links. 4312 (line 6) 4313 * denote-link-or-create: Link to an existing note or create a new one. 4314 (line 37) 4315 * denote-link-or-create <1>: Variants of denote-link-or-create. 4316 (line 6) 4317 * denote-link-show-backlinks-buffer: Miscellaneous information about links. 4318 (line 6) 4319 * denote-open-or-create: Variants of denote-open-or-create. 4320 (line 6) 4321 * denote-org-capture: Points of entry. (line 6) 4322 * denote-prompt-for-date-return-id: For developers or advanced users. 4323 (line 231) 4324 * denote-rename-file: Rename a single file. 4325 (line 6) 4326 * denote-rename-file-and-buffer: For developers or advanced users. 4327 (line 245) 4328 * denote-rename-file-prompt: For developers or advanced users. 4329 (line 242) 4330 * denote-rename-file-using-front-matter: Rename a single file based on its front matter. 4331 (line 6) 4332 * denote-retrieve-filename-identifier: For developers or advanced users. 4333 (line 164) 4334 * denote-retrieve-filename-title: For developers or advanced users. 4335 (line 187) 4336 * denote-retrieve-keywords-line: For developers or advanced users. 4337 (line 200) 4338 * denote-retrieve-keywords-value: For developers or advanced users. 4339 (line 197) 4340 * denote-retrieve-or-create-file-identifier: For developers or advanced users. 4341 (line 169) 4342 * denote-retrieve-title-line: For developers or advanced users. 4343 (line 194) 4344 * denote-retrieve-title-value: For developers or advanced users. 4345 (line 191) 4346 * denote-sluggify: For developers or advanced users. 4347 (line 121) 4348 * denote-sluggify-and-join: For developers or advanced users. 4349 (line 125) 4350 * denote-sluggify-keywords: For developers or advanced users. 4351 (line 133) 4352 * denote-subdirectory: Points of entry. (line 6) 4353 * denote-subdirectory-prompt: For developers or advanced users. 4354 (line 237) 4355 * denote-surround-with-quotes: For developers or advanced users. 4356 (line 361) 4357 * denote-template: Points of entry. (line 6) 4358 * denote-template-prompt: For developers or advanced users. 4359 (line 234) 4360 * denote-title-prompt: For developers or advanced users. 4361 (line 214) 4362 * denote-trim-whitespace: For developers or advanced users. 4363 (line 374) 4364 * denote-trim-whitespace-then-quotes: For developers or advanced users. 4365 (line 378) 4366 * denote-type: Points of entry. (line 6) 4367 * denote-update-dired-buffers: For developers or advanced users. 4368 (line 248) 4369 4370 4371 File: docvTU8YZ.info, Node: Variable index, Next: Concept index, Prev: Function index, Up: Indices 4372 4373 B.2 Variable index 4374 ================== 4375 4376 4377 * Menu: 4378 4379 * denote-allow-multi-word-keywords: The file-naming scheme. 4380 (line 29) 4381 * denote-backlinks-mode-map: The backlinks' buffer. 4382 (line 42) 4383 * denote-backlinks-show-context: The backlinks' buffer. 4384 (line 20) 4385 * denote-date-format: Front matter. (line 50) 4386 * denote-date-prompt-use-org-read-date: The denote-date-prompt-use-org-read-date option. 4387 (line 11) 4388 * denote-directory: The file-naming scheme. 4389 (line 6) 4390 * denote-dired-directories: Fontification in Dired. 4391 (line 17) 4392 * denote-excluded-directories-regexp: Exclude certain directories from all operations. 4393 (line 6) 4394 * denote-excluded-keywords-regexp: Exclude certain keywords from being inferred. 4395 (line 6) 4396 * denote-excluded-punctuation-extra-regexp: For developers or advanced users. 4397 (line 43) 4398 * denote-excluded-punctuation-regexp: For developers or advanced users. 4399 (line 39) 4400 * denote-faces-date: Fontification in Dired. 4401 (line 30) 4402 * denote-faces-delimiter: Fontification in Dired. 4403 (line 30) 4404 * denote-faces-extension: Fontification in Dired. 4405 (line 30) 4406 * denote-faces-keywords: Fontification in Dired. 4407 (line 30) 4408 * denote-faces-link: Adding a single link. 4409 (line 38) 4410 * denote-faces-subdirectory: Fontification in Dired. 4411 (line 30) 4412 * denote-faces-time: Fontification in Dired. 4413 (line 30) 4414 * denote-faces-title: Fontification in Dired. 4415 (line 30) 4416 * denote-file-type: The file-naming scheme. 4417 (line 43) 4418 * denote-file-types: For developers or advanced users. 4419 (line 254) 4420 * denote-id-format: For developers or advanced users. 4421 (line 23) 4422 * denote-id-only-link-format: For developers or advanced users. 4423 (line 344) 4424 * denote-id-only-link-in-context-regexp: For developers or advanced users. 4425 (line 357) 4426 * denote-id-regexp: For developers or advanced users. 4427 (line 28) 4428 * denote-infer-keywords: Standard note creation. 4429 (line 16) 4430 * denote-keywords-regexp: For developers or advanced users. 4431 (line 35) 4432 * denote-known-keywords: Standard note creation. 4433 (line 16) 4434 * denote-link-backlinks-display-buffer-action: The backlinks' buffer. 4435 (line 61) 4436 * denote-md-link-format: For developers or advanced users. 4437 (line 338) 4438 * denote-md-link-in-context-regexp: For developers or advanced users. 4439 (line 353) 4440 * denote-org-capture-specifiers: Create note using Org capture. 4441 (line 30) 4442 * denote-org-front-matter: Change the front matter format. 4443 (line 18) 4444 * denote-org-front-matter <1>: For developers or advanced users. 4445 (line 313) 4446 * denote-org-link-format: For developers or advanced users. 4447 (line 333) 4448 * denote-org-link-in-context-regexp: For developers or advanced users. 4449 (line 349) 4450 * denote-prompts: The denote-prompts option. 4451 (line 6) 4452 * denote-sort-keywords: Standard note creation. 4453 (line 22) 4454 * denote-templates: The denote-templates option. 4455 (line 6) 4456 * denote-text-front-matter: Change the front matter format. 4457 (line 20) 4458 * denote-text-front-matter <1>: For developers or advanced users. 4459 (line 328) 4460 * denote-title-regexp: For developers or advanced users. 4461 (line 31) 4462 * denote-toml-front-matter: Change the front matter format. 4463 (line 22) 4464 * denote-toml-front-matter <1>: For developers or advanced users. 4465 (line 323) 4466 * denote-yaml-front-matter: Change the front matter format. 4467 (line 24) 4468 * denote-yaml-front-matter <1>: For developers or advanced users. 4469 (line 318) 4470 4471 4472 File: docvTU8YZ.info, Node: Concept index, Prev: Variable index, Up: Indices 4473 4474 B.3 Concept index 4475 ================= 4476 4477 4478 * Menu: 4479 4480 * Contributors: Acknowledgements. (line 6) 4481 * Installation instructions: Installation. (line 6) 4482 * Note silos: Maintain separate directory silos for notes. 4483 (line 6) 4484 * Package configuration: Sample configuration. (line 6) 4485 4486 4487 4488 Tag Table: 4489 Node: Top852 4490 Node: Overview6007 4491 Node: Points of entry9214 4492 Node: Standard note creation9914 4493 Node: The denote-prompts option11834 4494 Node: The denote-templates option15129 4495 Node: Convenience commands for note creation17634 4496 Node: The denote-date-prompt-use-org-read-date option23664 4497 Node: Add or remove keywords interactively24467 4498 Node: Create note using Org capture25257 4499 Node: Maintain separate directory silos for notes27486 4500 Node: Exclude certain directories from all operations32195 4501 Node: Exclude certain keywords from being inferred33295 4502 Node: Renaming files33902 4503 Node: Rename a single file35299 4504 Node: Rename multiple files at once38360 4505 Node: Rename a single file based on its front matter39833 4506 Node: Rename multiple files based on their front matter42004 4507 Node: The file-naming scheme43671 4508 Node: Sluggified title and keywords47377 4509 Node: Features of the file-naming scheme for searching or filtering48235 4510 Node: Front matter49706 4511 Node: Change the front matter format52053 4512 Node: Regenerate front matter54881 4513 Node: Linking notes56245 4514 Node: Adding a single link57272 4515 Node: Insert links matching a regexp59229 4516 Node: Insert links but only those missing from current buffer61461 4517 Node: Insert links from marked files in Dired62176 4518 Node: Link to an existing note or create a new one63602 4519 Node: The backlinks' buffer66551 4520 Node: Writing metanotes70121 4521 Node: Visiting linked files via the minibuffer71796 4522 Node: Miscellaneous information about links73033 4523 Node: Fontification in Dired73642 4524 Node: Use Org dynamic blocks75645 4525 Node: Minibuffer histories79359 4526 Node: Extending Denote80215 4527 Node: Keep a journal or diary81179 4528 Node: Create a note with the region's contents84698 4529 Node: Split an Org subtree into its own note85908 4530 Node: Narrow the list of files in Dired87575 4531 Node: Use dired-virtual-mode for arbitrary file listings89911 4532 Node: Use Embark to collect minibuffer candidates94017 4533 Node: Search file contents95324 4534 Node: Bookmark the directory with the notes97008 4535 Node: Use the citar-denote package for bibliography notes98397 4536 Node: Use the consult-notes package99432 4537 Node: Treat your notes as a project100674 4538 Node: Variants of denote-open-or-create102152 4539 Node: Variants of denote-link-or-create105101 4540 Node: Installation108443 4541 Node: GNU ELPA package108640 4542 Node: Manual installation109203 4543 Node: Sample configuration109974 4544 Node: For developers or advanced users114851 4545 Node: Contributing133136 4546 Node: Things to do136240 4547 Node: Publications about Denote138108 4548 Node: Alternatives to Denote139888 4549 Node: Alternative ideas with Emacs and further reading144527 4550 Node: Frequently Asked Questions145514 4551 Node: Why develop Denote when PACKAGE already exists?146479 4552 Node: Why not rely exclusively on Org?148406 4553 Node: Why care about Unix tools when you use Emacs?150116 4554 Node: Why many small files instead of few large ones?151458 4555 Node: Does Denote perform well at scale?153400 4556 Node: I add TODOs to my notes; will many files slow down the Org agenda?154533 4557 Node: I want to sort by last modified why won't Denote let me?156496 4558 Node: How do you handle the last modified case?157704 4559 Node: Speed up backlinks' buffer creation?159256 4560 Node: Why do I get ``Search failed with status 1'' when I search for backlinks?160585 4561 Node: Acknowledgements161588 4562 Node: GNU Free Documentation License163043 4563 Node: Indices188404 4564 Node: Function index188580 4565 Node: Variable index201254 4566 Node: Concept index207997 4567 4568 End Tag Table 4569 4570 4571 Local Variables: 4572 coding: utf-8 4573 End: