Compare commits

..

2188 commits
1.2.0 ... main

Author SHA1 Message Date
Protesilaos 110ced9999
Acknowledge kimsaram32 for commit 840ca21
This was done in pull request 728: <https://github.com/protesilaos/denote/pull/728>.
The change is small, meaning that its author does not need to assign
copyright to the Free Software Foundation.
2026-09-09 14:37:04 +03:00
Protesilaos 32d83aa68b
Merge pull request #728 from kimsaram32/docs-remove-obsolete-functions
Remove obsolete functions in the documentation
2026-09-09 14:35:59 +03:00
kimsaram32 840ca21f92 Remove obsolete functions in the documentation 2026-09-09 19:31:13 +09:00
Protesilaos 0a157981e5
Rename a helper function to be private and have a more accurate name
Also tweak its docstring.
2026-08-28 16:40:30 +03:00
Protesilaos 2c8cf137ac
Fix typo in the manual
Thanks to Ali Bozorgzadeh for reporting it in issue 727:
<https://github.com/protesilaos/denote/issues/727>.
2026-08-27 17:38:03 +03:00
Protesilaos e401e70405
Merge pull request #726 from jeanphilippegg/move-unix-timestamps-code
Move Unix timestamps code in `denote-valid-date-p`
2026-08-24 12:35:53 +03:00
Jean-Philippe Gagné Guay ec73303bff Move Unix timestamps code in denote-valid-date-p 2026-08-23 21:38:04 -04:00
Protesilaos 42085330f3
Update the :package-version of denote-org-store-link-to-heading
This is because it now has a new option, per commit b90b26e (pull
request 723 by Michael Korat: <https://github.com/protesilaos/denote/pull/723>).
2026-08-23 13:33:39 +03:00
Protesilaos 27cdd67b68
Document denote-org-store-link-to-heading "local" value in the manual
This was introduced by Michael Korat in commit 9a354e4 as part of pull
request 723: <https://github.com/protesilaos/denote/pull/723>.
2026-08-23 13:31:39 +03:00
Protesilaos b90b26e938
Acknowledge Michael Korat for commit 9a354e4
This was done in pull request 723: <https://github.com/protesilaos/denote/pull/723>.
The change is small, meaning that Michael does not need to assign
copyright to the Free Software Foundation.
2026-08-23 13:06:01 +03:00
Protesilaos 5effab91ca
Merge pull request #723 from mkorat/main
Add option to use simple heading links to denote-link-ol-store.
2026-08-23 13:05:08 +03:00
Protesilaos 9ae9d0e1ea
Make stylistic change to denote--date-parse-string
The original was contributed by Jeff Valk in commit 9083ad7, pull
request 722: <https://github.com/protesilaos/denote/pull/722>.
2026-08-10 11:38:16 +03:00
Protesilaos 8f7e988a67
Acknowledge Jeff Valk for commit 9083ad7
This was done in pull request 722: <https://github.com/protesilaos/denote/pull/722>.
The change is small, meaning that Jeff does not need to assign
copyright to the Free Software Foundation.
2026-08-10 11:30:39 +03:00
Protesilaos 7d0c06e0a4
Merge pull request #722 from jeffvalk/main
Support Unix timestamps in date input
2026-08-10 11:29:47 +03:00
Michael Korat 9a354e4362 Add option to use simple heading links to denote-link-ol-store. 2026-08-09 20:58:32 +02:00
Jeff Valk 9083ad781e Support Unix timestamps in date input
This allows for other recognized date patterns to be supported as well.
2026-07-31 12:20:10 -04:00
Protesilaos 3718a60305
Make denote-query-focus-last-search reuse the existing query buffer 2026-07-29 13:05:00 +03:00
Protesilaos 5b632ae958
Make denote-query-* commands work as intended in the backlinks buffer
Thanks to 82Kang for reporting the bug in issue 695:
<https://github.com/protesilaos/denote/issues/695>.
2026-07-29 13:04:16 +03:00
Protesilaos b4978d83cb
Make denote-link--collect-identifiers remove duplicates
Thanks to 82Kang for reporting the bug in issue 694:
<https://github.com/protesilaos/denote/issues/694>.
2026-07-29 12:55:45 +03:00
Protesilaos c8aa01c56a
Add denote-slug-remove-accents function
This is based on the code originally written by Jean-Philippe Gagné
Guay in issue 603: <https://github.com/protesilaos/denote/issues/603#issuecomment-2869702877>.
I made stylistic changes to it to make it fit with the rest of denote.el.

I am adding this in response to issue 603 and 718:

- <https://github.com/protesilaos/denote/issues/603> with
  participation from Davi Ramos and Jean-Philippe Gagné Guay;
- <https://github.com/protesilaos/denote/issues/718> with
  participation from o-rxw and Alan Schmitt.

In implementing this, I am changing my mind that this is purely a
documentation issue. I realised it is better for us to have the main
function in denote.el, so that we can test it better.
2026-07-27 19:53:13 +03:00
Protesilaos 1004f735b7
Mention the SIGNATURE in the docstring of all front matter variables
Thanks to Alan Schmitt for telling me this was missing. It was done in
issue 714: <https://github.com/protesilaos/denote/issues/714>.
2026-07-07 22:56:49 +03:00
Protesilaos 65f1bbf1de
Acknowledge Pavlo V. Lysov for commit 72d90f4
This is about mentioning Pavlo's 'denote-solo' package in the Denote
manual.

Done in pull request 713: <https://github.com/protesilaos/denote/pull/713>.
2026-07-06 10:31:07 +03:00
Protesilaos 8c80d91d06
Merge pull request #713 from pavlo/main
Add a section for denote-solo package
2026-07-06 10:28:12 +03:00
Pavlo V. Lysov 72d90f474e Add a section for denote-solo package 2026-07-06 08:49:53 +03:00
Protesilaos cd422b1d22
Acknowledge Matthieu Muller for commit 35d3a2a
This was done in pull request 711: <https://github.com/protesilaos/denote/pull/711>.
The change is small, menaing that Matthieu does not need to assign
copyright to the Free Software Foundation.
2026-06-11 21:41:01 +03:00
Protesilaos 04c39a157f
Merge pull request #711 from matthieumuller/add-denote-paperless-to-docs
Add a section on denote-paperless.el in the documentation
2026-06-11 21:39:34 +03:00
Matthieu MULLER 35d3a2a724 Add a section on denote-paperless.el in the documentation 2026-06-11 14:12:31 -04:00
Protesilaos 9fd6692a32
Bump version number to trigger GNU ELPA package rebuild to include commit 420710f 2026-05-27 20:30:00 +03:00
Protesilaos 420710fb17
Ensure :get-file-type-function is called only when file exists
Otherwise we get an error upon creating the file.

Thanks to potchie-maker for reporting the bug in issue 709:
<https://github.com/protesilaos/denote/issues/709>.
2026-05-27 20:28:38 +03:00
Protesilaos 77813e9956
Bump version number to trigger GNU ELPA rebuild
I am bumping it straight to 4.2.2 because I had a tag earlier for
4.2.1 even though I forgot to update this header...
2026-05-23 23:15:15 +03:00
Protesilaos cf1c81cba9
Make stylistic tweak to denote-file-prompt--format-identifier 2026-05-23 23:12:49 +03:00
Protesilaos 32960f828b
Acknowledge Marco Baringer for commits d47464e, 6ba2097
Those were sent as part of pull request 708: <https://github.com/protesilaos/denote/pull/708>.

The changes are small, meaning that Marco does not need to assign
copyright to the Free Software Foundation.
2026-05-23 23:10:04 +03:00
Protesilaos 197b0acd38
Merge pull request #708 from segv/main
denote-open-or-create errors in directories with oddly-named files (#707)
2026-05-23 23:09:24 +03:00
Marco Baringer d47464e23b
Require non-empty captures in the four field regexps
denote-{identifier,signature,title,keywords}-regexp used a lazy
zero-or-more capture ([^.]*?), so they matched the bare separator
followed by an extension, e.g. __.js, --.org, ==.org, @@.org. Combined
with denote-file-has-denoted-filename-p, this meant such files were
treated as valid denote notes. lodash's node_modules ships __.js files,
which made a denote-directory containing a lodash checkout enumerate
junk candidates in the file prompt (and previously crash, see preceding
commit).

Switch to a non-empty lazy capture ([^.]+?) so the field must contain at
least one character.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 16:20:49 +02:00
Marco Baringer 6ba209704d
Fix file-prompt crash when denote-directory contains files like __.js
Using denote in a directory that includes files matching '*/__.js'
breaks with "Wrong type argument: stringp, nil" on the file prompt.
lodash ships such files in node_modules, so accidentally pointing
denote at a lodash checkout (or having one under denote-directory)
triggers the error.

These files pass denote-file-has-denoted-filename-p because the empty
keywords section matches denote-keywords-regexp, but they have no
identifier, so denote-file-prompt--format-identifier passed nil to
propertize during affixation. Return nil in that case;
denote-file-prompt-affixate already substitutes "" for a nil prefix.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 16:17:47 +02:00
Protesilaos 30c0d6536e
Be precise in the denote-file-prompt-extra-metadata docstring 2026-05-21 20:09:22 +03:00
Protesilaos 13b2164369
Update to Denote version 4.2.0 2026-05-20 15:41:08 +03:00
Protesilaos e40bdc8cdc
Remove spacing in denote--get-front-matter-rewrite-prompt 2026-05-20 15:24:30 +03:00
Protesilaos 3ef7380190
Remove the denote-sort-dired-focus alias
I want to reach a point where only denote-dired and related are used.
Maybe this is more appropriate for the next major version, but I can
do it here since this is a new command.
2026-05-20 12:37:13 +03:00
Protesilaos ea398e9a2a
Throw a user-error if denote-dired-focus is called in a Dired buffer without prior denote-dired 2026-05-20 12:35:57 +03:00
Protesilaos dbfe4b189a
Remove faulty 'or' from denote--dir-in-denote-directory-p
Thanks to Jean-Philippe Gagné Guay for pointing out the problem with
it in a comment to issue 705:
<https://github.com/protesilaos/denote/issues/705#issuecomment-4436808008>.
2026-05-13 11:12:45 +03:00
Protesilaos 3f5ede71d4
Reindent denote-valid-date-p 2026-05-12 13:26:37 +03:00
Protesilaos 1aedcff2d7
Make stylistic tweaks to denote--prepare-note 2026-05-12 13:25:01 +03:00
Protesilaos 59eea50d4b
Reindent denote--valid-file-type 2026-05-12 13:22:35 +03:00
Protesilaos 21b1c81d1a
Make denote--dir-in-denote-directory-p more robust
This is in response to a bug reported by Kevin Izevbigie in issue 705:
<https://github.com/protesilaos/denote/issues/705>.
2026-05-12 13:18:27 +03:00
Protesilaos d7dab477a1
Document the denote-lint package 2026-05-01 18:56:52 +03:00
Protesilaos 0ff9573362
Make stylistic refinements to the helpers introduced in 8e6d83c
I was testing them and was too eager to commit before refining them.
Will need to write tests eventually, but I do not have time right now.
2026-05-01 18:48:34 +03:00
Protesilaos 8e6d83c652
Make rename commands not interfere with existing front matter indentation
This is to address the comment posted by Morten Kjeldgaard in issue
703: <https://github.com/protesilaos/denote/issues/703>.
2026-05-01 18:40:39 +03:00
Protesilaos 06c520de36
Do for the keyword include/exclude commands the same as commit 9b8c96f 2026-04-28 23:31:03 +03:00
Protesilaos 9b8c96f5e8
Redefine denote-query-only-include-files and denote-query-exclude-files to use helper function
The macro we had before was okay, but this feels easier to reason about.
2026-04-28 23:27:03 +03:00
Protesilaos d78ad3f74e
Make denote-link-ol-store work in org-capture as well
This affects the org-capture specifiers that create a link such as %a
and %l.

Thanks to jarofromel for bringing this matter to my attention in
discussion 702: <https://github.com/protesilaos/denote/discussions/702>.
2026-04-28 22:56:36 +03:00
Protesilaos 8112e65bc3
Acknowledge nescias for commit c772378
This was sent to me as a patch via email. The change is small, meaning
that its author does not need to assign copyright the Free Software
Foundation.
2026-04-28 18:47:30 +03:00
nescias c7723784b9
Fix typos in documentation 2026-04-28 17:24:36 +03:00
Protesilaos b5be053380
Document the ~denote-wordcloud package 2026-04-27 23:16:11 +03:00
Protesilaos f113e49988
Document the denote-sections package by Samuel W. Flint
Thanks to Samuel for bringing this matter to my attenion in issue 701:
<https://github.com/protesilaos/denote/issues/701>.
2026-04-27 22:47:57 +03:00
Protesilaos 3cd8d47c00
Document the denote-regexp package by Samuel W. Flint
Thanks to Samuel for bringing this matter to my attenion in issue 701:
<https://github.com/protesilaos/denote/issues/701>.
2026-04-27 22:45:51 +03:00
Protesilaos 348d851eb4
Document the denote-project-notes package by Samuel W. Flint
Thanks to Samuel for bringing this matter to my attenion in issue 701:
<https://github.com/protesilaos/denote/issues/701>.
2026-04-27 22:36:42 +03:00
Protesilaos 7babe195ee
Document the denote-agenda package by Samuel W. Flint
Thanks to Samuel for bringing this matter to my attenion in issue 701:
<https://github.com/protesilaos/denote/issues/701>.
2026-04-27 22:32:25 +03:00
Protesilaos aedbb0cecd
Document the denote-journal-capture package by Samuel W. Flint
Thanks to Samuel for bringing this matter to my attenion in issue 701:
<https://github.com/protesilaos/denote/issues/701>.
2026-04-27 22:25:58 +03:00
Protesilaos 97ffb56320
Use "Protesilaos" instead of "Protesilaos Stavrou"
As I announced here: <https://protesilaos.com/news/2026-04-21-omitting-the-surname/>.
2026-04-24 13:26:01 +03:00
Protesilaos 7574b8cecd
Document in the manual the functions to get the file type for YAML and TOML 2026-04-23 21:25:34 +03:00
Protesilaos 29fd39a4d4
Make sure the denote-file-type function is registered in the function index 2026-04-23 21:25:14 +03:00
Protesilaos 87a4a02afa
Document denote-file-type function in the manual 2026-04-23 21:19:57 +03:00
Protesilaos dd4551ad9c
Rewrite the doc string of denote-file-type 2026-04-23 21:17:20 +03:00
Protesilaos 231d7d64e8
Write a test for denote-file-type 2026-04-23 21:02:08 +03:00
Protesilaos ee1ad314fc
Add :get-file-type-function to the denote-file-type function 2026-04-23 21:01:38 +03:00
Protesilaos 8b9a4e511d
Add a :get-file-type-function to the denote-file-types 2026-04-23 21:00:59 +03:00
Protesilaos 5281b7c3fc
Add a comment related to where denote--title-value-reverse-function is called 2026-04-23 19:55:38 +03:00
Protesilaos 207a365b83
Expand the TODO comment about denote-file-type 2026-04-23 19:30:51 +03:00
Protesilaos 568c807d8d
Add a TODO about denote-file-type 2026-04-23 19:27:16 +03:00
Protesilaos ec4fed24f7
Prevent denote-retrieve-xref-alist-for-backlinks from throwing an error if file type is nil 2026-04-23 19:09:09 +03:00
Protesilaos 383c52be8d
Acknowledge GuutBoy for reporting a bug in denote-markdown
This was done in issue 699: <https://github.com/protesilaos/denote/issues/699>.
2026-04-23 19:07:39 +03:00
Protesilaos Stavrou 5e995cfecc
Acknowledge gnuhack for commit aaa75e7
This was done as part of pull request 697: <https://github.com/protesilaos/denote/pull/697>.
The change is small, repurposing existing code, meaning that the
author does not need to assign copyright to the Free Software Foundation.
2026-04-21 08:38:09 +03:00
Protesilaos Stavrou 59e1304a67
Merge pull request #697 from gnuhack/patch-2
Macro for denote-query-exclude-files and denote-query-only-include-files
2026-04-21 08:37:08 +03:00
gnuhack aaa75e7f13
Macro for denote-query-exclude-files and denote-query-only-include-files
Replaced both functions with a new macro. Created the new functions through the macro.
2026-04-20 12:47:02 +02:00
Protesilaos Stavrou c3b60fcada
Replace "doc string" with "docstring" 2026-04-13 08:41:39 +03:00
Protesilaos Stavrou f6499cbf5c
Merge branch 'main' of github.com:protesilaos/denote 2026-04-09 21:16:03 +03:00
Protesilaos Stavrou 0993df4fbc
Fix typo about "keymap" 2026-04-09 21:11:40 +03:00
Protesilaos Stavrou b77b926505
Merge pull request #696 from gnuhack/patch-1
Fix typo
2026-04-09 08:19:36 +03:00
gnuhack 63c052e1ac
Fix typo 2026-04-09 00:09:56 +02:00
Protesilaos Stavrou 160444b853
Mention denote-dired-focus in the manual and expand its docstring 2026-04-07 12:11:54 +03:00
Protesilaos Stavrou 4483caee95
Update the manual's acknowledgements
This is about the idea behind denote-dired-focus, as discussed in
issue 693: <https://github.com/protesilaos/denote/issues/693>.
2026-04-07 12:03:23 +03:00
Protesilaos Stavrou b4924c853d
Make denote-sort-dired always produce a new buffer
Thanks to 82Kang for telling me about the use-case of maintaining
multiple Denote Dired buffers side-by-side. This is done as part of
issue 693: <https://github.com/protesilaos/denote/issues/693>.
2026-04-07 11:55:38 +03:00
Protesilaos Stavrou e5260315ec
Merge branch 'denote-dired-focus' of github.com:protesilaos/denote into denote-dired-focus 2026-04-07 11:39:37 +03:00
Protesilaos Stavrou 21b8c6d024
Implement prototype of denote-dired-focus
I am doing this in response to a question posted by 82Kang in issue
693: <https://github.com/protesilaos/denote/issues/693>.

We already have similar functionality for the denote-grep (and
related) buffers. This is an opportunity for me to also review all
that.
2026-04-07 11:39:28 +03:00
Protesilaos Stavrou fd4d20b472
Make small stylistic tweaks to denote-grep and a helper function 2026-04-07 11:32:30 +03:00
Protesilaos Stavrou 9dc7420031
Tweak the denote-grep-display-buffer-action documentation 2026-04-07 11:32:13 +03:00
Protesilaos Stavrou beb698f632
Deprecate the denote-grep-history 2026-04-07 11:22:26 +03:00
Protesilaos Stavrou 1058caea0c
Tweak the make-obsolete warnings for the grep prompt and its history 2026-04-07 11:19:46 +03:00
Protesilaos Stavrou dcb3daf81a
Add TODO for denote-grep and friends 2026-04-06 22:59:03 +03:00
Protesilaos Stavrou 3e8c2c835d
Make stylistic changes and minor refinements to the query include/exclude commands 2026-04-06 22:57:54 +03:00
Protesilaos Stavrou 37beb39c3b
Consolidate the query/grep prompts for a REGEXP 2026-04-06 22:57:20 +03:00
Protesilaos Stavrou 5e4b95a1b7
Make stylistic refinements to denote-query-focus-last-search 2026-04-06 22:30:03 +03:00
Protesilaos Stavrou d0252aff0c
Make stylistic refinements to denote-query-prompt 2026-04-06 22:29:51 +03:00
Protesilaos Stavrou 15415e7956
Refine how the prompt for query buffer narrowing is implemented 2026-04-06 22:23:39 +03:00
Protesilaos Stavrou 2dae5773f2
Rewrite the tests in the interest of clarity and expand them where necessary 2026-04-06 21:58:02 +03:00
Protesilaos Stavrou 7b9be290e5
Inhibit denote--regexp-in-file-p error in denote-file-type
In the case where the check returns nil, we want to move to the next
condition, so no need for an error here.
2026-04-06 21:57:15 +03:00
Protesilaos Stavrou acadd80426
Move denote--regexp-in-file-p further up 2026-04-06 21:56:59 +03:00
Protesilaos Stavrou 53bb758384
Rewrite denote-file-has-denoted-filename-p docstring for clarity 2026-04-06 21:56:43 +03:00
Protesilaos Stavrou ded4c50b8c
Make denote-directories--get-paths take an argument and do error checking 2026-04-06 21:56:24 +03:00
Protesilaos Stavrou 9d5711ea50
Update copyright years in denote-test.el 2026-04-06 20:01:49 +03:00
Protesilaos Stavrou 90d84d6501
Implement prototype of denote-dired-focus
I am doing this in response to a question posted by 82Kang in issue
693: <https://github.com/protesilaos/denote/issues/693>.

We already have similar functionality for the denote-grep (and
related) buffers. This is an opportunity for me to also review all
that.
2026-04-06 12:20:58 +03:00
Protesilaos Stavrou 627ed49989
Move denote--user-error-if-not-major-mode further up 2026-04-06 11:48:25 +03:00
Protesilaos Stavrou 75ef0f827a
Make small refinement to denote-sort-dired 2026-04-06 11:17:17 +03:00
Protesilaos Stavrou 8dfadbc085
Split up denote-sort-dired for legibility and fix a bug with revert-buffer 2026-04-06 10:43:04 +03:00
Protesilaos Stavrou 7852585578
Set denote-file-type explicitly to Org
Otherwise, the user will not necessarily get what they want if they
add to the denote-file-types.
2026-04-02 09:56:45 +03:00
Protesilaos Stavrou e6f6111d3d
Ensure denote--act-on-query-link get the buffer of denote-sort-dired 2026-03-24 14:51:55 +02:00
Protesilaos Stavrou 7f92fd4af3
Acknowledge bplubell for commit d8c2488
This was done in pull request 685: <https://github.com/protesilaos/denote/pull/685>
The change is small, meaning that the author does not need to assign
copyright to the Free Software Foundation.
2026-03-19 07:13:07 +02:00
Protesilaos Stavrou d93056137f
In denote-link--prepare-links pass the file-type to denote-get-link-description 2026-03-19 07:12:31 +02:00
Protesilaos Stavrou 6c0fb263c8
Merge pull request #685 from bplubell/fix-follow-markdown-link
Fix error when following non-Denote Markdown links
2026-03-19 07:09:52 +02:00
bplubell d8c2488622 Fix error when following non-Denote Markdown links
When following links in markdown-mode that are to non-Denote resources
like URLs, you would see the error:

    Cannot open ‘nil’ of unknown link type

That is because Denote adds denote-link-markdown-follow to
markdown-follow-link-functions, which eventually calls
denote--act-on-query-link with a nil value.

To solve this, we return nil from denote-link-markdown-follow when we do
not know how to handle the link. That lets markdown-mode try its link
handling. Per the markdown-follow-link-functions documentation, we
should "return non-nil if [we] followed the link, or nil if not."
2026-03-18 15:46:12 -07:00
Protesilaos Stavrou 76c2e27e80
Document how users can have a custom identifier without "T" in it 2026-03-06 19:23:10 +02:00
Protesilaos Stavrou e1d16ba77b
Make stylistic refinements to denote-link-preview-file
We use a similar approach in related functions for the Org link
mechanism.

This builds on top of the contribution of Samuel W. Flint in pull
request 683: <https://github.com/protesilaos/denote/pull/683>.
2026-02-28 22:22:37 +02:00
Protesilaos Stavrou 2ca985d57b
Acknowledge Samuel W. Flint for commit 3d24ea5
The change is small, meaning that Samuel does not need to assign
copyright to the Free Software Foundation.

This change was done in pull request 683: <https://github.com/protesilaos/denote/pull/683>.
2026-02-28 21:31:01 +02:00
Protesilaos Stavrou 6f3649eff4
Merge pull request #683 from swflint/enable-preview
Enable preview of denote links
2026-02-28 21:29:01 +02:00
Protesilaos Stavrou e7478b1627
Simplify how denote-get-link-description checks for function arity
I found func-arity by chance and immediately thought of this. What I
had before was ugly by comparison, even though its idea made sense.
2026-02-28 21:16:40 +02:00
Samuel W. Flint 3d24ea54eb Enable preview of denote links
Preview will only happen if there is one file with the denote ID/path,
and will work with any format supported by `org-link-preview-file`.
2026-02-24 10:13:06 -06:00
Protesilaos Stavrou 9f5a16f625
Tweak how denote--get-common-root-directory checks absolute paths to also work on Windows
I do not have a Windows machine to test this, though it seems
reasonable. I am doing this in response to issue 682 by Pratik-Mishra-497:
<https://github.com/protesilaos/denote/issues/682>.
2026-02-23 17:50:39 +02:00
Protesilaos Stavrou da0685d48d
Expand the manual with how to auto-encrypt new notes with a custom file type
I did this in response to issue 681 by Michael Jones:
<https://github.com/protesilaos/denote/issues/681>.
2026-02-13 13:52:34 +02:00
Protesilaos Stavrou e5d5a4f2d9
Clarify that denote-sequence is its own package
It used to be part of denote.git, but I moved it to its own repository.
2026-02-07 16:09:15 +02:00
Protesilaos Stavrou 2a542e20ff
Link to a more specific section in the manual about "-with-command" commands 2026-01-23 09:30:43 +02:00
Protesilaos Stavrou 3af6cbeb39
Mention denote-link-or-create-with-command in the manual
Thanks to Matthew Batson for the contribution in pull request 674:
<https://github.com/protesilaos/denote/pull/674>.

Matthew has assigned copyright to the Free Software Foundation.
2026-01-23 09:29:27 +02:00
Protesilaos Stavrou 0db5c56a8d
Adjust the spaces in denote-link-or-create-with-command
Thanks to Matthew Batson for the contribution in pull request 674:
<https://github.com/protesilaos/denote/pull/674>.

Matthew has assigned copyright to the Free Software Foundation.
2026-01-23 09:25:06 +02:00
Protesilaos Stavrou 8a573f8247
Merge pull request #674 from mbatson/add-denote-link-or-create-with-command
[Feature Proposal] Add denote-link-or-create-with-command
2026-01-23 09:20:43 +02:00
Protesilaos Stavrou 7b5fb18fab
Acknowledge gvalson for commit 9a9f71d
This was done in pull request 676: <https://github.com/protesilaos/denote/pull/676>.

The change is small, meaning that gvalson does not need to assign
copyright to the Free Software Foundation.
2026-01-23 08:52:03 +02:00
Protesilaos Stavrou 9f70a619db
Merge pull request #676 from gvalson/main
Add reference to the mir package in the manual
2026-01-23 08:50:19 +02:00
gvalson 9a9f71d109 Add reference to the mir package in the manual 2026-01-22 20:22:51 -05:00
Matthew Batson 51cbb47311 Add denote-link-or-create-with-command to the menu bar
The code in this commit was originally written by Protesilaos Stavrou
in commit 69391aa.
2026-01-21 18:38:59 +11:00
Matthew Batson 6ffa6881ce Add denote-link-or-create-with-command 2026-01-21 17:13:11 +11:00
Protesilaos Stavrou e9c44eec58
Use insert-buffer-substring instead of insert-buffer in denote--file-with-temp-buffer
The function insert-buffer is meant to be for interactive use only.

This follows the change made by duli in commit 0f71f12 via pull
request 672: <https://github.com/protesilaos/denote/pull/672>. The
author of the original change has assigned copyright to the Free
Software Foundation.

Also thanks to Jean-Philippe Gagné Guay for reviewing the change and
for reporting a problem with an earlier version of the code in issue
670: <https://github.com/protesilaos/denote/issues/670>.
2026-01-18 09:08:27 +02:00
Protesilaos Stavrou 927c862685
Reword the doc string of denote--file-with-temp-buffer
This follows the change made by duli in commit 0f71f12 via pull
request 672: <https://github.com/protesilaos/denote/pull/672>. The
author of the original change has assigned copyright to the Free
Software Foundation.

Also thanks to Jean-Philippe Gagné Guay for reviewing the change and
for reporting a problem with an earlier version of the code in issue
670: <https://github.com/protesilaos/denote/issues/670>.
2026-01-18 09:03:39 +02:00
Protesilaos Stavrou 159134fee1
Merge pull request #672 from kilesduli/fix-file-not-saved-but-need-rename
Fix front-matter retrieving when buffer is unsaved or file missing
2026-01-18 09:01:53 +02:00
duli 0f71f126cc
Fix front-matter retrieving when buffer is unsaved or file missing
This addresses a regression where
'denote-rename-file-using-front-matter' would fail to recognize changes
in an unsaved buffer, or fail entirely if the file had not yet been
created on disk (as described in
https://github.com/protesilaos/denote/pull/670).

The logic now consistently prioritizes the content of an open buffer
over the file on disk. Previously, the code would revert to reading the
file if the buffer was marked as modified; however, since we cannot
reliably detect if a modification affects the front-matter, it is safe
to always use the live buffer state.

* (denote--file-with-temp-buffer-subr): Remove.
(denote--file-with-temp-buffer): Refactor to prioritize buffer content
and remove the dependency on the internal subr.

Fixes: https://github.com/protesilaos/denote/pull/670
2026-01-17 23:17:14 +08:00
Protesilaos Stavrou 3563d2b3fe
Acknowledge Matthew Batson for commit a31969f
The change is small, meaning that Matthew does not need to assign
copyright to the Free Software Foundation.
2026-01-17 07:18:53 +02:00
Protesilaos Stavrou 7649f42c88
Merge pull request #671 from mbatson/fix-denote-query-extract-title-docstring
Fix docstring of denote-query-extract-title
2026-01-17 07:15:31 +02:00
Matthew Batson a31969fea2 Fix docstring of denote-query-extract-title
Docstring says function returns denote-grep-untitled-string, but it
actually returns denote-query-untitled-string. This commit corrects
the name of the variable in the docstring.
2026-01-17 14:56:52 +11:00
Protesilaos Stavrou 07dcaeebb9
Merge pull request #666 from kilesduli/refactor-denote-sort-dired
Refactor denote-sort-dired and remove the helper function
2026-01-15 08:56:50 +02:00
Protesilaos Stavrou bcbc805f4f
Fix typo in latest commit 1d1732f 2026-01-14 20:57:23 +02:00
Protesilaos Stavrou 1d1732fb57
Acknowledge duilkiles for commits 8a88fcd, e9e8f6f
The author has assigned copyright to the Free Software Foundation.
2026-01-14 20:54:06 +02:00
Protesilaos Stavrou eaedec7463
Merge pull request #669 from kilesduli/fix-input-gpg-password-too-many-times
Fix denote--define-retrieve-front-matter not reusing opened buffer
2026-01-14 20:52:01 +02:00
Protesilaos Stavrou 7ab5f4e9b5
Merge pull request #668 from kilesduli/make-rename-buffer-check-early
Make rename buffer check early
2026-01-14 20:31:38 +02:00
duli 8a88fcde81
Fix denote--define-retrieve-front-matter not reusing opened buffer
In earlier commits, `denote-rename-buffer' could open the same file
multiple times when retrieving front matter, as described in
https://github.com/protesilaos/denote/issues/652 .

This occurred because the subroutine `denote--file-with-temp-buffer-subr',
used in the definition of `denote--define-retrieve-front-matter',
contained incorrect conditional logic. As a result, files were reopened
instead of reusing already opened buffers.

Fixes: https://github.com/protesilaos/denote/issues/652

* (denote--file-with-temp-buffer-subr):
2026-01-15 00:23:23 +08:00
duli e9e8f6f91e
Make rename buffer check early
When users customize `denote-rename-buffer-function' without checking
whether the current buffer is a Denote buffer, `find-file-hook' may
trigger unintended renames.

Because `denote-rename-buffer' accepts an optional buffer argument, the
Denote buffer check must be performed twice.

* (denote-rename-buffer-rename-function-or-fallback):
2026-01-14 21:52:03 +08:00
duli b92f185818
Refactor denote-sort-dired and remove the helper function
This function is extremely slow because calling (dired (cons directory
files)) triggers ls for every file. When there are a large number of
files, The `call-process' becomes expensive. There is no other way to
change this behavior in dired. We should use Emacs’s built-in ls
implementation (ls-lisp). On my machine, with around 200 files, this
reduces execution time by about 6x.

Additionally, prepare-buffer seems unnecessary. It is a private
function (indicated by the double dash) and is not intended for user
access or other use cases. It calls files-fn twice, which is redundant.
We should instead set the revert-function directly in a single function
to make its purpose explicit.

* (denote-sort-dired): refactor
* (denote-sort-dired--prepare-buffer): remove
2026-01-14 20:30:09 +08:00
Protesilaos Stavrou 47207e9cb2
Add missing part from commit c94a848 2026-01-14 09:44:22 +02:00
Protesilaos Stavrou c94a8484ca
Use let* instead of needless when-let* in one instance 2026-01-14 09:43:22 +02:00
Protesilaos Stavrou 23e1e8642b
Tweak the denote--get-common-root-directory error check 2026-01-14 09:37:18 +02:00
Protesilaos Stavrou 1786ebcd0f
Make two stylistic changes to denote--get-common-root-directory 2026-01-14 09:36:08 +02:00
Protesilaos Stavrou d90f3633de
Rewrite denote--get-common-root-directory and include a test for it 2026-01-14 09:19:34 +02:00
Protesilaos Stavrou 0afdc6af14
Acknowledge Matto Fransen for commit b9ff7e6
The change is small which means that Matto does not need to assign
copyright to the Free Software Foundation.
2026-01-12 22:49:32 +02:00
Matto Fransen b9ff7e6617
Add reference to denote-review package in the manual 2026-01-12 22:48:49 +02:00
Protesilaos Stavrou 301575c318
Add another condition to denote-file-type to fall back to user's preferred file type 2026-01-11 19:06:39 +02:00
Protesilaos Stavrou a0b834f53b
Update copyright years 2026-01-11 11:30:27 +02:00
Protesilaos Stavrou 0a076981a9
Acknowledge Alvin Hsu for commit 46c49e5
This was done in pull request 664: <https://github.com/protesilaos/denote/pull/664>.
The change is small, meaning that Alvin does not need to assign
copyright to the Free Software Foundation,
2026-01-09 10:03:47 +02:00
Protesilaos Stavrou 89875abad6
Merge pull request #664 from aurtzy/fix-denote-sort-dired
Fix error in denote-sort-dired when regexp is a subdirectory
2026-01-09 10:01:36 +02:00
Alvin Hsu 46c49e51ee Fix error in denote-sort-dired when regexp is a subdirectory
In the DIRNAME list argument to `dired', the first element is treated as a
directory name, with the rest being file paths relative to that directory.
`dired' appears to fall back to the parent directory when DIRED-NAME does not
match any subdirectory, resulting in expected correct behavior; however, when
there is a matched directory, it will attempt to search for files relative to
that directory instead, which may result in file-not-found errors.

Thus, we remove and replace DIRED-NAME such that we always use the directory
that the files are supposed to be relative to.

Fixes: #662
2026-01-08 20:59:31 +08:00
Protesilaos Stavrou 9e02bf4bd0
Merge pull request #661 from jeanphilippegg/directories-parameter
Fix #654
2026-01-08 07:43:28 +02:00
Jean-Philippe Gagné Guay 786c86f567 Add denote--get-file-name-relative-to-directories 2026-01-04 19:42:08 -05:00
Jean-Philippe Gagné Guay 65255f46df Make denote-directory-get-files private 2026-01-04 19:18:04 -05:00
Jean-Philippe Gagné Guay b8be7d7bf0 Remove directories parameter from some functions 2026-01-04 19:17:55 -05:00
Protesilaos Stavrou cf2a6b082b
BREAKING: make denote-fontify-links-mode only work in plain text
Check what I am doing in denote-fontify-links-mode to make it work
only in some places and to work around the default behaviour of
toggling a minor mode interactively.
2026-01-03 08:33:48 +02:00
Protesilaos Stavrou 40192c9fcc
Rename the keymap used by denote-fontify-links-mode 2026-01-03 08:33:48 +02:00
Protesilaos Stavrou dc50c92ac8
Expand the doc string of denote-fontify-links-mode 2026-01-03 08:33:48 +02:00
Protesilaos Stavrou 2d83bf12a3
Make denote-fontify-links-mode-maybe also cover markdown-mode
This is because of commit 72e3c01, which makes Markdown mode buffers
work with all Denote links (direct links and query links).
2026-01-03 08:33:48 +02:00
Protesilaos Stavrou 3a66793dd0
Add alias for denote-add-links 2026-01-03 08:33:48 +02:00
Protesilaos Stavrou d8cd571f91
Clarify the doc string of denote-add-links 2026-01-03 08:33:48 +02:00
Protesilaos Stavrou d16465816e
Mention the link to contents in denote-add-links 2026-01-03 08:33:48 +02:00
Protesilaos Stavrou f55b84317a
Mention the link to contents command in the "Getting started with Denote" 2026-01-03 08:33:48 +02:00
Protesilaos Stavrou 730d3d9734
Reword doc string of denote--command-with-features
Just so that it is imperative.
2026-01-03 08:33:48 +02:00
Protesilaos Stavrou b42fc5fea4
Fix error with nil values for the affix function
When the helpers there return nil I am getting an error because the
completion expects a string.
2026-01-02 11:18:31 +02:00
Protesilaos Stavrou 9b907d5457
Acknowledge alvmts for commit 7f91907
This was done in pull request 658: <https://github.com/protesilaos/denote/pull/658>.
The change is small, meaning that alvmts does not need to assign
copyright to the Free Software Foundation.
2026-01-02 08:25:04 +02:00
Protesilaos Stavrou 2aacd8f90d
Merge pull request #658 from alvmts/alvmts-patch-1
Fix trimming of Org links in `denote-link-ol-follow'
2026-01-02 08:23:54 +02:00
alvmts 7f91907a79
Simplify regexp in `denote-link-ol-follow' 2026-01-01 02:10:43 -05:00
alvmts 54494edf5a
Fix trimming of Org links in `denote-link-ol-follow'
This patch makes it so only search options in Org links get trimmed when checking whether the linked file exists.

The old regex erroneously truncates filenames containing a single colon, so "/tmp/foo:bar/file.ext" becomes "/tmp/foo".
2026-01-01 01:39:22 -05:00
Protesilaos Stavrou a576d8917c
Clarify that denote-org-capture-with-prompts SIGNATURE is part of the current development target 2025-12-29 07:39:49 +02:00
Protesilaos Stavrou 06cc35ab80
Fix wrapping in commit 1c3f404 and acknowledge Tobias Lidman-Strauss for it
The commit was done in merge request 2 on the GitLab mirror:
<https://gitlab.com/protesilaos/denote/-/merge_requests/2>.
2025-12-28 08:43:46 +02:00
Protesilaos Stavrou e3a363f367 Merge branch 'drostan-main-patch-47068' into 'main'
Function denote-org-capture-with-prompts updated to accept signature prompt (new try)

See merge request protesilaos/denote!2
2025-12-28 08:39:22 +02:00
Tobias Lidman-Strauss 1c3f4042f9 Function denote-org-capture-with-prompts updated to accept signature prompt (new try) 2025-12-28 08:39:22 +02:00
Protesilaos Stavrou 1d0b6fb5d4
Reimplement commit be6e713 without removing HAS-IDENTIFIER from denote-directory-files
Thanks to Jean-Philippe Gagné Guay for reminding me that
HAS-IDENTIFIER is for use-cases we support. This was done in issue
655: <https://github.com/protesilaos/denote/issues/655>
2025-12-28 08:10:09 +02:00
Protesilaos Stavrou bea7718049
Revert "REMOVE the has-identifier from denote-directory-files and make obsolete denote-directory-get-files-function"
This reverts commit be6e713d88.

Thanks to Jean-Philippe Gagné Guay for reminding me that this change
breaks some of the use-cases we support. This was done in issue 655:
<https://github.com/protesilaos/denote/issues/655>
2025-12-28 07:49:09 +02:00
Protesilaos Stavrou be6e713d88
REMOVE the has-identifier from denote-directory-files and make obsolete denote-directory-get-files-function
This was making things too complex for our purposes. Users who need to
do something else should write an advice for this function.

I am also adding an optional DIRECTORIES parameter in the spirit of
commit 5203bc0.
2025-12-22 06:59:43 +02:00
Protesilaos Stavrou 5203bc00cf
Ensure that denote-directories is not computed multiple times 2025-12-22 06:41:04 +02:00
Protesilaos Stavrou 916dde6ba7
Throw error if denote-get-file-name-relative-to-denote-directory FILE is not absolute 2025-12-22 05:47:53 +02:00
Protesilaos Stavrou 6751c1b999
Use file prompt metadata for denote-select-from-files-prompt as well 2025-12-22 05:24:59 +02:00
Protesilaos Stavrou 0dfaf46a68
Make affixation for file prompt also cover custom identifiers and signatures 2025-12-22 05:18:55 +02:00
Protesilaos Stavrou 09a382fc46
Add FIXME about the group-function breaking the completion highlight of match visible words
I cannot tell why this is happening. Will need to investigate further.
I thought it might have to do with 'denote-retrieve-filename-title'
changing the match data. But the problem persists even if I put a
regular string in its case which is also found in the completion
candidates I am testing it against.
2025-12-16 17:55:51 +02:00
Protesilaos Stavrou badafe9782
Simplify the denote-file-prompt group-function 2025-12-16 17:54:24 +02:00
Protesilaos Stavrou f6243f1ecb
Make stylistic change to an if-let in denote-file-prompt-group 2025-12-16 09:25:32 +02:00
Protesilaos Stavrou fde5e924fc
Tone down the directory component (see commit cdfffba) 2025-12-16 08:47:06 +02:00
Protesilaos Stavrou cdfffbaeaa
Account for subdirs in denote-file-prompt-group function 2025-12-16 08:45:10 +02:00
Protesilaos Stavrou 5f082c5a07
Use as Commentary what I have in the README.md and on my website 2025-12-16 07:37:35 +02:00
Protesilaos Stavrou 75c75a90e3
Use 'denote-file' completion category and make icons' packages know about it 2025-12-16 06:30:22 +02:00
Protesilaos Stavrou ce86684870
Avoid calling the denote-directories twice when single-dir-p is relevant 2025-12-15 18:23:49 +02:00
Protesilaos Stavrou 1064cc2f38
Make stylistic change to denote-sort-component-prompt 2025-12-15 09:52:11 +02:00
Protesilaos Stavrou bc5f10d963
Use completion table for denote-command-prompt 2025-12-15 09:51:59 +02:00
Protesilaos Stavrou 8ea5ac5cd9
Expand the completion metadata of the denote-file-prompt 2025-12-15 09:51:17 +02:00
Protesilaos Stavrou cc83feb3ba
Include denote-rename-file-identifier in the manual
Thanks to jarofromel for telling me about its absence in issue 646:
<https://github.com/protesilaos/denote/issues/646>.
2025-12-14 09:29:22 +02:00
Protesilaos Stavrou f7e6f4d442
Define group function and display-sort-function for denote-file-prompt 2025-12-14 09:12:29 +02:00
Protesilaos Stavrou ee0685ccc7
Rewrite the denote-subdirectory-prompt and add relevant comments 2025-12-14 08:07:56 +02:00
Protesilaos Stavrou d9537e2c9d
Add FIXME about denote-get-file-name-relative-to-denote-directory 2025-12-14 08:07:44 +02:00
Protesilaos Stavrou d9ecf5a988
Add optional DIRECTORIES to denote-directory-subdirectories and relevant FIXME 2025-12-14 08:04:45 +02:00
Protesilaos Stavrou a2476e9ac7
Add FIXME comment about denote-directory-get-files 2025-12-14 08:02:57 +02:00
Protesilaos Stavrou 7cc62eb5fb
Make denote--directory-all-files-recursively accept DIRECTORIES and add FIXME about it 2025-12-14 08:01:43 +02:00
Protesilaos Stavrou 68a5c712d5
Add optional DIRECTORIES to denote-directories-get-common-root 2025-12-14 07:59:50 +02:00
Protesilaos Stavrou 4fe3cf165e
Define denote-get-completion-table and use it 2025-12-14 07:18:09 +02:00
Protesilaos Stavrou 220644d97c
Add missing reference to denote-query-format-heading-function in the manual 2025-12-13 05:26:17 +02:00
Protesilaos Stavrou 72e3c01a7b
Change how we integrate with markdown-follow-link-functions and explain why
I hope this does not comes back to bite me but we will find out in
time. It looks safe.
2025-12-13 05:19:29 +02:00
Protesilaos Stavrou 04f604877e
Make small refinements to denote-fontify-links 2025-12-13 05:19:00 +02:00
Protesilaos Stavrou 4497f11b35
Remove wrong key binding from denote-link-mouse-map 2025-12-13 05:18:26 +02:00
Protesilaos Stavrou 74c7aeeb1b
Explain why denote-grep display-buffer action is different 2025-12-13 05:18:03 +02:00
Protesilaos Stavrou 42a3f393e2
Use consistent display-buffer actions for backlinks and query links 2025-12-13 05:17:36 +02:00
Protesilaos Stavrou e45fde09c1
Use diffent fn for denote-query-format-heading-function value and update docstring 2025-12-13 05:16:30 +02:00
Protesilaos Stavrou d86cb70426
Make sure denote-get-link-description issues a warning only when it must
Otherwise it warns every time a link is inserted, which is wrong.

Thanks to Oliver Epper for reporting the problem in issue 651:
<https://github.com/protesilaos/denote/issues/651>.
2025-11-29 07:08:11 +02:00
Protesilaos Stavrou 529148eba6
Elaborate where I learnt about wrong-number-of-arguments error type 2025-11-24 12:23:56 +02:00
Protesilaos Stavrou 133439ba1e
Bump version number to trigger GNU ELPA update
There have been some fixes that I want to include in the package.
Otherwise I will need to delay those until version 4.2.0, which might
be released next year...
2025-11-23 05:36:49 +02:00
Protesilaos Stavrou c4a6ec07e6
Add a comment about how I discovered wrong-number-of-arguments
We would probably be okay with just ignoring 'error' but what I did
there with wrong-number-of-arguments seems more precise.
2025-11-23 05:15:45 +02:00
Protesilaos Stavrou a3109ed9b4
Call function of denote-link-description-format with two arguments
I still support the old calling convention to not break existing code,
but we should move to the new one eventually. This way we can pass the
file type as an argument to not have to calculate it more than once
while calling 'denote-link' and related.
2025-11-23 05:12:04 +02:00
Protesilaos Stavrou b30cfcb5c9
Make stylistic change to let binding of denote--delete-active-region-content 2025-11-22 12:11:14 +02:00
Protesilaos Stavrou df76615cf9
Make stylistic change to let binding of denote--get-active-region-content 2025-11-22 12:10:43 +02:00
Protesilaos Stavrou 0f93eee66f
Make denote--get-active-region-content return non-blank string 2025-11-22 07:17:02 +02:00
Protesilaos Stavrou 7851a3b97e
Add FIXME to avoid duplication in denote-link-description-with-signature-and-title 2025-11-22 06:54:47 +02:00
Protesilaos Stavrou dda6c5a9f7
Show directory in denote-file-prompt only when denote-directory has many
The idea is that if the user has configured denote-directory to a list
of directories, then we want to inform them where the file prompt is
at. For a single directory, this is superfluous.
2025-11-18 19:40:42 +02:00
Protesilaos Stavrou eff64968fa
Remove some old obsolescence warnings
They have been there for close to two years now. I think we can safely
get rid of them now.
2025-11-04 12:53:27 +02:00
Protesilaos Stavrou 37e9a74f77
Use define-obsolete-function-alias instead of make-obsolete for two obsolescence warnings 2025-11-04 12:51:27 +02:00
Protesilaos Stavrou 9f1042f4f6
Document denote-rename-file-identifier behaviour about not breaking backlinks
Thanks to jarofromel for pointing out that the documentation and error
message could be improved. This was done in issue 646:
<https://github.com/protesilaos/denote/issues/646>.
2025-11-01 07:45:13 +02:00
Protesilaos Stavrou c4cb46f592
Rename a binding in denote-sort-dired for clarity and consistency 2025-10-30 13:38:02 +02:00
Protesilaos Stavrou d94e942ac0
Make sure the denote-file-prompt uses what it got already from denote-has-single-denote-directory-p 2025-10-30 13:36:45 +02:00
Protesilaos Stavrou 252908697a
Make denote-link--buffer-file-prompt only check for denote-directory once 2025-10-30 13:36:22 +02:00
Protesilaos Stavrou cce09d2a25
Make denote-select-from-files-prompt only check for denote-directory once 2025-10-30 13:32:47 +02:00
Protesilaos Stavrou c3675d20e3
Remove trailing spaces from denote-md-link-in-context-regexp 2025-10-30 07:17:09 +02:00
Protesilaos Stavrou 0fb25e6770
Make hash table test function sharp quoted 2025-10-30 06:17:25 +02:00
Protesilaos Stavrou 84aa0d3bb7
Reword the denote-directory doc string to avoid two pedantic warnings 2025-10-30 06:16:53 +02:00
Protesilaos Stavrou 8dd6f868be
Make stylistic changes to denote-sluggify-and-apply-rules
I think this makes it easier to read. Besides, I found my first
legitimate use of 'thread-first'... party time!
2025-10-29 19:04:21 +02:00
Protesilaos Stavrou 50f9496734
Use the correct :type for user options that expect regexp or nil
Thanks to Stefan Monnier for pointing this out on the emacs-devel
mailing list: <https://lists.gnu.org/archive/html/emacs-devel/2025-10/msg00683.html>.
2025-10-26 14:13:44 +02:00
Protesilaos Stavrou cd6dd03f80
Merge branch 'changes-for-4.2.0' 2025-10-25 17:20:08 +03:00
Protesilaos Stavrou 13a4de04c8
Bump version number to trigger GNU ELPA rebuild for commit 9e638cc 2025-10-18 07:57:49 +03:00
Protesilaos Stavrou 9e638cc72f
Use 'define-obsolete-variable-alias' instead of 'make-obsolete-variable' for two that are still used
Thanks to Matthias Fuchs for informing me about a package that
depended on the old symbols. This was done in issue 640:
<https://github.com/protesilaos/denote/issues/640>.
2025-10-18 07:56:57 +03:00
Protesilaos Stavrou d69a679b2c
Make denote-infer-keywords enforce a controlled vocabulary when nil
This was always the implied use-case, but we were not enforcing it at
the minibuffer prompt.
2025-10-18 07:16:37 +03:00
Protesilaos Stavrou fcf5bccfd5
Use a more obvious name for denote-excluded-keywords-regexp 2025-10-18 07:00:06 +03:00
Protesilaos Stavrou c1250c9434
Update the documentation of denote-directory to better explain what it is about 2025-10-18 06:24:38 +03:00
Protesilaos Stavrou ff373d18e4
Fix a link in the latest CHANGELOG.org 2025-10-17 09:52:15 +03:00
Protesilaos Stavrou d4ba0eb290
Update to Denote version 4.1.0 2025-10-17 09:32:59 +03:00
Protesilaos Stavrou 0cc7a0d918
Fix a typo in the manual 2025-10-16 19:15:07 +03:00
Protesilaos Stavrou e9bfd528d5
Add missing last-modified from the :type of denote-sort-dired-default-sort-component 2025-10-16 19:14:33 +03:00
Protesilaos Stavrou 451e5009fb
Merge branch 'main' of github.com:protesilaos/denote 2025-10-07 18:32:41 +03:00
Protesilaos Stavrou b89d30de21
Try a simpler implementation of denote--file-has-backlinks-p
I discussed this with Yann Dutrieux in the follow-up to pull request
637: <https://github.com/protesilaos/denote/pull/637>.
2025-10-07 07:58:43 +03:00
Protesilaos Stavrou 679c13c5d9
Make stylistic change to denote-link--map-over-notes for readability 2025-10-06 20:20:00 +03:00
Protesilaos Stavrou 0d5ce4f22b
Make stylistic change to denote-subdirectory-prompt 2025-10-06 20:14:20 +03:00
Protesilaos Stavrou 7482fbc487
Acknowledge Yann Dutrieux for commit d509565
This was done in pull request 637: <https://github.com/protesilaos/denote/pull/637>.

The change is small, meaning that Yann does not need to assign
copyright to the Free Software Foundation.
2025-10-06 18:36:09 +03:00
Protesilaos Stavrou d509565e6b
Merge pull request #637 from dizzyyogi/gh_issue_636_dizzyyogi
Check in denote--file-has-backlinks-p whether link matches file id
2025-10-06 18:34:39 +03:00
Yann Dutrieux f42b6d663b Check in denote--file-has-backlinks-p whether link matches file id 2025-10-05 19:34:10 +02:00
Protesilaos Stavrou 444db90dab
Add link to "Getting started" section of the manual in the README.md 2025-09-26 08:27:54 +03:00
Protesilaos Stavrou e1fe1278eb
Include a "Getting started with Denote" section in the manual 2025-09-26 08:23:46 +03:00
Protesilaos Stavrou d1dcab874e
Make denote-query-sorting docs more consistent between manual and docstring 2025-09-24 13:20:33 +03:00
Protesilaos Stavrou e19538b5c5
Add the missing function :type from the user option denote-query-sorting 2025-09-24 13:20:12 +03:00
Protesilaos Stavrou 73c2ada5d2
Make small rewording in the manual 2025-09-24 13:09:30 +03:00
Protesilaos Stavrou fafe2b610f
Add custom identifier example: like the default plus capital letter for day of week 2025-09-24 07:41:14 +03:00
Protesilaos Stavrou 83dd0fefb1
Mention the custom identifier with a prompt in the denote-prompts section of the manual 2025-09-19 11:27:32 +03:00
Protesilaos Stavrou 747bbb914f
Document the user of 'denote-prompts' for custom identifiers 2025-09-19 11:26:34 +03:00
Protesilaos Stavrou 02193f9477
Remove the "identifier as number" from denote.el and put it in the manual
We are not using it internally and we do not need to provide it as
part of denote.el. Users who want custom identifiers will eventually
ask for all sorts of variations on this theme. We can keep everything
documented in the manual where we also have the freedom to add more
things to accommodate each use-case.
2025-09-19 11:12:17 +03:00
Protesilaos Stavrou 89b5275a52
Add another custom identifier example in the manual 2025-09-19 11:03:03 +03:00
Protesilaos Stavrou 9960ca320f
Flesh out the custom identifier code sample 2025-09-18 19:33:21 +03:00
Protesilaos Stavrou a39a0e0d1d
Add WORK-IN-PROGRESS example of a custom identifier scheme 2025-09-18 15:32:36 +03:00
Protesilaos Stavrou c9a13ee59e
Make small refinement to denote--link-at-point-get-data 2025-09-15 07:30:48 +03:00
Protesilaos Stavrou fec1a41e2e
Make denote-fontify-links compute its data only once
Otherwise we get font-lock to always call 'denote-filetype-heuristics'
on the buffer.
2025-09-15 07:23:31 +03:00
Protesilaos Stavrou e8eb15625d
Make denote--file-has-backlinks-p exit as soon as it finds a single backlink
This should be faster than before most of the times (well, unless the
file containing the links is the last on the list).
2025-09-10 12:02:53 +03:00
Protesilaos Stavrou 667dc1eb9b
Remove some needless pcase-let 2025-08-19 21:37:53 +03:00
Protesilaos Stavrou 5d5c29dd77
Remove needless comment in denote-fontify-links 2025-08-19 18:51:48 +03:00
Protesilaos Stavrou a4d6f321b4
Make denote-link-ol-help-echo more robust 2025-08-19 18:44:04 +03:00
Protesilaos Stavrou f4b9028178
Make denote-get-link-identifier-or-query-term-at-point more robust 2025-08-19 18:41:14 +03:00
Protesilaos Stavrou d58a684f0f
Make denote--get-link-file-path-at-point more robust 2025-08-19 18:37:22 +03:00
Protesilaos Stavrou 51fb9c7a4c
Clarify the use of denote--link-at-point-get-data in its docstring 2025-08-19 18:32:57 +03:00
Protesilaos Stavrou 0d696e7c35
Change how the helpers of "link at point" get the position
It is better for helper functions to expect an argument, because then
we can adapt them to our needs. Here we use '(point)', but we may have
another approach elsewhere.
2025-08-19 18:24:34 +03:00
Protesilaos Stavrou 4905da57ae
Make denote--link-open-at-point-subr more robust (see commit 76c1345)
Thanks to Bhargav Kulkarni for reporting the bug in issue 631 and for
Jean-Philippe Gagné Guay for commenting on how best to approach the
problem: <https://github.com/protesilaos/denote/issues/631>.
2025-08-17 18:09:03 +03:00
Protesilaos Stavrou 76c13454ae
Define helper functions to test if point is inside link regexp
The 'denote--inside-link-regexp-p' is based on the function
'org-in-regexp' that I found in the org-macs.el file of Org version
9.7.11.

Thanks to Jean-Philippe Gagné Guay for the feedback in issue 631 that
helped refine 'denote--inside-link-regexp-p':
<https://github.com/protesilaos/denote/issues/631#issuecomment-3194420425>.
2025-08-17 18:02:07 +03:00
Protesilaos Stavrou 7f5d9974f2
Fix package version in make-obsolete message about '(denote-directory)'
Thanks to Jean-Philippe Gagné Guay for pointing this out:
<https://github.com/protesilaos/denote/pull/632#issuecomment-3193637023>.
2025-08-16 15:35:47 +03:00
Protesilaos Stavrou 9b6f3ecee7
Add a missing space from the default denote-file-prompt text 2025-08-16 08:01:41 +03:00
Protesilaos Stavrou 12090237bc
Make the denote-directory function obsolete
I have gone back and forth on this issue. Jean-Philippe Gagné Guay
convinced me that it is better to deprecate it because this way the
users will be more informed about what is happening.

This is done in a comment and was then reminded it of it again in pull
request 632:

- <947f0be070>.
- <https://github.com/protesilaos/denote/pull/632>
2025-08-16 07:20:09 +03:00
Protesilaos Stavrou 70a473d41b
Merge pull request #632 from jeanphilippegg/readme
Various precisions in the manual
2025-08-16 07:19:39 +03:00
Jean-Philippe Gagné Guay ef31105cd8 Various precisions in the manual 2025-08-15 23:22:50 -04:00
Protesilaos Stavrou 80be3d309b
Make stylistic change in one comment 2025-08-09 12:04:15 +03:00
Protesilaos Stavrou 0b3fdcecb6
Do not try to prompt for 'denote-directories' and use 'denote-directory' instead
What I was trying to do earlier with the "maybe prompt" was not a good
idea, as pointed out by Jean-Philippe Gagné Guay:
<947f0be070 (commitcomment-163492171)>.

We do not want to compromise the Lisp calls to the relevant functions:
those should remain non-interactive.

The 'denote-prompts' can be configured to prompt for a directory,
which I forgot worked for parent level directories as well.

About the function 'denote-directory', I have gone back and forth
regarding whether to deprecate it or not. I think it is better to keep
it than have '(car (denote-directories))' everywhere: if we ever need
to change anything, then we can rely on it propagating elsewhere,
including to code that users will likely have.
2025-08-09 11:57:58 +03:00
Protesilaos Stavrou 947f0be070
Prompt for directory among 'denote-directories' if needed
The idea is to stop relying on the '(car (denote-directories))' pattern.
2025-08-05 14:46:33 +03:00
Protesilaos Stavrou 54d9946333
Use the new function to get the common root in the manual's sample code 2025-08-05 07:42:43 +03:00
Protesilaos Stavrou 85ccf5998d
Document the denote-directories function and make related changes to the manual 2025-08-05 07:41:33 +03:00
Protesilaos Stavrou 1fa853acc0
Introduce the function denote-directories-get-common-root 2025-08-05 07:40:53 +03:00
Protesilaos Stavrou 658659c83e
Stop declaring the denote-directory function as obsolete
There are plenty of custom functions that still use it. We will
improve things internally, but I see this function continuing to be
useful long-term.
2025-08-05 07:37:48 +03:00
Protesilaos Stavrou a234f7a592
Add FIXME for the function denote-directory 2025-08-05 07:23:54 +03:00
Protesilaos Stavrou 307db01003
Make denote--prepare-note only error if an existing file is not empty
This way we avoid cases where some other function saves the buffer
before we get to operate on it. One such example is 'lsp-auto-touch-files',
as noted by wuzhihao in issue 627: <https://github.com/protesilaos/denote/issues/627>.
2025-08-02 19:12:00 +03:00
Protesilaos Stavrou 955618e75c
Make small tweaks to two doc strings 2025-08-02 19:07:32 +03:00
Protesilaos Stavrou 49246e443f
Acknowledge Ashish Panigrahi for commit 2103ee1
This was done in pull request 625: <https://github.com/protesilaos/denote/pull/626>.

The change affects a single word, meaning that Ashish does not need to
assign copyright to the Free Software Foundation.
2025-08-01 14:21:57 +03:00
Protesilaos Stavrou a416c5b114
Merge pull request #626 from paniash/patch-1
Fixed typo
2025-08-01 14:21:12 +03:00
Protesilaos Stavrou e2c77a5476
Update the comment about denote--file-has-backlinks-p
This is an important thing to work on. What we have now is too
expensive for a feature that is small.
2025-08-01 12:43:21 +03:00
Protesilaos Stavrou 94546c048f
Make denote-get-backlinks produce error earlier if needed
If the file has no identifier, we do not want to check if it is in our
directories, anyway.
2025-08-01 12:28:52 +03:00
Protesilaos Stavrou 29e9436349
Remove some needless text from the manual about denote-rename-buffer-format 2025-08-01 12:24:47 +03:00
Protesilaos Stavrou 2a6bbd5ede
Remove the backlinks from the default denote-rename-buffer-format
This is because the way we handle the check for backlinks is to go
through ALL files. Given the way the denote-rename-buffer-mode works,
we do this EACH TIME we open or create a Denote file. This is inefficient.

The goal is to improve how we handle the retrieval of backlinks.
Though independent of that project, I think a simpler name for buffers
is a better default. Users who need to see an indicator for backlinks
can opt in to it (for example, users may not even be using direct
links, as they rely on query links instead).
2025-08-01 12:21:19 +03:00
Protesilaos Stavrou 81d392bf33
Check for existing file earlier in denote--prepare-note 2025-08-01 12:19:58 +03:00
Ashish Panigrahi 2103ee198c
Fixed typo
Fixed a typo in the documentation. Denote was mispelled as "Deonte".
2025-07-31 14:14:48 +03:00
Protesilaos Stavrou a7c562e4bc
Merge pull request #625 from jeanphilippegg/cleanup
Various adjustments
2025-07-27 12:53:59 +03:00
Protesilaos Stavrou 7707c2681d
Make stylistic change to denote-grep-file-regexp-prompt 2025-07-27 12:37:32 +03:00
Protesilaos Stavrou 6c3423fc85
Make stylistic change to denote-grep-query-prompt 2025-07-27 12:37:06 +03:00
Protesilaos Stavrou 35fb700d8c
Consolidate the user-error of the various query commands 2025-07-27 12:31:21 +03:00
Protesilaos Stavrou 32eb10d2e7
Make stylistic change to denote-make-links-buffer 2025-07-27 12:24:50 +03:00
Protesilaos Stavrou 8fc130cec6
Make stylistic change to denote-make-backlinks-buffer 2025-07-27 12:23:07 +03:00
Protesilaos Stavrou 4d4a8c57e0
Make stylistic change to denote-get-backlinks 2025-07-27 12:21:57 +03:00
Protesilaos Stavrou 447930e410
Make denote-get-backlinks only work in a denote directory
Otherwise, we are trying to check if a file anywhere in the file
system has backlinks in the 'denote-directory'. Those links should not
happen, as 'denote:' links only work for identifiers in the 'denote-directory'.
2025-07-27 12:09:10 +03:00
Jean-Philippe Gagné Guay e8fa213409 Obsolete denote-filename-is-note-p and denote-file-is-note-p 2025-07-19 00:16:21 -04:00
Jean-Philippe Gagné Guay 38c7c8f195 Remove comment in denote-generate-identifier-automatically 2025-07-19 00:16:21 -04:00
Jean-Philippe Gagné Guay 9f0d027609 Add has-identifier parameter to denote-directory-files and denote-file-prompt 2025-07-19 00:16:21 -04:00
Jean-Philippe Gagné Guay 46d1825bf2 Use denote-file-has-denoted-filename-p in denote-directory-get-files 2025-07-19 00:16:21 -04:00
Jean-Philippe Gagné Guay ef97da673c Add identifier sluggification 2025-07-18 22:45:55 -04:00
Jean-Philippe Gagné Guay f3f10462f4 Add denote-identifier-delimiter-always-present-in-file-name 2025-07-18 22:34:32 -04:00
Jean-Philippe Gagné Guay 5f9dd9a90d Remove comment in denote-format-file-name 2025-07-18 22:33:23 -04:00
Jean-Philippe Gagné Guay 444836c396 Remove unnecessary code in denote--find-first-unused-id-as-number 2025-07-18 22:03:43 -04:00
Jean-Philippe Gagné Guay 20dc124e88 Add comments to denote-generate-identifier-as-number 2025-07-18 22:03:43 -04:00
Protesilaos Stavrou 24b88f1fb5
Use correct wording in doc string of denote-make-backlinks-buffer 2025-07-17 11:47:57 +03:00
Protesilaos Stavrou b9ee610cbe
Use split-string instead of string-split
The latter is an alias introduced in Emacs 29. We do not want to
depend on Emacs 29 for something like this.
2025-07-16 09:26:28 +03:00
Protesilaos Stavrou ad1537d22a
Merge pull request #624 from jeanphilippegg/custom-identifiers
Custom identifier formats
2025-07-15 13:14:12 +03:00
Jean-Philippe Gagné Guay f704b49df4 Allow custom identifier formats 2025-07-12 23:10:01 -04:00
Jean-Philippe Gagné Guay 486abe9dbf Fix docstring of denote-backlinks 2025-07-12 23:10:01 -04:00
Jean-Philippe Gagné Guay 491ad9a788 Use denote-make-backlinks-buffer in denote-backlinks 2025-07-12 23:10:01 -04:00
Jean-Philippe Gagné Guay 76ecfd24d6 Use denote-retrieve-xref-alist-for-backlinks in denote-get-backlinks 2025-07-12 23:10:01 -04:00
Jean-Philippe Gagné Guay 99d5eda377 Add denote-make-backlinks-buffer 2025-07-12 23:10:01 -04:00
Jean-Philippe Gagné Guay b43149df38 Add denote-retrieve-xref-alist-for-backlinks
Also add denote--get-files-by-file-type and denote--get-all-backlinks
2025-07-12 23:10:01 -04:00
Jean-Philippe Gagné Guay 5ae68fcc19 Add :link-retrieval-format in denote-file-types 2025-07-12 23:10:01 -04:00
Protesilaos Stavrou 7c73cbbd52
Merge pull request #623 from brabalan/patch-2
documentation change for denote-rename-file
2025-07-11 15:47:56 +03:00
Alan Schmitt 7d82c434e9
documentation change for denote-rename-file
Added the information that denote-rename-file can use `'keep-current` for the identifier as well
2025-07-11 12:04:19 +00:00
Protesilaos Stavrou 770c5e41f2
Include a separator line in denote-dired-empty-mode 2025-07-10 06:41:52 +03:00
Protesilaos Stavrou 91c32fb3c1
Write sample code in the manual to retroactively reorder file name components 2025-07-09 15:56:28 +03:00
Protesilaos Stavrou 8ab4fac181
Use a major mode instead of a function that sets up special-mode
It is about the same code plus we can easily have a keymap there, get
the option of a hook, and potentially are more flexible with what we
can do.
2025-07-08 10:47:30 +03:00
Protesilaos Stavrou a1148a5da5
Use special-mode instead of fundamental-mode in denote-sort-dired--revert-to-empty
This is discussed with Alan Schmitt in issue 618: <https://github.com/protesilaos/denote/issues/618>.

Alan suggests a keymap to quit the window and kill the buffer. Maybe
we do not need that and can get away with just the special-mode.
2025-07-08 10:30:27 +03:00
Protesilaos Stavrou dd662876d4
Untabify and reindent file 2025-07-08 07:08:49 +03:00
Protesilaos Stavrou 79fc1d2cff
Make denote-sort-dired revert to an empty buffer if no matching files
This is discussed with Alan Schmitt and Rory Molinari in issue 618:
<https://github.com/protesilaos/denote/issues/618>.

I am using a bespoke buffer because I cannot find a way to achieve the
same result with a call to (dired (cons DIR FILES)). If that is
possible, then I am happy to switch to it. But this will do for the
time being.
2025-07-08 07:06:17 +03:00
Protesilaos Stavrou 5a473f9a8b
Clarify that the "empty files" variants of denote-sort-dired depend on current dev version 2025-07-07 16:42:40 +03:00
Protesilaos Stavrou ba9f164b8b
Update the sample denote-sort-dired variants for empty files 2025-07-07 16:37:50 +03:00
Protesilaos Stavrou 693c43ede8
Quote the lambda used in denote-sort-dired
Because of lexical-binding, the return value was fixed. But if a user
copies the code into the scratch buffer, renames the function, and
evaluates it, the lambda will be subject to dynamic scoping. This way,
we protect users from a faulty revert-buffer-function.
2025-07-07 16:36:20 +03:00
Protesilaos Stavrou 35f79506d1
Avoid repetition in the denote-sort-dired helpers 2025-07-07 13:53:06 +03:00
Protesilaos Stavrou e37c18d843
Make denote-sort-dired use a unique buffer each time
When we were passing the directory as (dired (cons DIRECTORY FILES))
we were inadvertently setting up Dired to re-use the buffer it
produced. Whereas we always want to have a new one for distinct
searches.

This is how we were doing it in the past but we had issues with the
revert-buffer function. Maybe we are good now.
2025-07-07 13:39:42 +03:00
Protesilaos Stavrou 73456765f1
Make some further refinements to the denote-sort-dired (extend commit c6c02ef) 2025-07-07 13:22:31 +03:00
Protesilaos Stavrou c6c02ef2df
Make denote-sort-dired more abstract
The idea is to make it easier to write custom variations of the
denote-sort-dired.
2025-07-07 13:09:04 +03:00
Protesilaos Stavrou 5b0a02d162
Revise denote-sort-dired buffer setup
We want the buffer to revert properly. Files that do not exist anymore
should not inhibit it and subsequent calls to 'denote-sort-dired'
should use their own separate buffer.

This was discussed at length in issue 618 with the participation of
Alan Schmitt and Rory Molinari: <https://github.com/protesilaos/denote/issues/618>.
2025-07-07 10:54:10 +03:00
Protesilaos Stavrou 9885bc6a08
Make small rewording to the docs of denote-get-identifier-function 2025-07-07 06:50:50 +03:00
Protesilaos Stavrou 0728da8a28
Use correct revert-buffer-function in denote--display-buffer-from-xref-alist
The code was submitted by Jean-Philippe Gagné Guay as part of the
larger pull request 621: <https://github.com/protesilaos/denote/pull/621>.
2025-07-06 20:49:07 +03:00
Protesilaos Stavrou d8fd1cb253
Merge pull request #621 from jeanphilippegg/cleanup
Various commits
2025-07-06 20:43:27 +03:00
Jean-Philippe Gagné Guay afb4a9807e Revert "Make optional the parameters of denote-generate-identifier-as-{date,number}"
This reverts commit 9549d977d5.
2025-07-05 22:15:29 -04:00
Jean-Philippe Gagné Guay dfe3608857 Obsolete denote-retrieve-filename-identifier-with-error 2025-07-05 22:15:29 -04:00
Jean-Philippe Gagné Guay b8f1a589e1 Add denote--display-buffer-from-xref-alist 2025-07-05 21:13:58 -04:00
Protesilaos Stavrou c69210be6c
Put two spaces after a dot in a doc string 2025-07-03 19:10:14 +03:00
Protesilaos Stavrou cad687b9e6
Make denote-directories return a list when silo is set to obsolete 'default-directory' or `local'
We will keep warning users about those values, but we still want them
to work.
2025-07-03 09:24:32 +03:00
Protesilaos Stavrou a419ce1c47
Revert "Fix denote--dir-in-denote-directory-p"
This reverts commit 6dd9a135b7.

What I did is wrong because now a subdirectory will never satisfy this
condition. Thanks to oatmealm for reporting the bug in issue 620:
<https://github.com/protesilaos/denote/issues/620>.
2025-07-02 22:42:24 +03:00
Protesilaos Stavrou 0001bc9d8c
Make denote-grep-query-prompt use optional PROMPT-TEXT instead of special TYPE
We still support TYPE for the foreseeable future, but it is more
flexible to just have a string there.
2025-06-30 10:32:02 +03:00
Protesilaos Stavrou 8694b092b7
Make denote--revert-dired take a second param to avoid re-running 'current-buffer' 2025-06-25 20:29:25 +03:00
Protesilaos Stavrou fb5b4e31f6
Add optional "last modified" sort to denote-dired and denote-query-sorting 2025-06-25 18:02:39 +03:00
Protesilaos Stavrou a49aa81cfe
Make the sample denote-sort-dired with/without empty files work as expected
Bringing them up to speed with what we had for Denote version 4.

Maybe we want to extend them further so that they work with a list
value for denote-directory, but let's keep it like this for the time being.
2025-06-23 21:27:13 +03:00
Protesilaos Stavrou 3785194e0e
Merge branch 'main' of github.com:protesilaos/denote 2025-06-23 21:07:09 +03:00
Protesilaos Stavrou 5d8738f4bb
Add FIXME for outdate code samples of denote-sort-dired 2025-06-23 21:05:40 +03:00
Protesilaos Stavrou 318e10d8e7
Remove useless denote-sort--dired-buffer variable
I am not sure why that was there. Maybe we were relying on it at some
point but our code is not doing anything with it right now.
2025-06-23 21:03:29 +03:00
Protesilaos Stavrou 272e939417
Merge pull request #617 from jeanphilippegg/fix-renaming-command
Fix denote--rename-file for files without an identifier
2025-06-21 09:30:55 +03:00
Jean-Philippe Gagné Guay d3a8582c91 Fix denote--rename-file for files without an identifier 2025-06-19 22:54:20 -04:00
Protesilaos Stavrou 3dc772f683
Split denote-directories into helper and public functions
This way we can, in principle, re-use what we have there.

The original code was contributed by Jean-Philippe Gagné Guay in pull
request 613: <https://github.com/protesilaos/denote/pull/613>.
2025-06-19 17:55:54 +03:00
Protesilaos Stavrou 877252b77e
Introduce denote-directory-get-files-function
This is for users who need to customise the behaviour of
'denote-directory-files'. I am adding it in response to issue 5 on the
denote-org repository about the performance of Org dynamic
blocks (where a custom function could help):
<https://github.com/protesilaos/denote-org/issues/5>.
2025-06-19 12:39:24 +03:00
Protesilaos Stavrou 4c20bf0a57
Make denote-directory-get-files public 2025-06-19 12:39:04 +03:00
Protesilaos Stavrou 9549d977d5
Make optional the parameters of denote-generate-identifier-as-{date,number}
The original code was contributed by Jean-Philippe Gagné Guay in pull
request 613: <https://github.com/protesilaos/denote/pull/613>.
2025-06-18 13:21:28 +03:00
Protesilaos Stavrou dd86eebffb
Remove obsolete denote-prompt-for-date-return-id 2025-06-18 13:20:42 +03:00
Protesilaos Stavrou 48338bce07
Make the denote-get-identifier-function public
The original code was contributed by Jean-Philippe Gagné Guay in pull
request 613: <https://github.com/protesilaos/denote/pull/613>.
2025-06-18 13:19:25 +03:00
Protesilaos Stavrou 1181c734b5
Document the denote-directory option with its new possible list value
This feature was contributed by Jean-Philippe Gagné Guay in pull
request 609: <https://github.com/protesilaos/denote/pull/609>.

Jean-Philippe has assigned copyright to the Free Software Foundation
and is a long-time contributor to Denote.
2025-06-13 12:35:22 +03:00
Protesilaos Stavrou 6dd9a135b7
Fix denote--dir-in-denote-directory-p
The previous design would fail if DIRECTORY did not end with a slash.
Given the 'string-prefix-p', I assume this is the intended expression.
2025-06-13 12:31:11 +03:00
Protesilaos Stavrou 0dc8cb710c
Clarify that a custom grep is not needed in light of denote-grep 2025-06-13 12:10:31 +03:00
Protesilaos Stavrou 1299a416ed
Merge pull request #613 from jeanphilippegg/date-and-identifier
Make the date and identifiers independent and new identifier prompt
2025-06-13 11:57:17 +03:00
Protesilaos Stavrou 9f91b9b6a9
Revise how denote-link-ol-export converts links to files in HTML
The previous design assumed that every file that is linked to will get
an ".html" extension. But this is not correct, such as with PDF files.

Thanks to Morten Kjeldgaard for reporting the bug in issue 614:
<https://github.com/protesilaos/denote/issues/614>.
2025-06-13 11:28:36 +03:00
Jean-Philippe Gagné Guay a4d50fbf71 Make identifier and date independent 2025-06-12 23:42:30 -04:00
Protesilaos Stavrou d03f323a39
Use the correct conventions in two doc strings 2025-06-09 07:25:38 +03:00
Protesilaos Stavrou dde56db8c0
Make small edits to the documentation of denote-kill-buffers 2025-06-09 07:20:41 +03:00
Protesilaos Stavrou 6e8e321c1b
Reword the documentation of denote-save-buffers 2025-06-09 07:20:22 +03:00
Jean-Philippe Gagné Guay 2551221933 Add denote-identifier-prompt 2025-06-07 22:45:47 -04:00
Jean-Philippe Gagné Guay 11bbb6b9a1 Use denote-identifier-regexp in denote-retrieve-filename-identifier 2025-06-07 22:45:21 -04:00
Jean-Philippe Gagné Guay 40f2bf5569 Rename denote-id-regexp and denote-id-format 2025-06-07 22:45:10 -04:00
Protesilaos Stavrou d4804f87ab
Make denote-sort-dired work with multiple directories of denote-directory
This build on top of the new feature that allows the user option
'denote-directory' to accept a list of directories. It was contributed
by Jean-Philippe Gagné Guay in pull request 609: <https://github.com/protesilaos/denote/pull/609>.
2025-06-06 10:52:51 +03:00
Protesilaos Stavrou 55e3f9b6b3
Merge pull request #609 from jeanphilippegg/denote-directories
Make denote-directory accept a list of directories
2025-06-06 10:51:45 +03:00
Jean-Philippe Gagné Guay 5c7208e4ed Make denote-directory accept a list of directories 2025-06-02 00:03:11 -04:00
Protesilaos Stavrou e57f38f25b
Clarify that denote-sluggify-and-apply-rules is the new name of denote-sluggify
This was done in commits 2f9ef0c and e0a4bb4, which were contributed
by Jean-Philippe Gagné Guay in pull request 607: <https://github.com/protesilaos/denote/pull/607>.

Jean-Philippe has assigned copyright to the Free Software Foundation.
2025-05-25 17:34:13 +03:00
Protesilaos Stavrou d54c41e179
Merge pull request #607 from jeanphilippegg/fix-sluggification
Ensure sluggification of signature in front matter obey denote-file-name-slug-functions
2025-05-25 17:31:59 +03:00
Jean-Philippe Gagné Guay 2f9ef0cad8 Rename denote-sluggify function 2025-05-24 23:31:08 -04:00
Jean-Philippe Gagné Guay e0a4bb42b1 Use user-specified sluggification for front matter signatures. 2025-05-24 23:24:57 -04:00
Protesilaos Stavrou 2b1625a9c6
Revert "Add user option 'denote-sluggify-signature-in-frontmatter'"
This reverts commit 5b0eee109d.

I was trying it out but did not mean to commit it. We are discussing
this with the author in pull request 606: <https://github.com/protesilaos/denote/pull/606>.
2025-05-21 13:40:44 +03:00
Protesilaos Stavrou 77ecfa0805
Make denote-id-to-date public 2025-05-21 13:40:12 +03:00
Protesilaos Stavrou e1954dda30
Fix typo in denote-format-link
This was changed by Jean-Philippe Gagné Guay in pull request 596:
<https://github.com/protesilaos/denote/pull/596>.
2025-05-21 13:39:22 +03:00
Protesilaos Stavrou da5b7f360a
Merge branch 'main' of github.com:protesilaos/denote 2025-05-21 13:23:09 +03:00
Protesilaos Stavrou 3f1e934f2b
Merge pull request #596 from jeanphilippegg/linking-functions
Remove include-date parameter from linking functions
2025-05-21 13:22:43 +03:00
Hanwen Guo 5b0eee109d
Add user option 'denote-sluggify-signature-in-frontmatter'
This user option controls whether signature should be sluggified or keep the
user input as-is in frontmatter (not filename), as some users may prefer.
2025-05-20 12:23:21 +03:00
Protesilaos Stavrou d7c4046f16
Reword the note about 'denote-use-template' with regard to 'denote-org-capture-specifiers'
The original was provided by Ryota in pull request 598:
<https://github.com/protesilaos/denote/pull/598>.
2025-05-08 07:24:28 +03:00
Protesilaos Stavrou 86ee5cbc4a
Do not mention the 'denote-use-*' in the section about Org capture and link to it instead
Otherwise we might have information in two places that is out of sync
with each other.
2025-05-08 07:21:06 +03:00
Protesilaos Stavrou 5a0cfd07dc
Document the 'denote-use-*' variables in their own section of the manual
This way it is easier to find them.
2025-05-08 07:20:58 +03:00
Protesilaos Stavrou 11726dae4b
Merge pull request #598 from rytswd/main
Add note about denote-use-template duplicate
2025-05-08 07:10:20 +03:00
Protesilaos Stavrou b54229c724
Merge pull request #599 from mjkalyan/prefix
De-duplicate code in ‘denote-format-buffer-name’
2025-05-08 06:56:11 +03:00
James Kalyan 6c2295e75e
De-duplicate code in ‘denote-format-buffer-name’
i.e. Just make the format string conditional, not the whole format.
2025-05-07 13:05:10 -06:00
Ryota be2eb704a0
Add note about denote-use-template duplicate
This fixes #545.
2025-05-07 13:11:38 +01:00
Protesilaos Stavrou 8f7099eeb8
Document the new user option denote-buffer-name-prefix
This builds on top of commit 8e1341d by James Kalyan, which was done
in pull request 597: <https://github.com/protesilaos/denote/pull/597>.

James is in the process of assigning copyright to the Free Software
Foundation.
2025-05-07 09:41:39 +03:00
Protesilaos Stavrou afa3b9495f
Reword the doc string of denote-buffer-name-prefix
This builds on top of commit 8e1341d by James Kalyan, which was done
in pull request 597: <https://github.com/protesilaos/denote/pull/597>.

James is in the process of assigning copyright to the Free Software
Foundation.
2025-05-07 09:35:07 +03:00
Protesilaos Stavrou ffb65405e7
Acknowledge James Kalyan for commit 8e1341d
This is related to pull request 597: <https://github.com/protesilaos/denote/pull/597>.
James is in the process of assigning copyright to the Free Software
Foundation.
2025-05-07 07:28:09 +03:00
Protesilaos Stavrou 0150e8ed94
Make stylistic changes to how denote-buffer-name-prefix is used
This builds on top of commit 8e1341d by James Kalyan, which was done
in pull request 597: <https://github.com/protesilaos/denote/pull/597>.

James is in the process of assigning copyright to the Free Software
Foundation.
2025-05-07 07:26:12 +03:00
Protesilaos Stavrou 5f262d0541
Merge pull request #597 from mjkalyan/prefix
Implement ‘denote-buffer-name-prefix’ discussed as an aside in #595
2025-05-07 07:10:30 +03:00
James Kalyan 8e1341d946
Implement ‘denote-buffer-name-prefix’ discussed as an aside in #595
This approach defines ‘denote-buffer-name-prefix’ as a customizable variable
defaulting to "[D] ".

Then I define ‘denote-buffer-name’ as a function to wrap buffer names in such
that they use ‘denote-buffer-name-prefix’. ‘denote-buffer-name’ also takes the
opportunity to allow designating buffers as "special/temporary" or not which
adds surrounding asterisks.

Lastly, I have wrapped all the Denote-related buffer names with
‘denote-buffer-name’ so commands like ‘denote-sort-dired’, ‘denote-backlinks’,
and ‘denote-grep’ will all use ‘denote-buffer-name-prefix’.

BEFORE MERGING:

- Fix my placement of the definitions inside denote.el. I'm not sure what makes
most sense to you.

- decide on a package-version for the introduction of
‘denote-buffer-name-prefix’. I have it set to "TODO" at the moment.
2025-05-06 14:07:57 -06:00
Protesilaos Stavrou e8f9e22892
Remove the custom revert-buffer-function of denote-sort-dired
I think we do not need it anymore and we had a FIXME for it, anyway.

Thanks to mjkalyan for reporting the problem with revert-buffer and
for testing this change: <https://github.com/protesilaos/denote/pull/595#issuecomment-2853268654>.
2025-05-06 08:00:40 +03:00
Protesilaos Stavrou 5e144fc77e
Rename the functions to get links/backlinks
The old names are from a time when we defined the linking
functionality in a separate file.
2025-05-05 12:46:26 +03:00
Protesilaos Stavrou b6e8701f29
Make denote--link-in-context-regexp always check for ID-only links as well
This is because a file may have both.
2025-05-05 12:38:37 +03:00
Protesilaos Stavrou 0900b9461f
Reorder some lines in the denote-query-mode-map
It is easier for me to read it this way.
2025-05-05 08:29:14 +03:00
Protesilaos Stavrou a99d59ad58
Expand the menu bar contents with the various denote-query-* commands 2025-05-05 08:27:48 +03:00
Protesilaos Stavrou 0f99c17e23
Add denote-grep to the menu bar contents 2025-05-05 08:18:16 +03:00
Lucas Quintana 34103b2b3a
Make sure 'denote--menu-contents' has a string as its first element
This fixes the bug where 'denote-context-menu' would completely
disable the 'context-menu-mode', as reported by artelse in issue 592:
<https://github.com/protesilaos/denote/issues/592>.
2025-05-05 08:12:15 +03:00
Protesilaos Stavrou 77371ac78a
Fix long-standing issue with denote-sort-dired buffer name
The 'dired' function cannot be called with a 'cons' whose 'car'
contains a forward slash because that breaks the resulting buffer. By
renaming the buffer after it is created, we circumvent this problem
and can thus use the format we want.

Given this opportunity, the format of the buffer name is subject to a
variable that users can modify. I am doing this in response to pull
request 595 by mjkalyan: <https://github.com/protesilaos/denote/pull/595>.
2025-05-05 08:06:18 +03:00
Jean-Philippe Gagné Guay 5dbc394316 Remove include-date parameter from linking functions 2025-05-04 23:21:39 -04:00
Protesilaos Stavrou a6925b1edf
Tweak the doc string of denote-query-sort-last-search
The functionality to sort query buffers was introduced by Lucas
Quintana in pull request 594: <https://github.com/protesilaos/denote/pull/594>.

Lucas has assigned copyright to the Free Software Foundation.
2025-05-04 12:49:07 +03:00
Protesilaos Stavrou 5ce665d9e4
Make stylistic change to denote-retrieve-xref-alist
The functionality to sort query buffers was introduced by Lucas
Quintana in pull request 594: <https://github.com/protesilaos/denote/pull/594>.

Lucas has assigned copyright to the Free Software Foundation.
2025-05-04 12:46:05 +03:00
Protesilaos Stavrou 14259e58ca
Document denote-query-sorting and denote-query-sort-last-search
The functionality to sort query buffers was introduced by Lucas
Quintana in pull request 594: <https://github.com/protesilaos/denote/pull/594>.

Lucas has assigned copyright to the Free Software Foundation.
2025-05-04 12:45:39 +03:00
Protesilaos Stavrou 354d29db27
Make small change to the doc string of denote-query-sorting
The functionality to sort query buffers was introduced by Lucas
Quintana in pull request 594: <https://github.com/protesilaos/denote/pull/594>.

Lucas has assigned copyright to the Free Software Foundation.
2025-05-04 12:34:15 +03:00
Protesilaos Stavrou 4abffa78c3
Declare denote-query-sorting before its first use
The functionality to sort query buffers was introduced by Lucas
Quintana in pull request 594: <https://github.com/protesilaos/denote/pull/594>.

Lucas has assigned copyright to the Free Software Foundation.
2025-05-04 12:25:58 +03:00
Protesilaos Stavrou a9621ff851
Merge pull request #594 from lmq-10/sort-query-buffer
Add support for sorting files in query buffers
2025-05-04 12:20:09 +03:00
Lucas Quintana 8a61780089 Use denote-query--last-files instead of all files when sorting 2025-05-03 20:38:04 -03:00
Lucas Quintana 921cb936f3 Add support for sorting query buffers 2025-05-03 20:16:18 -03:00
Lucas Quintana fcf83579a6 Fix small issues with query buffers
- Clearing filters and excluding/including files should always replace
current window and reuse buffer name.

- As query buffers are special buffers, they should be enclosed with
asterisks (we already do that for backlink buffers).
2025-05-03 19:37:11 -03:00
Protesilaos Stavrou f543f305ad
Add annotation function to denote-sort-component-prompt 2025-05-03 15:20:17 +03:00
Protesilaos Stavrou ffd3bef12b
Add 'random' order for denote-sort functions
This applies to the command 'denote-sort-dired' ('denote-dired'), as
well as the Org dynamic blocks defined in the package denote-org.

Thanks to experimental-code-86 for making the suggestion in issue 572:
<https://github.com/protesilaos/denote/issues/572>.
2025-05-03 15:20:06 +03:00
Protesilaos Stavrou 807395fcb1
Add command denote-find-backlink-with-location
This is in response to issue 471 as reported by johkneisl:
<https://github.com/protesilaos/denote/issues/471>.
2025-04-29 08:54:20 +03:00
Protesilaos Stavrou 7d18f17a19
Make denote-link-return-links accept optional FILES 2025-04-29 08:04:15 +03:00
Protesilaos Stavrou aaa5d30a7c
Make obsolete the unused denote-link--expand-identifiers
I know we use it in denote-org, but I will move it there and then
refine it.
2025-04-29 07:54:39 +03:00
Protesilaos Stavrou 5b7157019b
Use custom prompt text in denote-find-link and denote-find-backlink 2025-04-29 07:48:07 +03:00
Protesilaos Stavrou 8e973f12ad
Use format-prompt in denote-select-from-files-prompt 2025-04-29 07:47:49 +03:00
Protesilaos Stavrou 590787e148
Add two TODO for denote-link-dired-marked-notes 2025-04-29 07:42:45 +03:00
Protesilaos Stavrou 7b50b22f63
Use expand-file-name in denote-link--buffer-file-prompt 2025-04-29 07:40:57 +03:00
Protesilaos Stavrou b78efdcab8
Use expand-file-name instead of concat in denote-file-prompt
I think this is the proper way of constructing a full file system path.
2025-04-29 07:38:42 +03:00
Protesilaos Stavrou 861f544562
Rename+extend denote-select-linked-file-prompt to denote-select-from-files-prompt 2025-04-29 07:35:53 +03:00
Protesilaos Stavrou d964b567f2
Make denote-select-linked-file-prompt return absolute path
This extends the work done in commits 266207d, 81e529d.
2025-04-29 07:30:53 +03:00
Protesilaos Stavrou 34fd0bfc64
Add variable to inhibit front matter rewrite via a 'let'
We discussed this with Jean-Philippe Gagné Guay in issue 589:
<https://github.com/protesilaos/denote/issues/589>.
2025-04-29 07:18:54 +03:00
Protesilaos Stavrou 266207d8b9
Simplify denote-find-backlink 2025-04-28 17:24:39 +03:00
Protesilaos Stavrou 81e529d8f3
Simplify denote-find-link 2025-04-28 17:24:39 +03:00
Protesilaos Stavrou cdb44a2d31
Remove needless helper function of denote-fontify-links
The helper was there because I was originally using it for two functions.
2025-04-23 14:28:44 +03:00
Protesilaos Stavrou c98c74ec74
Update to Denote version 4.0.0 2025-04-15 17:32:11 +03:00
Protesilaos Stavrou 23bb1ec373
Remove obsolete tests 2025-04-15 17:26:37 +03:00
Protesilaos Stavrou 90603d5b0e
Make denote-link-description-format also accept %I and %D
This is the same as 'denote-rename-buffer-format'. I need to check
whether we can remove whatever duplication between the two variables.
2025-04-15 14:14:25 +03:00
Protesilaos Stavrou bb01587843
Remove warning about the denote-* packages that now are on GNU ELPA 2025-04-15 08:53:08 +03:00
Protesilaos Stavrou 242fb0f100
Merge branch 'main' of github.com:protesilaos/denote 2025-04-15 08:47:46 +03:00
Protesilaos Stavrou e2b47e45bf
Document in the manual all the denote-grep related symbols
These were contributed by Lucas Quintana in pull request 573:
<https://github.com/protesilaos/denote/pull/573>.

Lucas has assigned copyright to the Free Software Foundation.
2025-04-15 08:46:43 +03:00
Protesilaos Stavrou 41ffb657e7
Reword the denote-grep-marked-dired-files doc string 2025-04-15 08:45:49 +03:00
Protesilaos Stavrou de67f639a1
Autoload denote-grep 2025-04-15 08:43:17 +03:00
Protesilaos Stavrou 5193b10b25
Make denote-grep-files-referenced-in-region throw an error if there is no active region 2025-04-15 08:42:39 +03:00
Protesilaos Stavrou 146e620417
Autoload denote-grep-files-referenced-in-region and denote-grep-marked-dired-files 2025-04-15 08:40:52 +03:00
Protesilaos Stavrou ed9018f81c
Explain in denote-grep-files-referenced-in-region what "referenced" files are
Better have the explanation in the command, which is user-facing, than
in the helper function.
2025-04-15 08:40:04 +03:00
Protesilaos Stavrou 089cd57d40
Apply to denote-get-link-face the same change as commit da64be1
The commit da64be1 was done by TomoeMami in pull request 578:
<https://github.com/protesilaos/denote/pull/578>.
2025-04-14 19:56:16 +03:00
Protesilaos Stavrou ea8cf56ed7
Acknowledge TomoeMami for commit da64be1
This was done in pull request 578: <https://github.com/protesilaos/denote/pull/578>.
The change is small, meaning that the author does not need to assign
copyright to the Free Software Foundation.
2025-04-14 19:53:51 +03:00
Protesilaos Stavrou 27e5849cb0
Merge pull request #578 from TomoeMami/main
Fix Windows compatibility of `denote-link-ol-follow`
2025-04-14 19:52:12 +03:00
TomoeMami da64be1a49
Fix Windows compatibility of denote-link-ol-follow
On Windows, given the `link` as an identifer `"20250312T161853"` , the result of `(denote-link--ol-resolve-link-to-target 
 link)` is a Windows path `"c:/path/to/the/file.extension"`

However, the result of `(file-exists-p (string-trim-right match ":.*"))` is `nil`, because `(string-trim-right "c:/path/to/the/file.extension" ":.*")` returns `"c"` ,which is the driver letter on Windows.

We can fix it by this: `(string-trim-right "c:/path/to/the/file.extension" ":[^/]+.*")`
2025-04-14 13:41:26 +08:00
Protesilaos Stavrou 956f5dfd10
Merge pull request #576 from jeanphilippegg/small-fixes
Small fixes
2025-04-14 08:33:18 +03:00
Jean-Philippe Gagné Guay 7e528398bb Fix order of or subexpressions in denote-date-prompt 2025-04-13 20:46:22 -04:00
Jean-Philippe Gagné Guay d3b1be0732 Use default symbol as default value for denote-use-keywords
nil is the empty list and can be a valid value for denote-use-keywords
2025-04-13 20:43:43 -04:00
Protesilaos Stavrou 2062286ee9
Add comments to the sample configuration to direct users to the Info manual
This is in response to issue 575 raised by André Bering:
<https://github.com/protesilaos/denote/issues/575>.
2025-04-09 07:27:43 +03:00
Protesilaos Stavrou 2e750d6af1
Capitalise "Dired" in two doc strings 2025-04-06 10:12:58 +03:00
Protesilaos Stavrou 06db676d80
Clarify the denote-add-links prompt 2025-04-06 10:12:32 +03:00
Protesilaos Stavrou f115e60df9
Remove needless comment 2025-04-06 10:12:21 +03:00
Protesilaos Stavrou aacad80e4d
Merge pull request #573 from lmq-10/last-search-features
Implement functions for searching in dired files and in a region
2025-04-04 08:09:09 +03:00
Protesilaos Stavrou 7bb8b7c436
Make denote-rename-buffer-format accept human-readable date and "do what I mean" specifiers 2025-04-03 08:47:49 +03:00
Lucas Quintana 0845c16f97 Implement functions for searching in dired files and in a region 2025-04-02 11:32:45 -03:00
Protesilaos Stavrou d590f4f094
Include denote-dired and denote-grep in the sample configuration 2025-03-31 11:14:27 +03:00
Protesilaos Stavrou 6b2c9f6751
Mention alias denote-dired in the manual's heading for easier discovery 2025-03-31 11:14:08 +03:00
Protesilaos Stavrou 3abd10d7bb
Include query links in sample configuration 2025-03-31 11:12:48 +03:00
Protesilaos Stavrou 2c585fcb02
Acknowledge Lucas Quintana for denote-grep and related
These were introduced in commit f70c96c, which was contributed by Lucas
Quintana in pull request 571: <https://github.com/protesilaos/denote/pull/571>.

Lucas has assigned copyright to the Free Software Foundation.
2025-03-30 13:03:01 +03:00
Protesilaos Stavrou 027cbe8e4b
Mention denote-grep in the context of the reference to the denote-search package 2025-03-30 13:02:46 +03:00
Protesilaos Stavrou fceb31c429
Document the denote-query-mode and link to it from relevant sections of the manual 2025-03-30 12:57:42 +03:00
Protesilaos Stavrou ba61fa3f82
Document the denote-grep command in the manual 2025-03-30 12:57:26 +03:00
Protesilaos Stavrou 0feb0d4183
Use denote-keywords-prompt instead of the denote-grep-keywords-prompt 2025-03-30 12:43:04 +03:00
Protesilaos Stavrou 75e6e5e8f5
Make all denote-query-mode commands throw an error if called from elsewhere 2025-03-30 12:17:02 +03:00
Protesilaos Stavrou 2bd24bcf72
Rename all commands that interact with the query links buffer and move them outside denote-grep
They apply to all our commands that use the denote-query-mode, so we
want to make that clear already from the symbols we use.
2025-03-30 12:12:51 +03:00
Protesilaos Stavrou d0b97f85f7
Reorganise some parts of the denote-query section in denote.el 2025-03-30 12:12:19 +03:00
Protesilaos Stavrou 27cba1eba2
Remove unrelated command from the denote-query-mode doc string 2025-03-30 12:03:57 +03:00
Protesilaos Stavrou 2f3e3d7e87
Update the doc string of denote-grep-focus 2025-03-30 12:03:23 +03:00
Protesilaos Stavrou 4210564104
Update the manual's documentation of denote-sort-dired-extra-prompts 2025-03-30 11:50:41 +03:00
Protesilaos Stavrou 369f69ac58
Reword the manual about denote-sort-dired 2025-03-30 11:47:19 +03:00
Protesilaos Stavrou 4889421f11
Use stronger language about favouring denote-sequence over some custom sorting 2025-03-30 11:46:50 +03:00
Protesilaos Stavrou 788c2b0c8e
Mention 'denote-sort-dired' in the relevant heading
This makes it easier to discover the command.
2025-03-30 11:41:55 +03:00
Protesilaos Stavrou 6cb1ba15ac
Remove old warnings about version 2.3.0 from a year ago
I expect the interested parties to have made the changes in the meantime.
2025-03-30 11:38:10 +03:00
Protesilaos Stavrou 871bb14ada
Mention version 4.0.0 instead of 3.2.0 in all relevant places
We never released 3.2.0. Since we have made lots of changes we want
to label this as a whole new version of Denote.
2025-03-30 11:34:30 +03:00
Protesilaos Stavrou d915fae73d
Move two denote-query user options closer to their group 2025-03-30 11:33:26 +03:00
Protesilaos Stavrou 64bcaa4c13
Change name of denote-grep group to denote-query 2025-03-30 11:30:32 +03:00
Protesilaos Stavrou ed0fcb0ebf
Make denote-grep-file-regexp-prompt return a string, not assuming it is part of 'interactive'
This is how we do it with all our prompts. In practice, it is used in
an interactive spec though it might be used outside of one (also
considering how users may choose to use our functions).

This builds on top of commit f70c96c, which was contributed by Lucas
Quintana in pull request 571: <https://github.com/protesilaos/denote/pull/571>.

Lucas has assigned copyright to the Free Software Foundation.
2025-03-30 08:45:59 +03:00
Protesilaos Stavrou b2d6b74726
Rename denote-grep-query-history and make the histories reference each other
This is how we do it with all our prompts. In practice, it is used in
an interactive spec though it might be used outside of one (also
considering how users may choose to use our functions).

This builds on top of commit f70c96c, which was contributed by Lucas
Quintana in pull request 571: <https://github.com/protesilaos/denote/pull/571>.

Lucas has assigned copyright to the Free Software Foundation.
2025-03-30 08:44:38 +03:00
Protesilaos Stavrou 2b1a5886c3
Make denote-grep-query-prompt return a string, not assuming it is part of 'interactive'
This is how we do it with all our prompts. In practice, it is used in
an interactive spec though it might be used outside of one (also
considering how users may choose to use our functions).

This builds on top of commit f70c96c, which was contributed by Lucas
Quintana in pull request 571: <https://github.com/protesilaos/denote/pull/571>.

Lucas has assigned copyright to the Free Software Foundation.
2025-03-30 08:40:30 +03:00
Protesilaos Stavrou 0e12927aab
Make small tweaks to denote-grep-query-prompt doc string
This builds on top of commit f70c96c, which was contributed by Lucas
Quintana in pull request 571: <https://github.com/protesilaos/denote/pull/571>.

Lucas has assigned copyright to the Free Software Foundation.
2025-03-30 08:40:15 +03:00
Protesilaos Stavrou e9a16611a3
Placate the compiler about denote-grep-clear-all-filters
This builds on top of commit f70c96c, which was contributed by Lucas
Quintana in pull request 571: <https://github.com/protesilaos/denote/pull/571>.

Lucas has assigned copyright to the Free Software Foundation.
2025-03-30 08:35:37 +03:00
Protesilaos Stavrou 93b15ee6de
Placate the compiler about denote-retrieve-xref-alist
This builds on top of commit f70c96c, which was contributed by Lucas
Quintana in pull request 571: <https://github.com/protesilaos/denote/pull/571>.

Lucas has assigned copyright to the Free Software Foundation.
2025-03-30 08:34:55 +03:00
Protesilaos Stavrou 66746544bc
Rewrite denote-query-extract-title to follow our style in other places
This builds on top of commit f70c96c, which was contributed by Lucas
Quintana in pull request 571: <https://github.com/protesilaos/denote/pull/571>.

Lucas has assigned copyright to the Free Software Foundation.
2025-03-30 08:31:50 +03:00
Protesilaos Stavrou eba08ae52e
Update the doc strings of the internal variables used by denote-make-links-buffer
This builds on top of commit f70c96c, which was contributed by Lucas
Quintana in pull request 571: <https://github.com/protesilaos/denote/pull/571>.

Lucas has assigned copyright to the Free Software Foundation.
2025-03-30 08:28:26 +03:00
Protesilaos Stavrou 6cbf2fcb67
Introduce the denote-grep group and update user options accordingly
I have not written that node in the manual yet, but I will do it after
I am done editing denote.el.

This builds on top of commit f70c96c, which was contributed by Lucas
Quintana in pull request 571: <https://github.com/protesilaos/denote/pull/571>.

Lucas has assigned copyright to the Free Software Foundation.
2025-03-30 08:26:31 +03:00
Protesilaos Stavrou bd74eb2390
Change denote-grep-refine to denote-grep-focus
This builds on top of commit f70c96c, which was contributed by Lucas
Quintana in pull request 571: <https://github.com/protesilaos/denote/pull/571>.

Lucas has assigned copyright to the Free Software Foundation.
2025-03-30 08:21:33 +03:00
Protesilaos Stavrou d220ff854d
Update denote-query-mode-map doc string
This builds on top of commit f70c96c, which was contributed by Lucas
Quintana in pull request 571: <https://github.com/protesilaos/denote/pull/571>.

Lucas has assigned copyright to the Free Software Foundation.
2025-03-30 08:21:29 +03:00
Protesilaos Stavrou e64daa0cd6
Remove 'require' for outline because outline-minor mode is autoloaded already
This builds on top of commit f70c96c, which was contributed by Lucas
Quintana in pull request 571: <https://github.com/protesilaos/denote/pull/571>.

Lucas has assigned copyright to the Free Software Foundation.
2025-03-30 08:21:26 +03:00
Protesilaos Stavrou e4187ee517
Update the doc string of denote-query-mode
This builds on top of commit f70c96c, which was contributed by Lucas
Quintana in pull request 571: <https://github.com/protesilaos/denote/pull/571>.

Lucas has assigned copyright to the Free Software Foundation.
2025-03-30 08:21:22 +03:00
Protesilaos Stavrou 5e44e8f8bf
Merge pull request #571 from lmq-10/search-improvements
Add some useful features to query buffers
2025-03-30 08:14:53 +03:00
Lucas Quintana f70c96c5ca Merge main features from denote-search into Denote 2025-03-29 14:13:20 -03:00
Protesilaos Stavrou 9aed12156e
Merge pull request #569 from jeanphilippegg/docstring
Add info in docstring of denote-file-name-components-order
2025-03-29 18:40:53 +02:00
Jean-Philippe Gagné Guay b5eac20052 Add info in docstring of denote-file-name-components-order 2025-03-29 10:51:51 -04:00
Protesilaos Stavrou ec045e814b
Include the two new direct link commands in the menu bar (see commit ba08101) 2025-03-29 09:25:57 +02:00
Protesilaos Stavrou d7a46ae47c
Remove needless node in the manual for two link aliases and mention those in context 2025-03-29 09:22:24 +02:00
Protesilaos Stavrou 38b0e922e7
Remove alias for denote-add-links 2025-03-29 09:22:10 +02:00
Protesilaos Stavrou c1b0fecc70
Document new linking commands for direct links to files with content match (per commit ba08101) 2025-03-29 09:18:29 +02:00
Protesilaos Stavrou ba081010fa
Define commands to create direct links to files whose contents match a query 2025-03-29 09:17:51 +02:00
Protesilaos Stavrou 54480f9f86
Clarify denote-add-links doc string 2025-03-29 09:17:39 +02:00
Protesilaos Stavrou 2885ce0d62
Add denote-query-link-prompt to denote-prompts-with-history-as-completion 2025-03-29 07:37:45 +02:00
Protesilaos Stavrou d59645cd03
Reorganise some backlink-related functions to be under the same outline heading 2025-03-29 07:33:41 +02:00
Protesilaos Stavrou e88af3a4aa
Merge pull request #567 from eum3l/fix-org-location-links
Fix Org links with location identifiers
2025-03-28 20:33:04 +02:00
eum3l 319107ecfd
Trim Org link location identifiers when necessary 2025-03-28 19:02:10 +01:00
Protesilaos Stavrou 9422778efa
Add missing autoload cookies for non-Org link fontification 2025-03-28 08:42:28 +02:00
Protesilaos Stavrou 25409b6092
Add denote-sort-dired to the menu bar 2025-03-28 08:42:04 +02:00
Protesilaos Stavrou 9d32f611e7
Add query links to the menu bar 2025-03-28 08:40:09 +02:00
Protesilaos Stavrou a795d23f12
Document the new query links and update the manual accordingly 2025-03-28 08:37:40 +02:00
Protesilaos Stavrou dec1087e01
Update the doc string of denote-query-filenames-link 2025-03-28 08:24:57 +02:00
Protesilaos Stavrou 7e0a7944e1
Update the doc string of denote-query-contents-link 2025-03-28 08:24:50 +02:00
Protesilaos Stavrou 61d2192009
Remove needless denote-fontify-query-links (per commit ff50b32)
The technical discussion for this is in issue 561:
<https://github.com/protesilaos/denote/issues/561>.
2025-03-27 11:56:48 +02:00
Protesilaos Stavrou ff50b32258
Revise "link in context" regexp to also cover query links 2025-03-27 11:55:56 +02:00
Protesilaos Stavrou d45ace3fb6
Make query links use their own face (amend 83b6e35)
The technical discussion for this is in issue 561:
<https://github.com/protesilaos/denote/issues/561>.
2025-03-27 11:44:12 +02:00
Protesilaos Stavrou 83b6e35880
Make query links use their own face in Org buffers
I will extend this to 'denote-fontify-links'. The technical discussion
for this is in issue 561: <https://github.com/protesilaos/denote/issues/561>.
2025-03-27 11:40:02 +02:00
Protesilaos Stavrou 6810d13daf
Add WORK-IN-PROGRESS formatting of query links to include a description text
The technical discussion for this is in issue 561:
<https://github.com/protesilaos/denote/issues/561>.
2025-03-27 08:03:38 +02:00
Protesilaos Stavrou be557935dc
Add error check to query links to ensure they exit if the file type is unrecognised 2025-03-27 07:52:45 +02:00
Protesilaos Stavrou b272883038
Use upper case letters in the query links prompts to improve usability 2025-03-27 07:52:25 +02:00
Protesilaos Stavrou 5f503529e4
Use "Denote Query" name on the modeline for denote-query-mode 2025-03-27 07:40:10 +02:00
Protesilaos Stavrou dbea20fde2
Make sure that denote--query-last-dired-buffer is a buffer 2025-03-27 07:37:26 +02:00
Protesilaos Stavrou c12c245344
Add two outline headings for backlinks and query links 2025-03-27 07:37:11 +02:00
Protesilaos Stavrou e1475d1c2b
Change denote-query-links-buffer-function in the interest of simplicity
The technical discussion for this is in issue 561:
<https://github.com/protesilaos/denote/issues/561>.
2025-03-27 07:34:26 +02:00
Protesilaos Stavrou 0d992fa74d
Merge branch 'main' into query-links 2025-03-27 07:22:50 +02:00
Protesilaos Stavrou 89071cffce
Expand query links to also work for file names and change their format
I am now using the format suggested by Jean-Philippe Gagné Guay, which
is "denote:TYPE:QUERY". The technical discussion for this is in issue 561:
<https://github.com/protesilaos/denote/issues/561>.

Perhaps there is a way to apply a different face to the query links,
though I do not think this is a critical feature.

What remains to be decided is if we can/should have shorter TYPE
values than the ones I am using now.
2025-03-27 06:19:41 +02:00
Protesilaos Stavrou 27b8f0ad1d
Set denote-org-store-link-to-heading to nil
This makes it easier to reason about Denote links. The addition of a
link to the heading/context/CUSTOM_ID is better left for those who
want to opt in to the feature.
2025-03-26 08:43:57 +02:00
Protesilaos Stavrou ec0ca7da9d
Fix alias for denote-sort-dired 2025-03-25 06:36:55 +02:00
Protesilaos Stavrou 68b84289fc
Reposition the denote-fontify-links part after the links buffer 2025-03-24 16:44:56 +02:00
Protesilaos Stavrou c2f3ca7cf4
Make denote-fontify-links also work with query links
The technical discussion for this is in issue 561:
<https://github.com/protesilaos/denote/issues/561>.
2025-03-24 16:43:25 +02:00
Protesilaos Stavrou d2aa0cd683
Make function to get query links a variable
This way it can be redefined by other packages, such as
'denote-search'. Thanks to Lucas Quintana for asking for this addition
in issue 561: <https://github.com/protesilaos/denote/issues/561>.
2025-03-24 16:09:16 +02:00
Protesilaos Stavrou 24b95a62d2
Merge pull request #562 from eum3l/fix-link-collisions
Respect encryption-file-extensions in get-path-by-id
2025-03-24 15:57:57 +02:00
eum3l d931f37ff8
Respect encryption-file-extensions in get-path-by-id 2025-03-24 12:23:31 +01:00
Protesilaos Stavrou 388227986b
Make denote-query-links-display-buffer-action not fit to buffer
Because in that scenario it can take up almost the entire height of
the frame. Whereas this is less likely for backlinks.
2025-03-24 10:05:03 +02:00
Protesilaos Stavrou 7aaf9be29f
Make 'denote-query' also use the active region 2025-03-24 08:17:28 +02:00
Protesilaos Stavrou 490ad08718
Make 'denote-query' insert a link without checking for matches
Users who use this will most probably want to insert the link and then
fill out the matches as they go.
2025-03-24 08:10:57 +02:00
Protesilaos Stavrou bb4d193d94
Remove FILES-MATCHING-REGEXP parameter from 'denote-query'
It makes no sense there, but the idea is still useful in other applications.
2025-03-24 08:10:02 +02:00
Protesilaos Stavrou 11def0d0c5
Add 'mode' and remove 'dedicated' from display-buffer action alist
Otherwise, it keeps creating new windows and
'dispplay-buffer-reuse-mode-window' does not do the right thing.
2025-03-24 08:02:36 +02:00
Protesilaos Stavrou c0f55df1f9
Make the display-buffer action reuse the mode window
This was always my intention and I made a mistake before.
2025-03-24 07:47:57 +02:00
Protesilaos Stavrou a612e42567
Add initial support for query links
I still need to work on the link implementation for file types other
than Org (in 'denote-fontify-links' and related) and then expand the
manual to document all the changes herein. Though I want to make this
commit first to give others the chance to review the code.
2025-03-24 07:37:07 +02:00
Protesilaos Stavrou e41fd8ebc7
Make file prompt of the "... or create" commands more informative 2025-03-23 17:22:28 +02:00
Protesilaos Stavrou e9bb949ce2
Merge pull request #560 from jeanphilippegg/revert-commits
Reapply a fix that was undone in previous PR
2025-03-23 11:34:33 +02:00
Jean-Philippe Gagné Guay 01e11e1db1 Reapply a fix that was undone in a previous commit 2025-03-22 11:29:52 -04:00
Protesilaos Stavrou 9743ece3b6
Merge pull request #558 from jeanphilippegg/revert-commits
Revert commits about renaming org-capture buffers
2025-03-22 16:28:11 +02:00
Protesilaos Stavrou 721235b47e
Revert "Make 'denote-directory-files' accept optional DIRECTORY"
This reverts commit c0df642eca.

We will use the approach suggested by Jean-Philippe Gagné Guay in
issue 559, namely, to 'let' bind the denote-directory where we need to
without adding too many parameters to the 'denote-directory-files':
<https://github.com/protesilaos/denote/issues/559>.
2025-03-22 16:21:21 +02:00
Jean-Philippe Gagné Guay d35b383e56 Revert "Make renaming commands work in org-capture buffer"
This reverts commit 5cd129030a.
2025-03-22 09:46:07 -04:00
Jean-Philippe Gagné Guay a90c1cdffb Revert "Add hook to rename file after denote-org-capture"
This reverts commit 8d1202d2e8.
2025-03-22 09:41:12 -04:00
Protesilaos Stavrou c0df642eca
Make 'denote-directory-files' accept optional DIRECTORY
This is to support a use-case in 'denote-journal' of setting a path
outside the 'denote-directory', as reported by Kevin McCarthy in issue
1 on the 'denote-journal' repository: <https://github.com/protesilaos/denote-journal/issues/1>.
2025-03-21 11:33:21 +02:00
Protesilaos Stavrou 31e52a6646
Acknowledge eum3l for commit 4868189: renaming encrypted files preserves extensions
This was done in pull request 557: <https://github.com/protesilaos/denote/pull/557>.
The change is small, meaning that eum3l does not need to assign
copyright to the Free Software Foundation.
2025-03-18 06:45:48 +02:00
Protesilaos Stavrou a56c7ddf03
Merge pull request #557 from eum3l/fix-encrypted-rename
Use denote-get-file-extension in denote--rename-file
2025-03-18 06:44:50 +02:00
eum3l 4868189dc0
Use denote-get-file-extension in denote--rename-file 2025-03-17 18:26:22 +01:00
Protesilaos Stavrou 46f4799342
Rewrite denote--inferred-keywords as denote-infer-keywords-from-files 2025-03-17 09:02:07 +02:00
Protesilaos Stavrou e65c00c18f
Document denote-keywords optional FILES-MATCHING-REGEXP (per commit 05d6c12) 2025-03-17 08:52:03 +02:00
Protesilaos Stavrou 47d7d02503
Add subsections to the manual's documentation of developer-facing symbols 2025-03-17 08:48:41 +02:00
Protesilaos Stavrou 34690c44d6
Merge branch 'main' of github.com:protesilaos/denote 2025-03-17 07:15:06 +02:00
Protesilaos Stavrou e964be04f0
Document the public xref functions we provide (see 773de77, fa7cc80) 2025-03-17 07:14:23 +02:00
Protesilaos Stavrou fa7cc80bb0
Make the xref functions we have public 2025-03-17 07:13:35 +02:00
Protesilaos Stavrou 773de77a01
Abstract denote--retrieve-xref-alist from backlinks' buffer preparation into its own function
This way it can more easily be used elsewhere.
2025-03-17 07:13:25 +02:00
Protesilaos Stavrou 2571667b85
Move the installation and sample configuration sections closer to the top
Otherwise they are hard to find, which is especially important for
inexperienced users.
2025-03-16 18:23:46 +02:00
Protesilaos Stavrou e1984b7df3
Make development-version be 4.0.0 since we have lots of breaking changes 2025-03-16 18:21:30 +02:00
Protesilaos Stavrou 0dcd487b40
Remove comment in function denote-directory about deprecated values 2025-03-15 07:27:49 +02:00
Protesilaos Stavrou 1db0307976
Merge branch 'reorganise-denote'
This concludes the work originally announced in issue 543:
<https://github.com/protesilaos/denote/issues/543>. Latest update on
my website: <https://protesilaos.com/codelog/2025-03-14-emacs-denote-many-packages/>.
2025-03-15 07:01:07 +02:00
Protesilaos Stavrou 61c16e87ce
Remove all references to denote-md-extras and point to denote-markdown package
This is part of the effort to reorganise the project, as announced in
issue 543: <https://github.com/protesilaos/denote/issues/543>.
2025-03-13 06:33:14 +02:00
Protesilaos Stavrou e29488099b
Clarify a point about using the denote-sequence package 2025-03-13 06:32:11 +02:00
Protesilaos Stavrou c7a7ffd81b
Reposition the manual's entry about denote-sequence 2025-03-12 19:51:28 +02:00
Protesilaos Stavrou 4efeb26212
Reposition the manual's entry about denote-journal 2025-03-12 19:50:08 +02:00
Protesilaos Stavrou b7ce6f43d6
Clean up the manual about the denote-silo-extras.el and point to denote-silo package
This is part of the effort to reorganise the project, as announced in
issue 543: <https://github.com/protesilaos/denote/issues/543>.
2025-03-12 19:47:53 +02:00
Protesilaos Stavrou 657859ce49
Remove all journal-related documentation (all is done in denote-journal package)
This is part of the effort to reorganise the project, as announced in
issue 543: <https://github.com/protesilaos/denote/issues/543>.
2025-03-12 09:13:19 +02:00
Protesilaos Stavrou ba165ee456
Make the function denote-directory produce a warning for obsolete uses
Thanks to Jean-Philippe Gagné Guay for discussing this with me as an
aside to issue 543: <https://github.com/protesilaos/denote/issues/543#issuecomment-2708670893>.
2025-03-11 17:24:57 +02:00
Protesilaos Stavrou 90464bab71
WORK-IN-PROGRESS Remove denote-journal-extras.el and move it to https://github.com/protesilaos/denote-journal
This is part of the effort to reorganise the project, as announced in
issue 543: <https://github.com/protesilaos/denote/issues/543>.
2025-03-06 11:58:34 +02:00
Protesilaos Stavrou 484ba750dd
WORK-IN-PROGRESS Remove denote-md-extras.el and move it to https://github.com/protesilaos/denote-markdown
This is part of the effort to reorganise the project, as announced in
issue 543: <https://github.com/protesilaos/denote/issues/543>.
2025-03-06 11:58:23 +02:00
Protesilaos Stavrou 5601dfc154
WORK-IN-PROGRESS Remove denote-silo-extras.el and move it to https://github.com/protesilaos/denote-silo
This is part of the effort to reorganise the project, as announced in
issue 543: <https://github.com/protesilaos/denote/issues/543>.
2025-03-06 11:56:56 +02:00
Protesilaos Stavrou e83ab6f106
Use correct optional parameter in denote-link-ol-store (amend commit 20005e6)
Thanks to duli for the feedback in issue 552: <https://github.com/protesilaos/denote/issues/552>.
2025-03-01 09:10:48 +02:00
Protesilaos Stavrou 4ade384c03
Fix typo from commit 05d6c12 2025-03-01 09:09:09 +02:00
Protesilaos Stavrou 05d6c120bb
Make it possible to infer keywords only from files matching regexp
I will update the manual later because I am still working on another
branch that modifies the README.org and I do not want to bother with
a messy conflict resolution.
2025-03-01 09:06:45 +02:00
Protesilaos Stavrou 20005e666a
Make denote-link-ol-store accept any arguments passed to it
This is due to how org-store-link may use the function internally.

Thanks to kalisduli for reporting the problem in issue 552:
<https://github.com/protesilaos/denote/issues/552>.
2025-03-01 08:01:41 +02:00
Protesilaos Stavrou 4f29280051
Resolve all broken links to the now-removed denote-org-extras.el 2025-02-18 08:23:04 +02:00
Protesilaos Stavrou 1d6ed64965
Make small correction to indent a nested list in the manual 2025-02-18 08:22:46 +02:00
Protesilaos Stavrou ce458a987f
Remove all references to denote-org-extras.el and adapt the manual accordingly
This is part of the wider reorganisation of the project, as discussed
in issue 543: <https://github.com/protesilaos/denote/issues/543>.
2025-02-18 08:17:36 +02:00
Protesilaos Stavrou 78e352ad85
Tweak the wording of the reference to denote-sequence 2025-02-18 08:17:12 +02:00
Protesilaos Stavrou bde689cc9b
Remove Org extras as part of the wider project reorganisation
Covered here: <https://protesilaos.com/codelog/2025-02-11-emacs-splitting-denote-many-packages/>

Issue in the main Denote GitHub repository: <https://github.com/protesilaos/denote/issues/543>.
2025-02-15 10:28:40 +02:00
Protesilaos Stavrou 053cbddd25
Clarify development note about denote-sequence.el 2025-02-10 09:00:56 +02:00
Protesilaos Stavrou 5fc634ebc4
REMOVE denote-sequence.el as it will be its own package
This is part of the wider reorganisation of the project, as discussed
in issue 543: <https://github.com/protesilaos/denote/issues/543>.
2025-02-10 08:51:54 +02:00
Protesilaos Stavrou d5f8a6e11b
Merge denote-rename-buffer.el into denote.el
This is part of the wider reorganisation of the project, as discussed
in issue 543: <https://github.com/protesilaos/denote/issues/543>.
2025-02-07 11:19:13 +02:00
Protesilaos Stavrou 035e1452fe
Merge denote-sort.el into denote.el
This is part of the wider reorganisation of the project, as discussed
in issue 543: <https://github.com/protesilaos/denote/issues/543>.
2025-02-07 11:13:25 +02:00
Protesilaos Stavrou 212a1b3c17
Remove references to non-existent denote-link-or-create-with-command
We deleted it at some point, but did not remove everything. Thanks to
Jean-Philippe Gagné Guay for bringing this matter to my attention in
the discussion about reorganising the Denote code base. Issue 543:
<https://github.com/protesilaos/denote/issues/543>.
2025-02-05 08:12:07 +02:00
Protesilaos Stavrou 875c82c85d
Merge pull request #541 from frnsd/fix-sequence-prefix
Add tests for false matches addressed by pull request #540 and fix related issues
2025-02-03 17:51:25 +02:00
Kierin Bell f984340947 Fix 'denote-sequence-find-dired' error with TYPE 'parent'
A list is expected by 'denote-sequence-sort-files', but
'denote-sequence-get-relative' can return a string when called with TYPE
'parent'.
2025-01-31 20:58:16 -05:00
Kierin Bell 01251c6c5d Check for empty sequence in 'denote-sequence-get-all-files-with-prefix'
This prevents an error when calling 'denote-sequence-split' with an
empty string.  In particular, this happens when
'denote-sequence-get-relative' is called with TYPE 'siblings' on a
top-level sequence.  'denote-sequence-get-all-sequences-with-prefix' is
apparently not used in a context where it would receive an empty
sequence, but check for empty sequences there as well for consistency.
2025-01-31 20:57:45 -05:00
Kierin Bell a0c7086ebd Fix type prompt in interactive form of 'denote-sequence-find-dired'
The type is passed to 'denote-sequence-get-relative', which uses types
that are slightly different than those in 'denote-sequence-types'.  Also
update the error message displayed by 'denote-sequence-get-relative'
when it receives an unrecognized type to reflect that it no longer uses
the types from 'denote-sequence-types'.
2025-01-31 20:52:58 -05:00
Kierin Bell f6c6763402 Fix false matches in 'denote-sequence-get-all-files-with-prefix'
Create the new helper function 'denote-sequence--sequence-prefix-p' and
use it in both 'denote-sequence-get-all-files-with-prefix' and
'denote-sequence-get-all-sequences-with-prefix'.
2025-01-31 20:52:51 -05:00
Kierin Bell df89c98b42 Update dt-denote-sequence--get-new-exhaustive for false matches with a common prefix
The new tests will detect false matches resulting from confusing
sequence "1" with "10", "11", "100", etc.
2025-01-31 19:17:11 -05:00
Protesilaos Stavrou 322d6d493e
Update dt-denote-sequence--get-new-exhaustive to account for all denote-sequence-relative-types 2025-01-31 10:42:08 +02:00
Protesilaos Stavrou bd34f5e600
Acknowledge Kierin Bell for commit c76b313
This was done in pull request 540:
<https://github.com/protesilaos/denote/pull/540>. The change is less
than 15 lines, meaning that Kierin does not need to assign copyright
to the Free Software Foundation.
2025-01-31 10:35:17 +02:00
Protesilaos Stavrou 70e85ef34c
Merge pull request #540 from frnsd/fix-sequence-prefix
Fix false matches in 'denote-sequence-get-all-sequences-with-prefix'
2025-01-31 10:34:24 +02:00
Kierin Bell c76b313352 Fix false matches in 'denote-sequence-get-all-sequences-with-prefix'
Change the prefix match test from 'string-prefix-p' to an algorithm
that compares entire prefix components individually.
2025-01-30 17:12:15 -05:00
Protesilaos Stavrou 88de969826
Update the manual's Acknowledgements for commit 6f88b23
I forgot to do it there and pushed that commit before amending it...
2025-01-27 09:29:09 +02:00
Protesilaos Stavrou 6f88b2377f
Add an obsolete alias for denote-slug-hyphenate
In principle, we should not be doing this for private symbols, but it
helps with transitioning old code to the new normal. We have had this
practice for a long time now (and I eventually remove those warnings a
few releases afterwards).

Thanks to bdillahu for reporting the issue with some sample code in
the manual and to Jean-Philippe Gagné Guay for confirming the problem.
This was done in issue 538: <https://github.com/protesilaos/denote/issues/538>.
2025-01-27 09:25:44 +02:00
Protesilaos Stavrou 1bf9eba5aa
Improve the :type of denote-backlinks-display-buffer-action and make it ":risky t" 2025-01-25 09:06:26 +02:00
Protesilaos Stavrou 5fffe39b05
Replace denote-current-title with denote-current-data and document it in the manual 2025-01-22 07:58:37 +02:00
Protesilaos Stavrou 01ca4eba82
Make the denote-sequence annotation functions align their annotations 2025-01-21 17:47:48 +02:00
Protesilaos Stavrou f822f2c2c9
Fix indentation in denote-sequence--get-largest-by-length 2025-01-21 17:44:53 +02:00
Protesilaos Stavrou 0589a5cc93
Use 'denote-sequence-find-dired' in the manual 2025-01-21 11:16:51 +02:00
Protesilaos Stavrou 510bc68ce4
Rename denote-sequence-find-relatives-dired to denote-sequence-find-dired 2025-01-21 11:16:04 +02:00
Protesilaos Stavrou a767b7885c
Expand sequence relative to disambiguate "parent" from "all parents" and same for children 2025-01-21 11:14:21 +02:00
Protesilaos Stavrou 373b2838b5
Remove the convenience wrappers of denote-sequence-find
We do not need to have all those, because then we will end up with too
many commands.
2025-01-21 11:13:30 +02:00
Protesilaos Stavrou e0f1d471d5
Define variable that can be let bound to limit 'denote-file-prompt'
This is in response to a question by Alan Schmitt in issue 536:
<https://github.com/protesilaos/denote/issues/536>. Also thanks to
Jean-Philippe Gagné Guay for the comment about whether this is a
useful feature.
2025-01-21 08:13:16 +02:00
Protesilaos Stavrou 5ee556fdc1
Merge pull request #537 from jeanphilippegg/denote-current-title
New denote-current-title variable
2025-01-20 08:31:09 +02:00
Jean-Philippe Gagné Guay 1a13b6a22f Add denote-current-title variable 2025-01-19 21:18:08 -05:00
Protesilaos Stavrou 605534495b
Define annotation-function for denote-sequence-type-prompt and parameterise it accordingly 2025-01-19 09:33:03 +02:00
Protesilaos Stavrou 03107fe702
Make small refinement to denote-sequence-find 2025-01-19 09:17:29 +02:00
Protesilaos Stavrou bc0a6de3ad
Document how to have a "controlled vocabulary" of keywords 2025-01-18 09:58:45 +02:00
Protesilaos Stavrou bad5ee6ae4
Rephrase the paragraph about signatures in the manual's file-naming scheme section 2025-01-18 07:45:25 +02:00
Protesilaos Stavrou d3b377792a
Remove long obsolete reference from the manual 2025-01-18 07:33:30 +02:00
Protesilaos Stavrou 2344264c8d
Make small changes to the denote-link docs 2025-01-18 07:32:11 +02:00
Protesilaos Stavrou 04a09aff19
Update the denote-prompts documentation to better describe signatures 2025-01-18 07:32:05 +02:00
Protesilaos Stavrou 12062e238c
DEPRECATE denote-link-with-signature
The denote-link command already inserts a signature if it is there,
plus we have the denote-link-description-format, which can be set to
whatever style the user prefers. This command I am deprecating was
basically doing what a user gets as soon as they type = in the
minibuffer (which will match files that have a signature).
2025-01-18 07:32:05 +02:00
Protesilaos Stavrou 29e47e255a
Refine denote-link--prepare-backlinks to map over the results only once 2025-01-18 07:04:41 +02:00
Protesilaos Stavrou c2a734ab1c
Use the correct outline level for the 'denote:' Org hyperlink 2025-01-18 06:37:11 +02:00
Protesilaos Stavrou 7a541fe223
Use the correct outline level for the menu bar entry 2025-01-18 06:36:27 +02:00
Protesilaos Stavrou bc12b58beb
Document in the manual denote-sequence-find-relatives-dired 2025-01-17 12:49:41 +02:00
Protesilaos Stavrou 0e72995d76
Define denote-sequence-find-relatives-dired command 2025-01-17 12:47:24 +02:00
Protesilaos Stavrou 4470e316fa
Document in the manual the denote-sequence-find command and related 2025-01-17 09:51:31 +02:00
Protesilaos Stavrou f6b5770b97
Add denote-sequence-find command and helper wrappers to get relatives 2025-01-17 09:46:38 +02:00
Protesilaos Stavrou 14fc0197a2
Make denote-sequence-get-relative get parents more reliably 2025-01-17 09:38:41 +02:00
Protesilaos Stavrou dc59f0477c
Make denote-sequence-type-prompt accepte optional PROMPT-TEXT 2025-01-17 09:07:11 +02:00
Protesilaos Stavrou 2fe245806e
Update dt-denote-sequence--get-new-exhaustive to all test for relatives 2025-01-17 09:04:37 +02:00
Protesilaos Stavrou 47fbde671a
Make denote-sequence-get-relative correctly get the parents 2025-01-17 09:03:26 +02:00
Protesilaos Stavrou 71630b9510
Add denote-sequence-get-relative function
This foreshadows commands I will introduce shortly.
2025-01-17 08:41:17 +02:00
Protesilaos Stavrou 78392b86ba
Rename dt-denote-sequence--get-new-child-and-sibling to dt-denote-sequence--get-new-exhaustive
Add the test for parent as well.
2025-01-17 08:22:37 +02:00
Protesilaos Stavrou 0c4fcdedcc
Update dt-denote-sequence--get-new-child-and-sibling to use denote-sequence-get-new 2025-01-17 08:19:32 +02:00
Protesilaos Stavrou 9a5d7f912e
Make denote-sequence-get-new accept SEQUENCES like all its helper functions 2025-01-17 08:15:57 +02:00
Protesilaos Stavrou 3a3cc6603d
Use denote-sequence-get-all-files instead of its helper (extend 7d4c194) 2025-01-17 08:10:38 +02:00
Protesilaos Stavrou 7d4c194365
Make denote-sequence-get-all-files accept optional FILES 2025-01-17 08:09:15 +02:00
Protesilaos Stavrou ee33e1081c
Rename denote-sequence-get to denote-sequence-get-new
It is more obvious what it does.
2025-01-17 08:04:39 +02:00
Protesilaos Stavrou dd72f341dd
Make the denote-file-prompt 'let' bind the default-directory
This way, any other function that needs to derive the file path from
the completion candidates will do it correctly.

I discovered this by discussing with Alan Schmitt an issue involving
the Embark package. This was done in discussion 524:
<https://github.com/protesilaos/denote/discussions/524>.
2025-01-17 08:01:22 +02:00
Protesilaos Stavrou 15eaa656e7
Document in the manual the denote-sequence-convert command 2025-01-15 17:15:33 +02:00
Protesilaos Stavrou 7136c7d060
Add denote-sequence-convert command 2025-01-15 17:15:28 +02:00
Protesilaos Stavrou f23f84c6e3
Rename the function denote-sequence-convert to denote-sequence-make-conversion
The old name is better for a command.
2025-01-15 16:47:43 +02:00
Protesilaos Stavrou a7e902e680
Remove needless constant denote-sequence-schemes 2025-01-15 16:24:08 +02:00
Protesilaos Stavrou 8da349fc23
Rephrase the Commentary of denote-sequence.el 2025-01-15 16:19:11 +02:00
Protesilaos Stavrou d934da26eb
Make dt-denote-sequence--get-new-child-and-sibling use the system trash 2025-01-15 16:13:53 +02:00
Protesilaos Stavrou 9bf22d57ec
Make denote-org-link-in-context-regexp also cover the search extension
This is because our 'denote:' links have the same capabilities as the
'file:' links with regard to moving to a specific position in the
buffer.

Thanks to leafarbelm for reporting the bug in issue 523:
<https://github.com/protesilaos/denote/issues/523>.
2025-01-15 08:25:02 +02:00
Protesilaos Stavrou 814b069d46
Merge pull request #528 from migliio/main
Fix the regression bug discussed in #526
2025-01-15 08:05:15 +02:00
Claudio Migliorelli 237d559d50 Fix the regression bug discussed in #526
This patch fixes the regression bug in
`denote-sequence-get-all-files`, as discussed in #526. The core idea
behind this fix is to delete duplicates within the list of files and
buffers in the `denote-directory` matching a certain signature.
2025-01-14 19:00:35 +01:00
Protesilaos Stavrou c795f147d7
Fix unbalanced parentheses in denote-sequence--get-file-in-dired-or-prompt 2025-01-14 08:12:18 +02:00
Protesilaos Stavrou 0381e59216
Clarify the denote-sequence-file-p doc string 2025-01-14 07:56:17 +02:00
Protesilaos Stavrou 584235fe9f
Make denote-sequence-new-{child,sibling}-of-current also work for file in Dired 2025-01-14 07:56:11 +02:00
Protesilaos Stavrou e8d5f68609
Add TODO about a recursive denote-sequence-reparent 2025-01-14 07:53:25 +02:00
Protesilaos Stavrou a7d0797c82
Remove a TODO about denote-sequence that pertains to sluggification
I tried it and we are okay without it.
2025-01-14 07:52:52 +02:00
Protesilaos Stavrou 946dece0bc
Use corrent name of parameter in doc string of denote-sequence 2025-01-14 07:52:35 +02:00
Protesilaos Stavrou 5992140c9a
Remove the needless denote-sequence--tail-alphanumeric-p 2025-01-14 07:52:23 +02:00
Protesilaos Stavrou 69f23c9f95
Reeword denote-sequence-get-all-sequences-with-prefix doc string 2025-01-14 07:52:00 +02:00
Protesilaos Stavrou 6ca703f463
Reword denote-sequence-get-all-sequences doc string 2025-01-14 07:51:45 +02:00
Protesilaos Stavrou 705988ede0
Be consistent with the regexp group in two sequence functions 2025-01-14 07:50:59 +02:00
Protesilaos Stavrou b596ca71ad
Consolidate the tests of new child or sibling sequences 2025-01-13 11:24:54 +02:00
Protesilaos Stavrou f9f779847c
Make denote-sequence--get-largest more robust when getting a child 2025-01-13 11:13:51 +02:00
Protesilaos Stavrou fa635a9f89
Remove superfluous condition in denote-sequence--get-new-child 2025-01-13 09:26:03 +02:00
Protesilaos Stavrou 4e62c3f2b6
Rewrite and expand the manual about denote-sequence.el 2025-01-12 11:24:25 +02:00
Protesilaos Stavrou a4d3d62b26
Clarify how denote-sequence can be loaded 2025-01-12 11:03:27 +02:00
Protesilaos Stavrou 6e9473cd4f
Merge branch 'alphanumeric-sequence-extension' 2025-01-12 11:01:12 +02:00
Protesilaos Stavrou a717f46eee
Make denote-sequence-convert also convert complete sequences 2025-01-12 10:57:42 +02:00
Protesilaos Stavrou 26f43c8aec
Make denote-sequence-alphanumeric-p require numeric prefix 2025-01-12 10:57:23 +02:00
Protesilaos Stavrou 182db0675e
Expand tests to also cover alphanumeric sibling sequences 2025-01-12 10:21:53 +02:00
Protesilaos Stavrou a0188e7cba
Expand tests to also cover alphanumeric child sequences 2025-01-12 10:19:44 +02:00
Protesilaos Stavrou b642758ff9
Ensure the sequence tests target the implied scheme 2025-01-12 10:16:07 +02:00
Protesilaos Stavrou 14dd0b5d2e
Make denote-sequence--get-new-child work with alphanumeric sequences 2025-01-12 10:15:56 +02:00
Protesilaos Stavrou 4997e6b007
Rename denote-sequence-get-sequences-with-max-depth to include "all"
This is to keep it consistent with all the other similar functions.
2025-01-12 09:53:10 +02:00
Protesilaos Stavrou 913571e79e
Make sure denote-sequence-get-sequences-with-max-depth returns all up to depth
Before it was returning only those with the given depth number.
2025-01-12 08:58:01 +02:00
Protesilaos Stavrou 803cafc128
Make sequence retrieval also check for unsaved files
Otherwise users may not know why a command that produces a given
sequence does not use the expected number. Thanks to elliottw for
reporting this in issue 519: <https://github.com/protesilaos/denote/issues/519>.
2025-01-12 08:57:55 +02:00
Protesilaos Stavrou 43bd30e6eb
Make the groundwork for alphanumeric (Luhmann) sequences in denote-sequence.el
The idea is to support both numeric and alphanumeric sequencing
schemes, as documented in the new user option 'denote-sequence-scheme'.

We now have the tools to correctly split, join, increment, and convert
input accordingly, such that we can, for example, accurately produce a
child of sequence "1a2" (we could already do that for numeric
sequences).

What is covered herein is just the groundwork. I still need to extend
the helper functions which directly support the creation of new
parent, child, or sibling sequences. While this still is a lot of
work, the hard part is now done.
2025-01-11 19:37:56 +02:00
Protesilaos Stavrou 07aec1b587
Fix the shorthand in denote-test.el 2025-01-11 08:21:21 +02:00
Protesilaos Stavrou 34bdbc2f0c
Add TODO for testing built-in hierarchy.el to visualise sequences (denote-sequence.el) 2025-01-08 16:54:11 +02:00
Protesilaos Stavrou 21f64de9fd
Define denote-sequence--get-parent 2025-01-08 16:43:28 +02:00
Protesilaos Stavrou 6de6e5875d
Define denote-sequence-with-error-p to simplify some error checks 2025-01-08 16:42:57 +02:00
Protesilaos Stavrou 1666af3447
Define denote-sequence--join to streamline common tasks 2025-01-08 16:39:34 +02:00
Protesilaos Stavrou 165408f0d0
Rename denote-sequence--children-p to denote-sequence--children-implied-p
The latter better described what it is doing. Plus the doc string
clarifies the rationale.
2025-01-08 16:32:44 +02:00
Protesilaos Stavrou f3491587a4
Merge branch 'main' of github.com:protesilaos/denote 2025-01-08 16:20:05 +02:00
Protesilaos Stavrou 4bbc147633
Define denote-sequence--children-p 2025-01-08 16:19:08 +02:00
Protesilaos Stavrou c3b2a9dce1
Expand the test for denote-sequence--get-new-child
This is to test the case reported by elliottw in issue 519:
<https://github.com/protesilaos/denote/issues/519> .
2025-01-08 11:48:31 +02:00
Protesilaos Stavrou a9d36edd68
Mention the denote-search package by Lucas Quintana
We discussed this with Lucas in discussion 507:
<https://github.com/protesilaos/denote/discussions/507>.
2025-01-07 08:33:31 +02:00
Protesilaos Stavrou aaf667f4a4
Document in the manual denote-sequence-new-{child,sibling}-of-current 2025-01-05 12:19:25 +02:00
Protesilaos Stavrou f948c3ca44
Make two small stylistic changes to denote-sequence--pad 2025-01-05 12:12:22 +02:00
Protesilaos Stavrou 3e831132f1
Use format-message in denote-sequence--get-dired-buffer-name
This makes the quotes look better on the mode line.
2025-01-05 12:09:40 +02:00
Protesilaos Stavrou 23098ea222
Define denote-sequence-new-child-of-current command
Thanks to Mirko Hernandez for suggesting the creation of "do-what-I-mean"
commands, which I interpret as this sort of thing.

This was done in discussion 506:
<https://github.com/protesilaos/denote/discussions/506>.
2025-01-05 10:18:00 +02:00
Protesilaos Stavrou 6f82f181a8
Define denote-sequence-new-sibling-of-current command
Thanks to Mirko Hernandez for suggesting the creation of "do-what-I-mean"
commands, which I interpret as this sort of thing.

This was done in discussion 506:
<https://github.com/protesilaos/denote/discussions/506>.
2025-01-05 10:15:41 +02:00
Protesilaos Stavrou dd18fbac83
Fix "SEQUENE" to "SEQUENCE"
Thanks to Nicolas Semrau for bringing this matter to my attention:
<472e71e856 (commitcomment-150930369)>.
2025-01-05 09:02:32 +02:00
Protesilaos Stavrou 37cbe3ff29
Use shorter title for Info's "sequence notes" and use it in the defgroup 2025-01-05 08:44:08 +02:00
Protesilaos Stavrou 6860064eca
Make small stylistic change to denote-sequence--get-new-child 2025-01-05 08:40:11 +02:00
Protesilaos Stavrou 13488e58d7
Expand the doc string of denote-sequence-new-sibling 2025-01-05 08:04:40 +02:00
Protesilaos Stavrou 472e71e856
Expand the doc string of denote-sequence-new-child 2025-01-05 08:04:32 +02:00
Protesilaos Stavrou 81f31ea658
Make sure denote-sequence--get-largest reverses the list
We had a regression here when we switched to the old,
backward-compatible calling convention of 'sort'.
2025-01-05 07:55:40 +02:00
Protesilaos Stavrou 5651dc7737
Replace denote-sequence-sort with denote-sequence-sort-files
Part of this is to encapsulate the logic in a single function and also
to use the backward-compatible calling convention of 'sort', as we did
with Claudio Migliorelli in pull request 518:
<https://github.com/protesilaos/denote/pull/518>
2025-01-04 18:55:35 +02:00
Protesilaos Stavrou c7ba0b6bea
Update the denote-sort-identifier-comparison-function
Tweak what was contributed by Maikol Solis in pull request 517:
<https://github.com/protesilaos/denote/pull/517>.
2025-01-04 18:47:35 +02:00
Protesilaos Stavrou 5b7755f6fc
Document denote-sort-identifier-comparison-function and acknowledge Maikol Solis
This was missing from the original implementation about all these
comparison functions. Thanks to Maikol Solis for adding the new
defcustom in commit 1b65d9e, which was done in pull request 517:
<https://github.com/protesilaos/denote/pull/517>.
2025-01-04 18:46:14 +02:00
Protesilaos Stavrou c88ca934c9
Merge pull request #517 from maikol-solis/main
Add identifier comparison sort function in denote-sort-files
2025-01-04 18:42:52 +02:00
Protesilaos Stavrou 4a492963f2
Acknowledge Claudio Migliorelli for commit fffe24d
It is about using a backward-compatible 'sort' call. This was
discussed in issue 516 and then done in pull request 518:

- <https://github.com/protesilaos/denote/issues/516>
- <https://github.com/protesilaos/denote/pull/518>
2025-01-04 18:39:44 +02:00
Protesilaos Stavrou 7f3715ddd3
Merge pull request #518 from migliio/main
Use older-compatible `sort` call in `denote-sequence--get-largest`
2025-01-04 18:38:54 +02:00
Claudio Migliorelli fffe24dbf5 Use older-compatible sort call in denote-sequence--get-largest
As pointed out in #516, the `sort` function seems to have a
mismatching paradigm depending on the Emacs version the code is run
on. However, the `denote-sequence--get-largest` implementation was
simply using the `:in-place` key as third argument, while the original
implementation of `sort` only accepted two arguments, which is not
necessary. The sorting is done in place anyhow. This commit modifies
the `denote-sequence--get-largest` function to be compatible with
older Emacs versions.
2025-01-04 17:02:00 +01:00
Maikol Solís 1b65d9ed99 Add identifier comparison sort function in denote-sort-files
The function `denote-sort-dired` wasn't working due to the
`identifier` missing case in `denote-sort-files`. This is useful when
you customize `denote-file-name-components-order`.
2025-01-04 06:15:32 -06:00
Protesilaos Stavrou 9f41d3f594
Merge branch 'main' of github.com:protesilaos/denote 2025-01-04 10:32:08 +02:00
Protesilaos Stavrou 56af4761bd
Add FIXME for our dired revert-buffer-function 2025-01-04 10:31:44 +02:00
Protesilaos Stavrou 74ed8c6c06
Merge pull request #515 from jeanphilippegg/some-modifications
Some fixes
2025-01-04 08:22:38 +02:00
Protesilaos Stavrou eeb1ee3050
Make denote-sequence-dired revert-buffer-function use the prefix args it got 2025-01-04 08:05:42 +02:00
Protesilaos Stavrou d619abc08a
Make the denote-sequence-dired error more generic 2025-01-04 08:05:31 +02:00
Protesilaos Stavrou 0e4fb30e27
Change how denote-sequence-dired gets the buffer name 2025-01-04 08:04:36 +02:00
Jean-Philippe Gagné Guay 7e59f0b73e Check denote-file-has-identifier-p in denote-link--map-over-notes 2025-01-04 00:35:29 -05:00
Jean-Philippe Gagné Guay 1135df2a91 Allow string date parameter in denote-rename-file 2025-01-04 00:31:09 -05:00
Protesilaos Stavrou 13eee39873
Make the denote-sequence-new-child more informative 2025-01-03 19:17:09 +02:00
Protesilaos Stavrou ba22e8d65b
Make the denote-sequence-new-sibling more informative 2025-01-03 19:17:00 +02:00
Protesilaos Stavrou 02aac5336d
Make the denote-sequence prompt more informative depending on the selected type 2025-01-03 19:16:40 +02:00
Protesilaos Stavrou 9ca42c5264
Make denote-sequence-link prompt more informative 2025-01-03 19:12:18 +02:00
Protesilaos Stavrou 536a77bdee
Add missing prompt text from commit ee80737 2025-01-03 19:11:37 +02:00
Protesilaos Stavrou c32ff290ab
Make denote-sequence-depth-prompt accept optional PROMPT-TEXT parameter 2025-01-03 17:21:28 +02:00
Protesilaos Stavrou ee80737526
Use a custom prompt text for prefix in denote-sequence-dired 2025-01-03 17:19:56 +02:00
Protesilaos Stavrou 4d4b829e8e
Make the denote-sequence-depth-prompt prompt more informative 2025-01-03 17:19:43 +02:00
Protesilaos Stavrou a3f635ff9d
Make sure denote-sequence-get-all-files-with-prefix checks only the prefix
Otherwise, it returns false positives.
2025-01-03 15:31:18 +02:00
Protesilaos Stavrou 68ba7c1859
Fix creation of new parent in command denote-sequence 2025-01-03 12:53:47 +02:00
Protesilaos Stavrou 0c32268eac
Clarify the doc string of denote-sequence-depth 2025-01-03 12:49:42 +02:00
Protesilaos Stavrou c821f84f2d
Document optional extension denote-sequence.el 2025-01-03 12:34:25 +02:00
Protesilaos Stavrou 0d4ff4a1ed
Merge pull request #512 from jeanphilippegg/fix-issue
Fix regression in denote-prepend-front-matter (issue #510)
2025-01-02 08:29:19 +02:00
Jean-Philippe Gagné Guay 22b96a2baf Fix regression in denote-prepend-front-matter 2025-01-02 01:24:13 -05:00
Protesilaos Stavrou e58479f096
Add denote-sequence-reparent command 2025-01-02 08:01:07 +02:00
Protesilaos Stavrou e5850777fb
Make denote-sequence-file-prompt accept optional parameters 2025-01-02 08:00:34 +02:00
Protesilaos Stavrou ac756f5270
Make denote-sequence-sort do the right thing by expanding denote-sequence--pad 2025-01-01 20:59:31 +02:00
Protesilaos Stavrou f293ee60df
Define denote-sequence-dired command and its helpers 2025-01-01 09:59:06 +02:00
Protesilaos Stavrou 7299ed9bc0
Define denote-sequence-get-all-files-with-max-depth 2025-01-01 09:58:46 +02:00
Protesilaos Stavrou 608e0e880b
Define denote-sequence-get-all-files-with-prefix 2025-01-01 09:58:29 +02:00
Protesilaos Stavrou 383a610399
Make denote-test.el use Elisp shorthands 2025-01-01 08:50:52 +02:00
Protesilaos Stavrou 9da97d3dc2
Update copyright years in denote-test.el 2025-01-01 08:32:04 +02:00
Protesilaos Stavrou 2a3436e111
Merge branch 'sequence-notes-extension' 2025-01-01 08:31:41 +02:00
Protesilaos Stavrou 90372d9627
Update copyright years in a few places 2025-01-01 07:03:42 +02:00
Protesilaos Stavrou 27ef655bc8
Update copyright years in denote-sequence.el 2025-01-01 07:00:27 +02:00
Protesilaos Stavrou 50bace231e
Define denote-sequence-link command 2024-12-31 18:48:16 +02:00
Protesilaos Stavrou 2eded970e9
Rewrite denote-sequence-new-child doc string 2024-12-31 18:47:54 +02:00
Protesilaos Stavrou 9871d5b2ab
Rewrite denote-sequence-new-sibling doc string 2024-12-31 18:47:45 +02:00
Protesilaos Stavrou cdba50e984
Rewrite the doc string of denote-sequence-new-parent and let it work from Lisp 2024-12-31 18:47:22 +02:00
Protesilaos Stavrou 220d9876a6
Define denote-sequence-file-p to streamline some procedures 2024-12-31 18:46:37 +02:00
Protesilaos Stavrou 61f5712095
Capitalise "Denote" in the defgroup of denote-sequence 2024-12-31 18:44:21 +02:00
Protesilaos Stavrou 6fe68be094
Fix denote-sequence-file-prompt indentation 2024-12-31 12:07:19 +02:00
Protesilaos Stavrou 80901d4604
Use denote-sequence-split in two cases 2024-12-31 12:05:45 +02:00
Protesilaos Stavrou b72257ad7d
Make denote-sequence--pad throw an error if the type is unknown
I thought about the scenario of generating a descendant, but it does
not seem to make sense workflow-wise. The user should be more
specific, such as to create the child of a sequence.
2024-12-31 12:01:26 +02:00
Protesilaos Stavrou cd772dad09
Add TODO for possibly sharing state between some tests 2024-12-31 11:59:43 +02:00
Protesilaos Stavrou c0bcc13ef3
Write test for denote-sequence--get-new-sibling given commit 43322b3 2024-12-31 11:57:43 +02:00
Protesilaos Stavrou 43322b34aa
Rewrite denote-sequence--get-new-sibling to address its bugs 2024-12-31 11:57:17 +02:00
Protesilaos Stavrou 6a43e5cad5
Add test about denote-sequence--get-new-child 2024-12-31 08:46:05 +02:00
Protesilaos Stavrou 6aaf3bfcb0
Clarify denote-sequence-get-all-sequences doc string 2024-12-31 08:45:58 +02:00
Protesilaos Stavrou 451872b094
Make denote-sequence-get-all-sequences accept optional FILES argument 2024-12-31 08:45:41 +02:00
Protesilaos Stavrou 8000e2e01b
Fix (?) all remaining issues with denote-sequence--get-new-child
I will write tests when this is merged into main.
2024-12-30 10:30:02 +02:00
Protesilaos Stavrou 8d130358a2
Fix some more issues with denote-sequence--get-new-child
STILL NEEDS TESTING.
2024-12-30 09:51:13 +02:00
Protesilaos Stavrou d9d2f2767f
Merge branch 'sequence-notes-extension' of github.com:protesilaos/denote into sequence-notes-extension 2024-12-30 09:24:30 +02:00
Protesilaos Stavrou bb357f03bb
Make denote-sequence--get-new-child more robust
THIS NEEDS MORE TESTING.

The idea is to find the level at which we are inserting a child, then
figure out which is the largest already there, and increment that
number.
2024-12-30 09:23:19 +02:00
Protesilaos Stavrou 35fc16ec30
Define denote-sequence-depth function 2024-12-30 09:19:38 +02:00
Protesilaos Stavrou 23892d55f6
Define denote-sequence-split function 2024-12-30 09:19:25 +02:00
Protesilaos Stavrou 36cb4234dd
Change where 'denote-sequence' does the signature extraction
We want this to happen for Lisp calls as well.
2024-12-30 07:59:29 +02:00
Protesilaos Stavrou 265b0401a0
Add TODO for a possible cl-letf in 'denote-sequence' 2024-12-30 07:57:18 +02:00
Protesilaos Stavrou b933238dcb
Rewrite the second parameter of 'denote-sequence' to avoid confusion 2024-12-30 07:56:10 +02:00
Protesilaos Stavrou 70b6708229
Remove needless 'when' around 'pcase' in 'denote-sort-files' 2024-12-29 09:42:23 +02:00
Protesilaos Stavrou 247f0d1fec
Make denote-sort-files accept a custom sort function
Thanks to Mirko Hernandez for making this suggestion in discussion
506: <https://github.com/protesilaos/denote/discussions/506>.
2024-12-29 09:38:12 +02:00
Protesilaos Stavrou 24bd7ae625
Acknowledge Laurent Gatto for commit 8fca695
This was done in pull request 505: <https://github.com/protesilaos/denote/pull/505>.
The change is small, meaning that Laurent does not need to assign
copyright to the Free Software Foundation.
2024-12-29 09:27:54 +02:00
Protesilaos Stavrou 5e10082d8e
Merge pull request #505 from lgatto/patch-2
Update README.org
2024-12-29 09:26:38 +02:00
Laurent Gatto 8fca695299
Update README.org
- From the text, there seem to be more than five (I count seven) to write a note with Denote.
- Typo - remove 's'.
2024-12-28 18:30:02 +01:00
Protesilaos Stavrou 21b03db4a8
Update sample config to have simpler variant and use-package 2024-12-28 08:03:49 +02:00
Protesilaos Stavrou 9b2cf81054
Make denote-link--map-over-notes less strict about what it matches
This is in response to issue 503, where Oliver Epper encountered an
error while trying to link files which are not plain text:
<https://github.com/protesilaos/denote/issues/503>.
2024-12-26 16:44:34 +02:00
Protesilaos Stavrou 8e8b43b3cc
Make denote-link-dired-marked-notes only work from a Dired buffer 2024-12-26 09:25:07 +02:00
Protesilaos Stavrou e82c628444
Refactor denote-link-dired-marked-notes
1. Do not use 'find-file' to get the buffer of the selected file
   because this has the side effect of switching the current window buffer.

2. If the buffer is in a window, select that window to perform the
   operation. Otherwise, do the work with its buffer as current and
   then display the buffer below the current one.

3. Produce a message to inform the user what happened.
2024-12-26 09:21:52 +02:00
Protesilaos Stavrou fc8372bc9c
Simplify the doc string of denote-link-dired-marked-notes 2024-12-26 09:18:40 +02:00
Protesilaos Stavrou f0f6895e91
Make denote-link--buffer-file-prompt doc string more accurate 2024-12-26 09:18:20 +02:00
Protesilaos Stavrou 7e2cf94b7c
Fix completion category in denote-link--buffer-file-prompt
This is related to the bug reported by Oliver Epper in issue 503:
<https://github.com/protesilaos/denote/issues/503>. Also see commit
d9bf8db.
2024-12-26 08:47:34 +02:00
Protesilaos Stavrou d9bf8db87c
Fix alias to denote-link-dired-marked-notes
Otherwise, this was making the alias and the alised function do
nothing. Thanks to Olver Epper for reporting a problem with this
command in issue 503: <https://github.com/protesilaos/denote/issues/503>.
2024-12-26 08:38:23 +02:00
Protesilaos Stavrou 6c5858c72b
Reword denote-sequence doc sentence to not exceed 80 characters 2024-12-25 19:19:32 +02:00
Protesilaos Stavrou d44d3271fc
Add missing require for 'denote' in denote-sequence.el 2024-12-25 18:41:02 +02:00
Protesilaos Stavrou a87d0c86e3
Acknowledge Jeff Valk for reporting issue that led to rename commands during org-capture
This was done in issue 500, with the change made by Jean-Philippe
Gagné Guay in pull request 502:

- <https://github.com/protesilaos/denote/issues/500>
- <https://github.com/protesilaos/denote/pull/502>
2024-12-25 17:59:02 +02:00
Protesilaos Stavrou 25e1cf93b7
Merge pull request #502 from jeanphilippegg/denote-org-capture
Make renaming commands work in denote-org-capture
2024-12-25 17:56:04 +02:00
Protesilaos Stavrou c5438dfdb3
Make denote-sequence-file-prompt err if there are no sequence notes 2024-12-25 17:44:51 +02:00
Protesilaos Stavrou c72e535a04
Make denote-sequence--get-new-parent work if there are no sequences 2024-12-25 17:41:28 +02:00
Protesilaos Stavrou adac55d35b
Reword denote-sequence-file-prompt prompt 2024-12-25 17:41:17 +02:00
Protesilaos Stavrou df24b3639b
Tweak the defgroup of denote-sequence 2024-12-25 17:31:49 +02:00
Protesilaos Stavrou 9f9be73605
Fix denote-sequence--get-new-sibling to not error early if sequence does not include children 2024-12-25 17:30:43 +02:00
Protesilaos Stavrou 1203e63716
Remove needless interactive declaration from two commands in denote-sequence.el 2024-12-25 17:30:12 +02:00
Protesilaos Stavrou 445559a606
Make denote-sequence-new-child actually get the child of sequence 2024-12-25 17:24:46 +02:00
Protesilaos Stavrou dad23f3b4b
Remove all needless metadata from denote-sequence.el 2024-12-25 17:08:26 +02:00
Protesilaos Stavrou d7b84ca39d
Remove needless package requirement in denote-sequence.el 2024-12-25 17:00:42 +02:00
Protesilaos Stavrou d1ba5e86c3
Add prototype of denote-sequence.el 2024-12-25 16:54:23 +02:00
Jean-Philippe Gagné Guay 8d1202d2e8 Add hook to rename file after denote-org-capture 2024-12-22 13:58:29 -05:00
Jean-Philippe Gagné Guay 5cd129030a Make renaming commands work in org-capture buffer 2024-12-22 13:22:59 -05:00
Protesilaos Stavrou 8bd602b863
Make obsolete the command 'denote-add-front-matter'
This is due to refinements made by Jean-Philippe Gagné Guay to the
file renaming mechanism. We discussed this deprecation in issue 498:
<https://github.com/protesilaos/denote/issues/498>.
2024-12-22 11:01:06 +02:00
Protesilaos Stavrou c6bc62d6c9
Document the optional use of Obsidian-style front matter 2024-12-16 08:50:37 +02:00
Protesilaos Stavrou af8279fba4
Merge branch 'obsidian-file-type' 2024-12-16 08:44:41 +02:00
Protesilaos Stavrou 2f1a221f5d
Define the markdown-obsidian front matter in denote-md-extras.el 2024-12-16 08:41:25 +02:00
Protesilaos Stavrou f6fe1e27e6
Merge pull request #497 from jeanphilippegg/some-changes
Small adjustments
2024-12-16 08:31:39 +02:00
Jean-Philippe Gagné Guay f11966e642 Add check in denote--get-all-used-ids 2024-12-15 23:59:40 -05:00
Jean-Philippe Gagné Guay 5541eebbb9 Use denote-file-has-supported-extension-p instead of denote-filename-is-note-p 2024-12-15 23:59:40 -05:00
Jean-Philippe Gagné Guay 3ca5797934 Add denote-file-is-in-denote-directory-p 2024-12-15 23:59:35 -05:00
Jean-Philippe Gagné Guay edda750506 Handle nil date in front matter date functions 2024-12-14 23:32:50 -05:00
Jean-Philippe Gagné Guay 119624e038 Small refactor of denote-directory-files 2024-12-14 23:04:13 -05:00
Jean-Philippe Gagné Guay ee8b53b5c9 Use denote-file-has-denoted-filename-p in fontification 2024-12-14 23:03:25 -05:00
Jean-Philippe Gagné Guay 05edc7dc5e Make it possible to rewrite the front matter even if file name is unchanged 2024-12-14 22:35:09 -05:00
Protesilaos Stavrou 2ab74c1d47
Merge pull request #495 from jeanphilippegg/denote--date-convert
Small adjustments for notes without identifier
2024-12-14 09:10:59 +02:00
Protesilaos Stavrou 5d4b9f9089
Merge pull request #496 from jeanphilippegg/fix-tests
Fix tests
2024-12-14 09:04:59 +02:00
Jean-Philippe Gagné Guay 165ef38a9b Add denote--generate-date-for-rename 2024-12-14 00:03:14 -05:00
Jean-Philippe Gagné Guay 779fe017dc Validate the presence of at least one file name component 2024-12-13 23:42:45 -05:00
Jean-Philippe Gagné Guay 8f3e5dd407 Fix tests 2024-12-13 23:23:25 -05:00
Jean-Philippe Gagné Guay 0a5c142287 Refactor denote--date-convert 2024-12-13 22:31:48 -05:00
Protesilaos Stavrou 6613d3903d
Refactor denote-add-front-matter and make it interactive-only 2024-12-13 11:18:42 +02:00
Protesilaos Stavrou 97d866ee6d
Replace denote--add-front-matter with denote-prepend-front-matter 2024-12-13 11:18:05 +02:00
Protesilaos Stavrou e9840d1f57
Make denote-add-front-matter read title value if available
Thanks to juh for asking about this in issue 493:
<https://github.com/protesilaos/denote/issues/493>.
2024-12-11 08:57:25 +02:00
Protesilaos Stavrou ce7ce48c9f
Make denote-journal-extras--filename-date-regexp better match repositioned identifier 2024-12-10 08:13:35 +02:00
Protesilaos Stavrou c68e9bee1e
Mention denote-file-has-denoted-filename-p in the manual
This was contributed by Jean-Philippe Gagné Guay as part of the
changeset of pull request 491: <https://github.com/protesilaos/denote/pull/491>.
2024-12-09 12:53:54 +02:00
Protesilaos Stavrou 63a6603b62
Merge pull request #491 from jeanphilippegg/denote-retrieve-title-or-filename
Fix denote-retrieve-title-or-filename and other tweak
2024-12-09 12:51:24 +02:00
Protesilaos Stavrou f89f9ee963
Make denote-date-prompt accept optional INITIAL-DATE and PROMPT-TEXT
Thanks to Alex Griffin for starting the discussion about this feature
and to Jean-Philippe Gagné Guay for contributing to it. It was done in
issue 489: <https://github.com/protesilaos/denote/issues/489>.
2024-12-09 11:51:08 +02:00
Protesilaos Stavrou 7a2034516e
Fix denote-add-front-matter code for signature value
Thanks to Samuel Flint for reporting this in issue 492:
<https://github.com/protesilaos/denote/issues/492>.
2024-12-08 18:46:09 +02:00
Protesilaos Stavrou 3a0bc9255b
Fix denote-org-extras--parse-rx for nil argument
Thanks to Samuel Flint for noticing this problem as part of the
discussion in issue 490: <https://github.com/protesilaos/denote/issues/490>.
2024-12-07 19:03:30 +02:00
Protesilaos Stavrou 75094832ce
Make denote-org-extras--parse-rx more robust
Thanks to Samuel Flint for informing me that a nil argument was not
doing the right thing. We want to be more careful in this regard. This
was discussed in issue 490: <https://github.com/protesilaos/denote/issues/490>.
2024-12-07 08:34:09 +02:00
Jean-Philippe Gagné Guay 5ae74c1158 Change the way denote--used-ids is used 2024-12-07 00:19:55 -05:00
Jean-Philippe Gagné Guay 26629820f7 Refactor denote-retrieve-title-or-filename
Use denote-file-has-denoted-filename-p function. It does not validate
the location of the file. It validates that the file respects Denote's
file-naming scheme instead of only the presence of an identifier.
2024-12-06 23:55:40 -05:00
Jean-Philippe Gagné Guay a89755c686 Add denote-file-has-denoted-filename-p function 2024-12-06 23:49:02 -05:00
Protesilaos Stavrou 392f6ebe77
Tweak denote-org-extras--get-outline to only ever get useful regexp for the outline 2024-12-06 12:48:06 +02:00
Protesilaos Stavrou d6e94118da
Disambiguate denote-journal-extras-keyword to placate the compiler 2024-12-05 18:02:44 +02:00
Protesilaos Stavrou 259c8caac6
Make denote-journal-extras--filename-date-regexp more robust
We want it to work when the journal files are inside a directory and
we also need it to account for variations of denote-file-name-components-order.

Thanks to Samuel Flint for informing me about the previous
implementation not working inside of a journal subdirectory. This was
done in issue 485: <https://github.com/protesilaos/denote/issues/485>.
2024-12-05 18:00:00 +02:00
Protesilaos Stavrou 5c8a38bf46
Tweak denote-org-extras--parse-rx to use rx-to-string 2024-12-04 17:56:50 +02:00
Protesilaos Stavrou de786b5e8f
Define helper function to parse rx
This has the benefit of extending support for the 'rx' syntax to the
:not-regexp parameter. In principle, this syntax should be available
for all user-facing regular expressions of the dblocks.
2024-12-04 14:18:31 +02:00
Protesilaos Stavrou d6b3269a17
Merge branch 'not-regexp' 2024-12-04 14:10:05 +02:00
Protesilaos Stavrou fba0bb2650
Document the :not-regexp parameter of the Org dynamic blocks 2024-12-04 14:09:10 +02:00
Protesilaos Stavrou a703f2b686
Implement WORK-IN-PROGRESS support for :not-regexp to omit files in Org dynamic blocks 2024-12-03 10:51:21 +02:00
Protesilaos Stavrou 89a6f7c8c2
Fix bug to make denote-sort-dired exclude files matching regexp (see a701764) 2024-12-03 10:35:16 +02:00
Protesilaos Stavrou 821095844c
Clarify the wording about default behaviour of denote-sort-dired command 2024-12-03 10:30:24 +02:00
Protesilaos Stavrou 4205708b2c
Document in the manual denote-sort-dired-extra-prompts new exclude-regexp symbol 2024-12-03 10:26:04 +02:00
Protesilaos Stavrou 7f4a66d802
Mention the denote-zettel-interface package by Kristoffer Balintona 2024-12-03 10:18:43 +02:00
Protesilaos Stavrou 663e6e0206
Document denote-directory-files EXCLUDE-REGEXP in the manual 2024-12-03 08:10:08 +02:00
Protesilaos Stavrou a701764b0e
Start implementing not-regexp feature to exclude those files 2024-12-03 07:43:36 +02:00
Protesilaos Stavrou a1eff10474
Merge pull request #486 from EFLS/main
fix org dblock definition of missing-links
2024-12-02 15:05:26 +02:00
Elias Storms 3a56c5196e fix org dblock definition of missing-links
The defining function mentioned the wrong function.
2024-12-02 13:20:40 +01:00
Protesilaos Stavrou 0f11e93f25
Add user option denote-open-link-function for non-Org buffers 2024-11-26 11:52:44 +02:00
Protesilaos Stavrou bf07d3f075
Merge pull request #484 from jeanphilippegg/denote-rename-file-using-front-matter
Small fixes, `denote-rename-file-using-front-matter` and signature line only when there is a value
2024-11-26 11:43:01 +02:00
Jean-Philippe Gagné Guay 6caa664518 Remove reference to denote-link-add-links 2024-11-23 11:03:37 -05:00
Jean-Philippe Gagné Guay 1f123e1440 Remove lines with empty values in denote--format-front-matter 2024-11-23 11:03:37 -05:00
Jean-Philippe Gagné Guay e8e97ccaa8 Add denote-front-matter-components-present-even-if-empty-value
It replaces denote-always-include-all-front-matter-lines.
2024-11-23 11:03:37 -05:00
Jean-Philippe Gagné Guay 9426f780e4 Move code in denote--rename-file 2024-11-23 11:03:37 -05:00
Jean-Philippe Gagné Guay 0792229eed Fix issue in denote-rewrite-front-matter with lines that are unchanged 2024-11-23 11:03:37 -05:00
Jean-Philippe Gagné Guay cf35f02d47 Fix issue in denote--get-final-components-for-rewrite
Calling push on sublist does not work on the first iteration of the
loop.
2024-11-23 11:03:37 -05:00
Jean-Philippe Gagné Guay 86c19b4114 Rework denote-rename-file-using-front-matter to handle all components 2024-11-23 11:03:37 -05:00
Protesilaos Stavrou 66124eb234
Update the wishlist to remove what we have already done 2024-11-23 11:19:25 +02:00
Protesilaos Stavrou 557a7b63b7
Tweak the denote-journal-extras-keyword doc string 2024-11-23 10:48:08 +02:00
Protesilaos Stavrou 812bec4027
Document denote-journal-extras-keyword support for list value
This was contributed by Octavian in pull request 483:
<https://github.com/protesilaos/denote/pull/483>. The change is within
the allowed ~15 line limite, meaning that Octavian does not need to
assign copyright to the Free Software Foundation.
2024-11-23 10:46:33 +02:00
Protesilaos Stavrou bd82f0aed7
Merge pull request #483 from cosmicz/journal-multiple-keywords
Add multiple keywords option for journal
2024-11-23 10:39:02 +02:00
Protesilaos Stavrou 9a9d858842
Merge pull request #482 from brabalan/fix-alias
fix obsolete alias
2024-11-23 10:32:24 +02:00
Octavian c954e49482 Add multiple keywords option for journal 2024-11-22 14:37:48 -08:00
Alan Schmitt 03dc441457 fix obsolete alias 2024-11-21 10:56:27 +01:00
Protesilaos Stavrou 12a77a382e
WRONG BRANCH! Revert "Define WORK-IN-PROGRESS file type with Obsidian-style front matter"
This reverts commit 2efd133a29.

I wanted to push this to a branch. Reverting it on main.
2024-11-20 12:07:37 +02:00
Protesilaos Stavrou 2efd133a29
Define WORK-IN-PROGRESS file type with Obsidian-style front matter
This does not work yet for common actions like renaming the file based
on its front matter. I will continue testing how viable this is and if
it is worth pursuing. I do not want to make the code more complex to
accommodate this use-case, so let's see how it goes.
2024-11-20 12:05:28 +02:00
Protesilaos Stavrou bd1fc0b39e
Change the dummy regexp for front matter retrieval to something more self-evident
This was originally contributed by Jean-Philippe Gagné Guay in pull
request 480: <https://github.com/protesilaos/denote/pull/480>. The
idea is to use this regular expression which will 99% not exist in a
file to handle the case where the user does not want to get the value
of the given entry. The alternative would be to rewrite more parts of
the code, so this feels safer and is easier.
2024-11-20 11:51:41 +02:00
Protesilaos Stavrou ad7a102116
Use denote-get-link-description instead of denote--link-get-description in denote-org-extras.el 2024-11-18 08:37:34 +02:00
Protesilaos Stavrou ef033a5084
Fix mistake made by the previous commit 2024-11-18 08:35:48 +02:00
Protesilaos Stavrou 73571a65fb
Reindent files 2024-11-18 08:35:10 +02:00
Protesilaos Stavrou 45f3eef294
Merge pull request #480 from jeanphilippegg/features-and-fix
Signatures in front matter, change id/date and bug fix
2024-11-18 08:31:21 +02:00
Jean-Philippe Gagné Guay ef93ebd781 Fix docstring of denote--keywords-value-function 2024-11-16 01:01:00 -05:00
Jean-Philippe Gagné Guay 51fa48dcd7 Add denote-rename-file-date 2024-11-16 01:01:00 -05:00
Jean-Philippe Gagné Guay e6656d4fc2 Make it possible to change the date/id of a note 2024-11-16 01:01:00 -05:00
Jean-Philippe Gagné Guay 3d8e575260 Add default values to denote--*-key-regexp functions 2024-11-16 01:00:53 -05:00
Jean-Philippe Gagné Guay 3026f6ada5 Add signature to front matter 2024-11-15 22:01:05 -05:00
Jean-Philippe Gagné Guay 0cc5f450d7 Fix regression when renaming new unsaved note 2024-11-15 21:51:32 -05:00
Protesilaos Stavrou 7c8ed195d8
Note that new README wording about denote-rewrite-front-matter is part of development 2024-11-14 11:04:07 +02:00
Protesilaos Stavrou 8fd623577a
Merge pull request #479 from jeanphilippegg/denote-rewrite-front-matter
Refactored `denote-rewrite-front-matter`
2024-11-14 11:02:25 +02:00
Protesilaos Stavrou 16fcac16ca
Merge pull request #478 from jeanphilippegg/fix-denote-rename-file
Fix denote-rename-file when called from lisp
2024-11-11 08:20:42 +02:00
Jean-Philippe Gagné Guay 25cf2f831c Refactor denote-rewrite-front-matter
Also add denote-always-include-all-front-matter-lines
2024-11-10 23:21:57 -05:00
Jean-Philippe Gagné Guay ebc31ee731 Handle keep-current for date in denote-rename-file 2024-11-10 14:32:30 -05:00
Jean-Philippe Gagné Guay 67bef2d964 Move code to denote-rename-file 2024-11-10 14:02:57 -05:00
Jean-Philippe Gagné Guay d55e14afb6 Add denote--get-component-key-regexp-function 2024-11-10 11:25:52 -05:00
Jean-Philippe Gagné Guay bf5969cbe8 Change parameters order in denote--add-front-matter 2024-11-10 10:17:28 -05:00
Jean-Philippe Gagné Guay 8fdb4105d9 Remove unused denote--id-exists-p 2024-11-10 10:06:20 -05:00
Protesilaos Stavrou e5b574ec87
Add development note for some symbols in the manual
Those were changed by Jean-Philippe Gagné Guay in pull request 476:
<https://github.com/protesilaos/denote/pull/476>.
2024-11-10 07:58:01 +02:00
Protesilaos Stavrou 344e1a65bb
Merge pull request #476 from jeanphilippegg/date-functions
Cleanup of date handling function and more
2024-11-10 07:27:11 +02:00
Jean-Philippe Gagné Guay 75d4ba1f7e Do not add an empty identifier in denote--used-ids 2024-11-09 23:23:56 -05:00
Jean-Philippe Gagné Guay 427ebfed8e Add date parameter to denote--add-front-matter 2024-11-09 23:23:56 -05:00
Jean-Philippe Gagné Guay 722c1f3934 Add variable denote-generate-identifier-automatically 2024-11-09 23:23:56 -05:00
Jean-Philippe Gagné Guay 4a2caa43ef Handle id in denote--creation-prepare-note-data
Also make sure that the date is derived from the id even if
denote--find-first-unused-id is called.
2024-11-09 23:23:56 -05:00
Jean-Philippe Gagné Guay 8b005edd2d Make some front matter functions ready to handle nil dates and empty identifiers 2024-11-09 23:23:56 -05:00
Jean-Philippe Gagné Guay 8f8026bf56 Change denote and denote-org-capture to make them ready to handle empty identifiers 2024-11-09 23:23:56 -05:00
Jean-Philippe Gagné Guay 5e21143e22 Update docstring of denote-format-file-name 2024-11-09 23:23:56 -05:00
Jean-Philippe Gagné Guay 9d13ef9082 Allow identifiers with other formats in denote-format-file-name 2024-11-09 23:23:56 -05:00
Jean-Philippe Gagné Guay b0b19b9ad1 Allow empty identifier in denote-format-file-name 2024-11-09 23:23:56 -05:00
Jean-Philippe Gagné Guay 89b0525475 Do not check nil identifier in denote-format-file-name 2024-11-09 23:23:56 -05:00
Jean-Philippe Gagné Guay 19164364a8 Obsolete denote-create-unique-file-identifier 2024-11-09 23:23:50 -05:00
Jean-Philippe Gagné Guay a204554b8d denote-get-identifier returns an empty string when date is nil
Also make the date parameter mandatory
2024-11-08 22:58:14 -05:00
Jean-Philippe Gagné Guay a5ecae13cf Obsolete denote-parse-date 2024-11-08 22:29:33 -05:00
Jean-Philippe Gagné Guay 7cd1461e4b Add comment in denote-valid-date-p 2024-11-08 22:09:16 -05:00
Jean-Philippe Gagné Guay b2ddfc0d3a Rename denote--date to denote--format-front-matter-date 2024-11-08 22:03:51 -05:00
Jean-Philippe Gagné Guay cf4ce27580 Do not check identifier format in retrieval functions of file name components 2024-11-08 22:00:22 -05:00
Protesilaos Stavrou b788f7c3d7
Expand denote-md-extras.el to support conversion from/to Obsidian links
Thanks to hyperfocus1337 for discussing this with me and testing my
prototypes in issue 475: <https://github.com/protesilaos/denote/issues/475>.
2024-11-07 10:44:41 +02:00
Protesilaos Stavrou 0daf97be00
Make denote-link-description-format accept %T for file name title only 2024-11-06 10:48:00 +02:00
Protesilaos Stavrou 991b2fece2
Make denote-rename-buffer-format accept %T for file name title only 2024-11-06 10:47:39 +02:00
Protesilaos Stavrou 3d0c6d8b43
Remove needless outline in denote-md-extras.el 2024-11-06 10:44:01 +02:00
Protesilaos Stavrou bbd75dd2f3
Make denote-title-prompt prepopulate the minibuffer if denote-title-prompt-current-default
This makes it easier to edit the text after calling 'denote-open-or-create' (and related).
We do not want to skip the title prompt completely, because the user
may not necessarily search for a file using a query that is a
perfectly valid title. For example, with the 'orderless' package set
up, they may type "title test" to match "This is a test title".
2024-11-05 08:00:31 +02:00
Protesilaos Stavrou d42be4ee79
Make stylistic change in denote-select-linked-file-prompt 2024-11-04 12:47:30 +02:00
Protesilaos Stavrou 170a8234ae
Merge pull request #473 from jeanphilippegg/link-descriptions
Link descriptions
2024-11-04 07:51:27 +02:00
Jean-Philippe Gagné Guay 18e8bb9ece Add denote-link-description-with-signature-and-title and use it as the default 2024-11-03 11:30:43 -05:00
Protesilaos Stavrou a05ed292bf
Clarify denote-test--denote--format-front-matter doc string 2024-11-03 17:28:11 +02:00
Jean-Philippe Gagné Guay 90c08c1693 Remove ignore-region parameter from denote-get-link-description 2024-11-03 09:58:56 -05:00
Protesilaos Stavrou 8eae1c9e97
Merge branch 'link-description-format' 2024-11-03 11:51:06 +02:00
Protesilaos Stavrou 0ce0702158
Deprecate denote-link-description-function and replace it with denote-link-description-format (check FIXME) 2024-11-03 11:50:21 +02:00
Protesilaos Stavrou 0ea4d88a59
Merge pull request #472 from jeanphilippegg/front-matter-functions
Small cleanup of the front matter functions
2024-11-03 09:17:52 +02:00
Jean-Philippe Gagné Guay 4fdae80128 Refactor denote-rename-file-using-front-matter 2024-11-02 01:13:31 -04:00
Jean-Philippe Gagné Guay 512672e173 Add signature parameter to denote--add-front-matter 2024-11-02 01:13:31 -04:00
Jean-Philippe Gagné Guay 7ccddb5837 Add signature parameter to denote--format-front-matter 2024-11-02 01:13:26 -04:00
Jean-Philippe Gagné Guay bd50fbba94 Remove denote--front-matter-{title/keywords} functions 2024-11-02 00:15:11 -04:00
Jean-Philippe Gagné Guay 4cd24c9730 Format identifier in denote--format-front-matter 2024-11-02 00:15:11 -04:00
Jean-Philippe Gagné Guay 6446650c36 Make date parameter a date object in denote--format-front-matter 2024-11-02 00:15:04 -04:00
Jean-Philippe Gagné Guay f0908dbcc1 Remove denote--get-{title/keywords}-line-from-front-matter functions 2024-11-01 22:38:30 -04:00
Jean-Philippe Gagné Guay af2e6a33a3 Add denote--retrieve-front-matter-*-from-content functions 2024-11-01 21:31:17 -04:00
Protesilaos Stavrou f3ac69fcd3
Clarify the type of a symbol in a doc string to placate the byte compiler 2024-10-31 11:11:28 +02:00
Protesilaos Stavrou bbf62a9e89
Define denote-dired-link-marked-notes as alias for denote-link-dired-marked-notes 2024-10-28 10:07:46 +02:00
Protesilaos Stavrou 42151dc6f4
Merge pull request #470 from jeanphilippegg/retrieval-functions
Add missing public front matter retrieval functions
2024-10-27 09:32:28 +02:00
Jean-Philippe Gagné Guay ba2bd253bb Add missing public front matter retrieval functions 2024-10-26 23:43:59 -04:00
Protesilaos Stavrou 1659babc61
Make denote-get-path-by-id not fail on denote-get-path-by-id nil value 2024-10-26 09:43:38 +03:00
Protesilaos Stavrou 0446f242db
Make denote-org-extras "convert" link commands save-excursion 2024-10-26 09:43:17 +03:00
Protesilaos Stavrou 331918bdbd
Add denote-md-extras.el with two commands for link conversion 2024-10-26 09:33:31 +03:00
Protesilaos Stavrou 9f58b5ad24
Acknowledge sarcom-sar for the discussion leading to commit 3517ba2
This was done in issue 467: <https://github.com/protesilaos/denote/issues/467>.

The commit is by Jean-Philippe Gagné Guay, which was done in pull
request 468: <https://github.com/protesilaos/denote/pull/468>.
2024-10-26 08:29:16 +03:00
Protesilaos Stavrou 3517ba27d4
Merge pull request #468 from jeanphilippegg/retrieval-functions
Add remaining front matter retrieval functions
2024-10-26 08:21:51 +03:00
Protesilaos Stavrou b074312826
Define denote-link-description-format option and update denote-link-description-function 2024-10-26 08:06:22 +03:00
Protesilaos Stavrou 75aebe6b41
Say "user option" instead of "variable" in denote-org-extras-extract-org-subtree doc 2024-10-26 08:00:48 +03:00
Protesilaos Stavrou 6395ec7e95
Make small stylistic change to denote-org-extras-extract-org-subtree
We have this pattern right below, so better be consistent.
2024-10-26 07:28:06 +03:00
Protesilaos Stavrou 998ee2aa1b
Make denote-org-extras "convert" link functions print a count 2024-10-26 07:05:11 +03:00
Protesilaos Stavrou c4fdf97055
Remove outdated TODO in denote-org-extras
We do not need to account for other link types. If someone has a
use-case, then we shall reconsider.
2024-10-26 06:59:07 +03:00
Jean-Philippe Gagné Guay acad7c3577 Do not check type in denote-format-string-for-{org/md}-front-matter 2024-10-25 23:37:57 -04:00
Protesilaos Stavrou 6c1ceaf7c7
Simplify keyword retrieval in denote-rename-buffer--format 2024-10-26 06:23:54 +03:00
Protesilaos Stavrou 614fa7e50f
Fix typo in denote-rename-buffer-format doc string 2024-10-26 06:22:19 +03:00
Jean-Philippe Gagné Guay b69736209c Add remaining front matter retrieval functions 2024-10-25 22:23:21 -04:00
Protesilaos Stavrou 3b18256bea
Switch to if-let* and when-let* everywhere because Emacs 31 deprecates the others 2024-10-24 16:30:53 +03:00
Protesilaos Stavrou 8f68937926
Make stylistic change to denote-link-ol-export
Since we are using pcase and friends in various places, let us have it
here as well for the sake of consistency.
2024-10-24 08:27:43 +03:00
Protesilaos Stavrou b9272f8a1e
Use pcase-let* in denote-link-ol-export
This is just a stylistic change. We are using pcase-let* elsewhere, so
it is better to be consistent.
2024-10-22 10:29:40 +03:00
Protesilaos Stavrou 04fddd1bb7
Merge pull request #466 from jeanphilippegg/fix-regression
Fix regression caused by commit 4db0214
2024-10-22 08:31:24 +03:00
Jean-Philippe Gagné Guay d99d276eba Fix regression caused by commit 4db0214 2024-10-21 20:04:58 -04:00
Protesilaos Stavrou 7dc184ab3d
Merge pull request #464 from jeanphilippegg/some-fixes
Some cleanup and fix `denote-link-dired-marked-notes`
2024-10-21 09:37:34 +03:00
Jean-Philippe Gagné Guay cb3cfd3e3e Rename denote-link--buffer-prompt to denote-link--buffer-file-prompt 2024-10-20 19:56:32 -04:00
Jean-Philippe Gagné Guay 57c604461c Make denote-link--buffer-prompt return absolute paths 2024-10-20 19:32:05 -04:00
Jean-Philippe Gagné Guay 6537d155f4 Use denote-link--insert-links in denote-link-dired-marked-notes 2024-10-20 19:03:39 -04:00
Jean-Philippe Gagné Guay 07a814189e Remove condition in denote-link--map-over-notes
If one open the parent of denote-directory in Dired and use "i" on the
denote-directory, the notes of this subdirectory will be listed in the current
Dired buffer. The user can mark them and call denote-link-dired-marked-notes.
Previously, this would fail because the current Dired buffer is not in
denote-directory.
2024-10-20 18:51:55 -04:00
Jean-Philippe Gagné Guay 4db0214d30 Do not check for nil parameter in denote--dir-in-denote-directory-p 2024-10-20 18:50:37 -04:00
Protesilaos Stavrou f764fac933
Make denote-org-extras-extract-org-subtree work with denote-kill-buffers
This is the same as with commit 244472f. Discussed in issue 460:
<https://github.com/protesilaos/denote/issues/460>.
2024-10-20 16:51:39 +03:00
Protesilaos Stavrou 244472f506
Make the 'denote' command kill buffers after running denote-after-new-note-hook
Otherwise it kills the buffer too early.

Thanks to hapst3r for reporting this problem and to Jean-Philippe
Gagné Guay for contributing to the discussion about how best to
approach this. Done in issue 460:
<https://github.com/protesilaos/denote/issues/460>.
2024-10-20 16:47:08 +03:00
Protesilaos Stavrou f86e3aaff0
Merge pull request #462 from brabalan/rename-buffer
allow nil type in denote-rename-buffer--format
2024-10-16 17:07:07 +03:00
Alan Schmitt 1c2b6ef87b allow nil type in denote-rename-buffer--format 2024-10-16 14:43:18 +02:00
Protesilaos Stavrou 86e3b4e692
Merge pull request #457 from grtcdr/main
Fix unused let-bound variable warnings
2024-10-16 10:36:30 +03:00
grtcdr aaaa5dd129
Fix unused let-bound variable warnings 2024-10-11 11:33:56 +01:00
Protesilaos Stavrou 19f6aaf0b1
Make denote-add-front-matter default to file title and keywords 2024-10-11 13:19:51 +03:00
Protesilaos Stavrou ed0eb4aea2
Acknowledge Aziz for commit 7793135
This was done in pull request 456: <https://github.com/protesilaos/denote/pull/456>.
The change is small, meaning that Aziz does not need to assign
copyright to the Free Software Foundation.
2024-10-11 07:56:29 +03:00
Protesilaos Stavrou f1fb51d199
Merge pull request #456 from grtcdr/master
Remove redundant "Denote" item from denote--menu-contents
2024-10-11 07:55:37 +03:00
grtcdr 7793135139
Remove redundant "Denote" item from denote--menu-contents 2024-10-10 22:51:59 +01:00
Protesilaos Stavrou 9d3b6cb8f6
Add missing warning about development code for commit 960a4c1 2024-10-10 09:27:15 +03:00
Protesilaos Stavrou 960a4c143d
Document how to use denote-journal-extras with org-capture
Thanks to Cosmin-Octavian C for providing the sample code in issue
437: <https://github.com/protesilaos/denote/issues/437>. Also thanks
to Samuel Flint for suggesting such a feature and discussing the issue.
2024-10-10 09:22:25 +03:00
Protesilaos Stavrou 017b3d766f
Autoload denote-journal-extras-path-to-new-or-existing-entry
It can be called from an org-capture template, so it makes sense to
have it this way.
2024-10-10 09:15:53 +03:00
Protesilaos Stavrou 2a56bc592c
Use the correct prefix for denote-journal-extras-path-to-new-or-existing-entry
Thanks to Cosmin-Octavian C and Samuel Flint for discovering this in
issue 437: <https://github.com/protesilaos/denote/issues/437>.
2024-10-10 09:01:24 +03:00
Protesilaos Stavrou 4b9a37d5d7
Reword some statements of the denote-org-store-link-to-heading docs 2024-10-09 09:10:01 +03:00
Protesilaos Stavrou 6497c251fc
Merge branch 'org-context-links-for-headings' 2024-10-09 09:03:36 +03:00
Protesilaos Stavrou 855c06e3db
Merge pull request #453 from jeanphilippegg/sluggification-bug
Fix issue reported in #435
2024-10-07 08:49:24 +03:00
Jean-Philippe Gagné Guay e8e1eb48d2 Put hyphen last in character alternative 2024-10-05 23:53:37 -04:00
Protesilaos Stavrou 0d2167c108
Merge pull request #451 from brabalan/journal_path_v2
make denote-journal-extra-path-to-new-or-existing-entry create a missing entry
2024-10-04 12:50:13 +03:00
Alan Schmitt 62d2dfb22d tweak denote-journal-extra-path-to-new-or-existing-entry
create the path if it is not present
2024-10-01 16:48:41 +02:00
Protesilaos Stavrou df6a416db1
Update sample code to use full paths to subdirectories 2024-09-26 10:01:41 +03:00
Protesilaos Stavrou eb40d6d056
Fix bug in denote-org-extras--get-file-id-and-heading-id-or-context to return heading-id
Thanks to jarofromel for testing the work-in-progress feature and
providing feedback in issue 438: <https://github.com/protesilaos/denote/issues/438>.
2024-09-26 09:52:01 +03:00
Protesilaos Stavrou ce75c1ed49
Fix regression in denote-get-identifier-at-point caused by commit 23bc9db
Thanks to Alan Schmitt for noting that the function had stopped
working. This was done in issue 449:
<https://github.com/protesilaos/denote/issues/449>.
2024-09-26 08:07:59 +03:00
Protesilaos Stavrou 4c0c637387
Rename helper function to denote-org-extras--get-file-id-and-heading-id-or-context
Update its documentation to describe what it is doing right now.
2024-09-23 13:50:23 +03:00
Protesilaos Stavrou 57e2bef9a6
Refactor denote-org-extras--get-file-id-and-heading-id 2024-09-23 13:43:37 +03:00
Protesilaos Stavrou 085ed94841
Simplify denote-org-extras--get-backlinks-for-heading
It should only search for what we pass to it. This way we keep the
special cases to fewer functions, making things more manageable.
2024-09-23 13:42:46 +03:00
Protesilaos Stavrou 8d796be07f
Make denote-link-ol-store prioritise CUSTOM_ID even if context is preferred
This was always the desired behaviour. Thanks to jarofromel for
pointing out the inconsistency in issue 438: <https://github.com/protesilaos/denote/issues/438>.
2024-09-23 12:51:27 +03:00
Protesilaos Stavrou c77959afe4
Note that users may not need org-capture as convenience commands are easy 2024-09-23 08:59:28 +03:00
Protesilaos Stavrou 2dd21d24d7
Update and expand the documentation of "Write your own convenience commands" 2024-09-23 08:57:12 +03:00
Protesilaos Stavrou 31abe41a4b
Reword and refine the documentation about the org-capture integration 2024-09-23 08:45:12 +03:00
Protesilaos Stavrou d7301e08e1
Document how to use org-capture with specific values
I am writing this in response to the question raised by jtpavlock in
discussion 448: <https://github.com/protesilaos/denote/discussions/448>.
2024-09-23 08:43:32 +03:00
Protesilaos Stavrou 6a67534820
Clarify a doc string in denote-test.el 2024-09-22 08:08:32 +03:00
Protesilaos Stavrou 731a5dc2e8
Merge pull request #447 from jeanphilippegg/revert-file-truename
Revert "Use file-truename in denote-filename-is-note-p and denote--di…
2024-09-22 07:49:34 +03:00
Jean-Philippe Gagné Guay 8f2abe4831 Revert "Use file-truename in denote-filename-is-note-p and denote--dir-in-denote-directory-p"
This reverts commit 5fade0cfac.
2024-09-21 08:26:46 -04:00
Protesilaos Stavrou 4e2aabe4d2
Define a more discoverable alias for denote-extract-keywords-from-path 2024-09-21 10:49:17 +03:00
Protesilaos Stavrou 68c296d6a9
Escape the asterisk for context links to make xref/backlinks work properly 2024-09-21 10:24:51 +03:00
Protesilaos Stavrou 8d7fd0a260
Fix denote-org-extras-link-to-heading to always work with context links
Thanks to jarofromel for testing the prototype and identifying the
flaws therein. This was done in issue 438:
<https://github.com/protesilaos/denote/issues/438>.
2024-09-21 10:08:02 +03:00
Protesilaos Stavrou 3065209054
Merge pull request #445 from jeanphilippegg/file-truename
Use file-truename to handle symbolic links (issue #439)
2024-09-21 09:49:56 +03:00
Protesilaos Stavrou 422af65ae0
Merge pull request #444 from jeanphilippegg/move-code
Move code
2024-09-21 09:45:47 +03:00
Jean-Philippe Gagné Guay 60e208fab6 Remove comment about the possibility of regenerating link descriptions when renaming 2024-09-20 21:05:52 -04:00
Jean-Philippe Gagné Guay 827177d2e9 Move keep-current parameter handling from denote--rename-file to denote-rename-file 2024-09-20 21:05:46 -04:00
Jean-Philippe Gagné Guay 5fade0cfac Use file-truename in denote-filename-is-note-p and denote--dir-in-denote-directory-p 2024-09-20 20:28:11 -04:00
Protesilaos Stavrou 0377530250
Fix typo in doc string 2024-09-20 14:41:07 +03:00
Protesilaos Stavrou 3694b19cd3
Untabify and reindent the main file 2024-09-20 14:31:48 +03:00
Protesilaos Stavrou cd6bfb03fa
Make stylistic change to denote-link--buffer-prompt 2024-09-20 14:30:55 +03:00
Protesilaos Stavrou 09e4c6692f
Placate the compiler about 'denote-file-type' 2024-09-20 14:30:05 +03:00
Protesilaos Stavrou 433422758a
Tweak denote-journal-extra-path-to-new-or-existing-entry
This builds on top of commit 126238c by Alan Schmitt, which was done
in pull request 443: <https://github.com/protesilaos/denote/pull/443>.
The change extracts the code we had in a function into a separate
function, though Alan has anyway assigned copyright to the Free
Software Foundation.
2024-09-20 14:19:59 +03:00
Protesilaos Stavrou 1ddf6787dc
Merge branch 'main' of github.com:protesilaos/denote 2024-09-20 14:15:02 +03:00
Protesilaos Stavrou ee2d92859e
Merge pull request #443 from brabalan/denote-journal-extra-path-to-new-or-existing-entry
add `denote-journal-extra-path-to-new-or-existing-entry'
2024-09-20 14:14:39 +03:00
Alan Schmitt 126238c9c1 add `denote-journal-extra-path-to-new-or-existing-entry'
This function returns the path to a journal entry with the given date,
or nil if there is none.

Refactored `denote-journal-extras-new-or-existing-entry' and
`denote-journal-extras-link-or-create-entry' to use it.
2024-09-20 11:33:14 +02:00
Protesilaos Stavrou 7ddff697fc
Make a sample code a bit more robust 2024-09-20 11:38:29 +03:00
Protesilaos Stavrou 7fd4160a99
Remove an empty line 2024-09-20 11:38:18 +03:00
Protesilaos Stavrou dcd92c4ac6
Document how to list empty/non-empty files in a Dired buffer
Thanks to Wilf for suggesting this idea in issue 423:
<https://github.com/protesilaos/denote/issues/423>.
2024-09-18 17:16:14 +03:00
Protesilaos Stavrou d7cafd2427
Clarify comment about the face of 'denote-link-backlink-button' 2024-09-18 16:23:46 +03:00
Protesilaos Stavrou 33f7e73a5d
Use format-prompt in denote--subdirs-completion-table 2024-09-18 16:17:39 +03:00
Protesilaos Stavrou 3f770c67d4
Make denote-directory stand out more in denote-file-prompt 2024-09-18 16:03:24 +03:00
Protesilaos Stavrou 1b9a7df31b
Fix bug in denote-org-capture which ignored DATE in the front matter 2024-09-18 08:26:48 +03:00
Protesilaos Stavrou 58b3dc2d17
Make denote-org-store-link-to-heading accept option for context links
I am providing this option in response to the request from jarofromel
in issue 438: <https://github.com/protesilaos/denote/issues/438>.
2024-09-17 13:52:05 +03:00
Protesilaos Stavrou 48e8949e31
Use 'if' instead of 'cond' for the new denote-filetype-heuristics
This follow from commit c041878 by Jean-Philippe Gagné Guay, which was
done in pull request 436: <https://github.com/protesilaos/denote/pull/436>.
2024-09-16 10:12:36 +03:00
Protesilaos Stavrou 36663f5bae
Merge pull request #436 from jeanphilippegg/denote-file-type-function
Add denote-file-type function
2024-09-16 10:09:00 +03:00
Protesilaos Stavrou 898d75d843
Merge pull request #435 from jeanphilippegg/denote-slug-functions
Clean sluggification functions
2024-09-16 10:07:14 +03:00
Jean-Philippe Gagné Guay c041878177 Add denote-file-type function 2024-09-13 22:26:08 -04:00
Jean-Philippe Gagné Guay 68e31fdb87 Make slug functions public and remove some options and functions 2024-09-13 21:56:25 -04:00
Protesilaos Stavrou 55660d82e0
Update sources for my tmr package 2024-09-13 10:06:08 +03:00
Protesilaos Stavrou b9bfd405a4
Update source link to point to GitHub 2024-09-13 10:05:14 +03:00
Protesilaos Stavrou 468fc7c52c
Add section with custom code for meeting notes
Thanks to Kosta Harlan for discussing this workflow with me. This was
done via a private channel and I am sharing this information with
permission.
2024-09-13 08:20:52 +03:00
Protesilaos Stavrou 51a397ce8a
Clarify that commit 71194be depends on the current development target 2024-09-12 17:58:10 +03:00
Protesilaos Stavrou 71194be24a
Document custom commands to switch to a silo
Thanks to IceAsteroid for suggesting this in issue 432:
<https://github.com/protesilaos/denote/issues/432>.
2024-09-12 17:57:07 +03:00
Protesilaos Stavrou d47e0df0a5
Add check that SILO is among denote-silo-extras-directories
This way, we do not operate on arbitrary paths. Users can still do
that with custom code, though it is better for us to focus on the
intent of the code.
2024-09-12 17:46:44 +03:00
Protesilaos Stavrou fc00f1469b
Document sample code on how to auto rename a Denote file
I helped Lukas C. Bossert figure this out in discussion 430 and am
documenting it in case other users have a need for it:
<https://github.com/protesilaos/denote/discussions/430>.
2024-09-09 10:02:44 +03:00
Protesilaos Stavrou 4e7b4a9617
Write top-level heading for packages that build on Denote 2024-09-09 09:56:18 +03:00
Protesilaos Stavrou efc7ef5e2e
Note that those who use a custom grep may prefer consult instead 2024-09-09 09:50:16 +03:00
Protesilaos Stavrou 3226846c0e
Correct a heading in the manual 2024-09-09 09:50:07 +03:00
Protesilaos Stavrou 23bc9dbca3
Define :help-echo function for Org links
Thanks to Julian Hoch for asking about this. It was done via a private
channel and I am sharing the information with permission.
2024-09-09 09:05:54 +03:00
Protesilaos Stavrou d5cf6222d5
Make a small rewording to the manual 2024-09-09 08:11:18 +03:00
Protesilaos Stavrou 8ac9defa14
Merge pull request #429 from jeanphilippegg/optional-parameters
Make denote-rename-file parameters non-optional
2024-09-09 08:09:20 +03:00
Jean-Philippe Gagné Guay a45d62a64a Use denote-retrieve-title-or-filename in denote--rename-file 2024-09-08 11:03:18 -04:00
Jean-Philippe Gagné Guay 18f92264db Make parameters of denote--rename-file accept a keep-current symbol 2024-09-08 10:42:48 -04:00
Jean-Philippe Gagné Guay ffbb55bbff Make denote-rename-file parameters non-optional 2024-09-07 22:41:13 -04:00
Protesilaos Stavrou 3bb05f212c
Update to Denote version 3.1.0 2024-09-04 11:31:56 +03:00
Protesilaos Stavrou 001fe15eec
Document the command denote-backlinks-toggle-context 2024-09-04 09:59:40 +03:00
Protesilaos Stavrou e33890300a
Fix some spacing issues with the denote-rename-buffer formatting 2024-09-04 09:44:53 +03:00
Protesilaos Stavrou 1df7c9d8a4
Prepend a liteal "[D]" to denote-rename-buffer-format
I have been using this for a long time now and I think it is a good default.
2024-09-04 09:38:18 +03:00
Protesilaos Stavrou aea9ebb32f
Add TODO for denote--file-has-backlinks-p 2024-09-04 08:24:11 +03:00
Protesilaos Stavrou 717e41d683
Use correct samples for non-ASCII in slugs
Thanks to Jean-Philippe Gagné Guay for pointing out my mistake in
issue 420: <https://github.com/protesilaos/denote/issues/420>.
2024-09-04 07:05:49 +03:00
Protesilaos Stavrou 7743d02042
Add TODO for after version 3.1.0 (which is coming soon) 2024-09-03 14:27:54 +03:00
Protesilaos Stavrou 1975648e39
Document denote-slug-keep-only-ascii in the manual 2024-09-03 14:24:02 +03:00
Protesilaos Stavrou 5180991464
Document custom functions to sluggify by removing non-ASCII characters
Thanks to Jean-Philippe Gagné Guay for commenting on this initiative
in issue 420: <https://github.com/protesilaos/denote/issues/420>.
2024-09-03 14:23:11 +03:00
Protesilaos Stavrou afe2bcaafe
Add test for denote-slug-keep-only-ascii 2024-09-03 14:02:14 +03:00
Protesilaos Stavrou 1a1775acd2
Add function denote-slug-keep-only-ascii 2024-09-03 13:56:39 +03:00
Protesilaos Stavrou 4c5d882f62
Add two more outline headings 2024-09-03 13:56:27 +03:00
Protesilaos Stavrou b600e70857
Fix a typo in denote-kill-buffers
Thanks to Nicolas Semrau for spotting it:
<e7cfd48bd6>.
2024-09-03 12:45:58 +03:00
Protesilaos Stavrou e7cfd48bd6
Document the new user option denote-kill-buffers
This was contributed by Jean-Philippe Gagné Guay in pull request 426:
<https://github.com/protesilaos/denote/pull/426>.
2024-09-03 09:18:57 +03:00
Protesilaos Stavrou 978b120a08
Merge pull request #426 from jeanphilippegg/denote-kill-buffers
Option denote-kill-buffers to automatically kill buffers (issue #413 and #273)
2024-09-03 08:55:40 +03:00
Jean-Philippe Gagné Guay db7df4a948 Add denote-kill-buffers 2024-09-02 22:45:09 -04:00
Protesilaos Stavrou 4d0409d7bb
Merge pull request #425 from bryanrinders/fix-typo-readme.org
Fix typos
2024-09-02 17:44:32 +03:00
bryanrinders 502ee1fcf3
fix typos 2024-09-02 16:09:26 +02:00
Protesilaos Stavrou 4eaa943f1b
Make denote-org-extras--get-backlinks-buffer-name use xrefs with absolute path 2024-09-01 09:28:24 +03:00
Protesilaos Stavrou fb375dc623
Make denote-org-extras--get-backlinks-for-heading check all prerequisites 2024-09-01 09:27:11 +03:00
Protesilaos Stavrou 839d68e8a1
Update all the header information of denote-test.el 2024-09-01 09:26:10 +03:00
Protesilaos Stavrou c66521caeb
Add missing year range to denote-test.el copyright header 2024-09-01 09:25:15 +03:00
Protesilaos Stavrou 87a9e5e731
Fix typo in a comment 2024-09-01 09:21:09 +03:00
Protesilaos Stavrou addff3d4d7
Write tests for denote-identifier-p and denote--id-to-date 2024-09-01 09:19:52 +03:00
Protesilaos Stavrou 7524aa2de8
Define denote-identifier-p function 2024-09-01 09:17:48 +03:00
Protesilaos Stavrou c7ac9752fb
Make denote--id-to-date more strict about the identifier 2024-09-01 09:11:42 +03:00
Protesilaos Stavrou 3ae863f108
Reword the sections about Org dynamic blocks for clarity
I repeat some statemenents because I know how a manual is read: the
user checks only the paragraphs of immediate interest.
2024-08-31 09:32:37 +03:00
Protesilaos Stavrou 75374dc5dd
Add optional :include-date parameter to Org dynamic blocks that show links to files
Thanks to Sergio Rey for describing this idea to me. This was done via
a private channel and this information is shared with permission.
2024-08-31 09:31:54 +03:00
Protesilaos Stavrou 4651362642
Make denote--file-type-org-extra-p handle cases like org-tree-to-indirect-buffer
Now we can add Denote links in those buffers as well. Whereas before
it would not work, as Denote would not recognise the file type.

Thanks to coherentstate for bringing this matter to my attention in
issue 418: <https://github.com/protesilaos/denote/issues/418>.
2024-08-31 08:59:30 +03:00
Protesilaos Stavrou 51cb3855e3
Merge pull request #419 from jeanphilippegg/denote-link-return-links
Rework denote-link-return-links (fix issue #416)
2024-08-31 07:54:54 +03:00
Jean-Philippe Gagné Guay a6503481f9 Rewrite comment in denote-link--prepare-backlinks 2024-08-30 23:42:11 -04:00
Jean-Philippe Gagné Guay c6b8526486 Make denote-link-return-links more efficient and work in silos 2024-08-30 22:36:36 -04:00
Jean-Philippe Gagné Guay b03b4bf25d Revert "Make denote-find-link work inside of a silo"
This reverts commit df3e090edb.
2024-08-30 22:31:41 -04:00
Protesilaos Stavrou d3e3762fe4
Add optional :this-heading-only parameter for backlinks' Org dynamic block 2024-08-29 07:10:52 +03:00
Protesilaos Stavrou 562c189614
Make denote-org-extras--get-file-id-and-heading-id FILE parameter optional 2024-08-28 19:31:19 +03:00
Protesilaos Stavrou 1386a6339c
Change the default style of the backlinks indicator of denote-rename-buffer-mode 2024-08-28 12:00:59 +03:00
Protesilaos Stavrou df3e090edb
Make denote-find-link work inside of a silo
Thanks to kolmas for reporting the bug in issue 416:
<https://github.com/protesilaos/denote/issues/416>.
2024-08-28 11:27:14 +03:00
Protesilaos Stavrou bc15046785
Remove unused private function denote--file-regular-writable-p 2024-08-26 08:05:04 +03:00
Protesilaos Stavrou 3480421488
Merge pull request #415 from jeanphilippegg/backlinks-buttons
Use absolute file path in denote-link--backlink-find-file
2024-08-26 08:01:15 +03:00
Protesilaos Stavrou 4e2d9c91c9
Merge pull request #414 from jeanphilippegg/rename-readonly-files
Make denote-rename-file-and-buffer work with read-only files
2024-08-26 07:59:45 +03:00
Jean-Philippe Gagné Guay 0aea944616 Use absolute file path in denote-link--backlink-find-file 2024-08-25 22:53:25 -04:00
Jean-Philippe Gagné Guay 0d7098538c Make denote-rename-file-and-buffer work with read-only files 2024-08-25 17:09:47 -04:00
Protesilaos Stavrou eec60330fb
Make org-capture not create CUSTOM_ID for heading if no link is specified
Before, we were creating this unconditionally. Thanks to Jonas
Großekathöfer for bringing this matter to my attention in issue 404:
<https://github.com/protesilaos/denote/issues/404>.
2024-08-04 11:57:02 +03:00
Protesilaos Stavrou 4eceb360a2
Add sample code in the manual to find duplicate identifiers 2024-08-02 09:52:02 +03:00
Protesilaos Stavrou 0e9cec2551
Use the correct symbol for denote-excluded-directories-regexp 2024-08-02 09:30:29 +03:00
Protesilaos Stavrou 354cb2492b
Make corrections to the docs of commit 2fc82bd 2024-08-02 09:28:59 +03:00
Protesilaos Stavrou 2fc82bd292
Add Org dynamic block to insert files as headings 2024-08-02 09:25:57 +03:00
Protesilaos Stavrou 8ad0b816ed
Add three new user options for 'denote-sort-dired' 2024-08-01 10:19:46 +03:00
Protesilaos Stavrou a506f3b364
Make denote-sort-components a defconst 2024-08-01 10:19:30 +03:00
Protesilaos Stavrou 6ea849b1be
Define a fallback comparison function in denote-sort 2024-08-01 10:19:05 +03:00
Protesilaos Stavrou d19a3ce882
Document how to sort Luhmann-style signatures (also see commit f806ed7) 2024-08-01 08:30:32 +03:00
Protesilaos Stavrou f806ed7db0
Add user options for the denote-sort-dired sorting functions per file name component 2024-08-01 08:30:17 +03:00
Protesilaos Stavrou 57b19e10ad
Remove outdated development note 2024-08-01 08:07:53 +03:00
Protesilaos Stavrou 47e619feef
Make denote-rename-file-using-front-matter also read file-at-point in Dired
This makes it consistent with how 'denote-rename-file' works. I am
implementing this in response to issue 401 where Alp Eren Kose assumed
this was the default behaviour: <https://github.com/protesilaos/denote/issues/401>

I think it makes sense to have it this way to avoid such confusion.
Still, it seems easier to edit the file and call 'denote-rename-file-using-front-matter'
directly, rather do an intermediate step through Dired.
2024-07-31 18:59:18 +03:00
Protesilaos Stavrou 7e53ab30b3
Remove reference to function that no longer exists 2024-07-31 17:32:38 +03:00
Protesilaos Stavrou aab124232c
Fix a case in denote-get-identifier-at-point where there are many faces 2024-07-31 17:13:57 +03:00
Protesilaos Stavrou 3ea15caf42
Define denote-get-identifier-at-point function
I am implementing this in response to a question by Alan Schmitt in
issue 400: <https://github.com/protesilaos/denote/issues/400>.
2024-07-31 17:09:04 +03:00
Protesilaos Stavrou 917645b0ec
Make denote--get-link-file-path-at-point accept optional POINT 2024-07-31 11:34:48 +03:00
Protesilaos Stavrou 7183877bd4
Reword the denote--replace-consecutive-token-characters doc string 2024-07-30 13:25:43 +03:00
Protesilaos Stavrou e39827ad30
Update the denote-org-extras Commentary section 2024-07-30 13:25:34 +03:00
Protesilaos Stavrou b5f94b50e1
Add :excluded-dirs-regexp parameter to all dynamic blocks
Thanks to Claudio Migliorelli for discussing this idea with me. It was
done via a private channel and this information is shared with
permission.
2024-07-30 09:38:58 +03:00
Protesilaos Stavrou 753a21a464
Reword the doc string of denote-sort-component-prompt 2024-07-27 12:58:50 +03:00
Protesilaos Stavrou c9de283410
Document a custom denote-region that references the source 2024-07-27 07:20:49 +03:00
Protesilaos Stavrou 1cf20090b3
Tweak the message of denote-backlinks-toggle-context 2024-07-25 17:57:03 +03:00
Protesilaos Stavrou bbde012c4c
Make denote-backlinks-toggle-context produce a message about its state 2024-07-25 17:55:48 +03:00
Protesilaos Stavrou 37c979e428
Amend fix done in commit 8701908 2024-07-25 17:36:04 +03:00
Protesilaos Stavrou 6d2551f2c0
Make denote-backlinks-toggle-context fit the buffer to its window (also see 6d86c76) 2024-07-25 17:25:20 +03:00
Protesilaos Stavrou 6d86c7696c
Tweak the default value of denote-backlinks-display-buffer-action
We do not want to preserve the size, because it inhibits revert-buffer
from fitting the new buffer contents to the window.
2024-07-25 17:24:19 +03:00
Protesilaos Stavrou 8701908e60
Fix denote-link--prepare-backlinks to revert-buffer inside a silo 2024-07-25 17:22:53 +03:00
Protesilaos Stavrou 7f9d040b44
Add FIXME for the denote-link--prepare-backlinks inside of a silo 2024-07-25 13:46:11 +03:00
Protesilaos Stavrou 02d296d8e8
Add command to toggle context in the backlinks buffer
I am not documenting this in the manual for the time being because I
expect it to undergo further changes.
2024-07-25 11:20:26 +03:00
Protesilaos Stavrou 1cdb8eea4d
Make denote-link--prepare-backlinks accept an optional SHOW-CONTEXT argument 2024-07-25 11:05:38 +03:00
Protesilaos Stavrou 8c1f4f8d4c
Move conditional backlink fontification outside the major mode 2024-07-25 11:04:36 +03:00
Protesilaos Stavrou 5a9328bdb0
Fix error in commit 0511307 2024-07-25 10:32:33 +03:00
Protesilaos Stavrou 0511307fa8
Make sure denote-link--prepare-backlinks works without BUFFER argument 2024-07-25 10:31:14 +03:00
Protesilaos Stavrou cae8decee1
Fix some missing symbol renames from commit d28a7c1 2024-07-25 10:06:37 +03:00
Protesilaos Stavrou d28a7c1a2c
Rename user option to denote-backlinks-display-buffer-action 2024-07-25 10:02:58 +03:00
Protesilaos Stavrou 295187bc6a
Reposition a user option closer towards the top 2024-07-25 10:00:16 +03:00
Protesilaos Stavrou 8a2d7afbef
Remove needless denote-link group 2024-07-25 10:00:01 +03:00
Protesilaos Stavrou 7531208411
Bump version to trigger GNU ELPA package rebuild 2024-07-25 08:15:37 +03:00
Protesilaos Stavrou dc61708c5f
Do not try to search for xrefs if there are no files 2024-07-25 08:14:28 +03:00
Protesilaos Stavrou 46ecf930a0
Make the revert-buffer-function of backlinks reuse all arguments it originally got 2024-07-24 13:08:08 +03:00
Protesilaos Stavrou 98fa28edfb
Reposition where the docstring is in denote-backlinks-mode 2024-07-24 13:03:27 +03:00
Protesilaos Stavrou c3c70801d7
Merge pull request #399 from jeanphilippegg/denote-templates
Add support for function templates in denote-org-capture
2024-07-21 08:53:04 +03:00
Jean-Philippe Gagné Guay af1eab81e8 Add support for function templates in denote-org-capture 2024-07-20 22:21:11 -04:00
Protesilaos Stavrou 259d04aeaa
Update the documentation of denote-templates
This builds on top of the contribution of skissue, which was done in
pull request 398: <https://github.com/protesilaos/denote/pull/398>.
The change is small, meaning that its author does not need to assign
copyright to the Free Software Foundation.
2024-07-20 08:02:38 +03:00
Protesilaos Stavrou cba932b053
Merge pull request #398 from skissue/template-functions
Support functions in `denote-templates`
2024-07-20 07:53:07 +03:00
Ad ed21e8b647 Support functions in denote-templates 2024-07-18 13:29:02 -04:00
Protesilaos Stavrou 6b762364f7
Update denote--file-has-backlinks-p docstring to placate the compiler 2024-07-18 08:58:47 +03:00
Protesilaos Stavrou aa83497db0
Document denote-buffer-has-backlinks-string in the manual
This is related to the contribution by Ashton Wiersdorf in pull
request 392: <https://github.com/protesilaos/denote/pull/392>.
2024-07-18 08:57:32 +03:00
Protesilaos Stavrou dce9d79b23
Use plain ASCII for denote-buffer-has-backlinks-string
This way it works with any font.

This is related to the contribution by Ashton Wiersdorf in pull
request 392: <https://github.com/protesilaos/denote/pull/392>.
2024-07-18 08:55:28 +03:00
Protesilaos Stavrou f808a67bd8
Tweak the :package-version of user options for renaming buffers
We update this so that users know when the default value was added or
last changed.

These are related to the contribution by Ashton Wiersdorf in pull
request 392: <https://github.com/protesilaos/denote/pull/392>.
2024-07-18 08:53:30 +03:00
Protesilaos Stavrou 8abe1bd4f1
Merge pull request #392 from ashton314/main
Add indicator for buffer having backlinks to denote-rename-buffer
2024-07-18 08:51:33 +03:00
Ashton Wiersdorf 9be887a963 Add notes in the manual about the buffer backlink indicator 2024-07-17 23:26:50 -06:00
Ashton Wiersdorf 90fcf37de6 Add denote--file-has-backlinks-p; search for backlinks iff needed
This makes it so that denote-rename-buffer--format only searches for
backlinks to the current file if "%b" is part of the format string.
This is because searching for backlinks might be a little expensive,
and it is good to avoid this cost if the user doesn't want it.
2024-07-17 23:16:19 -06:00
Ashton Wiersdorf 4318efe7e8 Add indicator for buffer having backlinks to denote-rename-buffer 2024-07-17 23:16:19 -06:00
Protesilaos Stavrou ba79556066
Bump version to trigger package rebuild
This is to include some of the latest bug fixes.
2024-07-17 20:45:00 +03:00
Protesilaos Stavrou d73ef5c215
Make denote--file-type-org-extra-p not assume full buffer name
This way it works even when the buffer is renamed via the
'denote-rename-buffer-mode'. Thanks to skissue for reporting the
problem and discussing it with me. This was done in issue 393:
<https://github.com/protesilaos/denote/issues/393>.
2024-07-17 20:44:10 +03:00
Protesilaos Stavrou b5368b23a0
Acknowledge Jakub Szczerbowski for commit 3eb82c0
The change is small, meaning that Jakub does not need to assign
copyright to the Free Software Foundation. This was done as pull
request 395: <https://github.com/protesilaos/denote/pull/395>.
2024-07-17 12:03:19 +03:00
Protesilaos Stavrou 0831694e32
Merge pull request #395 from j4kub5/patch-1
denote-journal-extras--entry-today & custom filename component order
2024-07-17 12:02:15 +03:00
Jakub Szczerbowski 3eb82c0bd0
Update denote-journal-extras--entry-today to handle custom filename component order
The `denote-journal-extras--entry-today` was misbehaving if keywords were in front of the identifier (which is allowed since denote 3.0.0). The corrected version (1) searches for files only based on date and (2) subsequently filters them for the denote-journal-extras-keyword.
2024-07-17 07:50:13 +02:00
Protesilaos Stavrou 77acc10fe4
Document how to make Org open links to some file types in Emacs 2024-07-12 18:42:45 +03:00
Protesilaos Stavrou b1e3db3e61
Fix errors in commit 9440f71 2024-07-06 12:17:42 +03:00
Protesilaos Stavrou 9440f7134f
Change how 4cb216e did denote-rename-confirmations for denote-rename-file-using-front-matter
We do not want to hardcode a value, but only remove the prompt that is
not relevant to this command.
2024-07-06 12:11:32 +03:00
Protesilaos Stavrou 1cf2ca6bb4
Bump version number to trigger GNU ELPA package rebuild 2024-07-06 11:58:05 +03:00
Protesilaos Stavrou 96094529b6
Update the documentation of denote-rename-file-using-front-matter in the manual 2024-07-06 11:57:42 +03:00
Protesilaos Stavrou 4cb216e851
Make denote-rename-file-using-front-matter not prompt for front matter rewrite
It makes no sense in this case, since the user modifies the front
matter manually and then requests a rename of the file based on that.
2024-07-06 11:54:03 +03:00
Protesilaos Stavrou 64253c4fc4
Mention my 'consult-denote' package in the manual 2024-07-05 19:34:32 +03:00
Protesilaos Stavrou aaa9c83740
Bump version number to trigger GNU ELPA package rebuild 2024-07-03 12:21:03 +03:00
Protesilaos Stavrou 848698c404
Refine the denote-org-extras-outline-prompt 2024-07-03 12:20:51 +03:00
Protesilaos Stavrou 5be60a2d8a
Make denote-org-extras-outline-prompt public 2024-07-03 11:18:26 +03:00
Protesilaos Stavrou d758a8be8d
Make the denote-silo-extras-directory-prompt public 2024-07-03 10:57:31 +03:00
Protesilaos Stavrou 5758f2d718
Use a completion table with file category for denote-silo-extras--directory-prompt 2024-07-03 10:50:21 +03:00
Protesilaos Stavrou 0c77b6fe56
Update sample configuration about denote-fontify-links-mode-maybe 2024-07-02 14:55:24 +03:00
Protesilaos Stavrou 51cb46b6b2
Bump version to trigger GNU ELPA rebuild for commit d942333 2024-07-01 19:22:20 +03:00
Protesilaos Stavrou d942333980
Make 'denote-add-links' always read the dir-local variables
We do this by expanding the lists without using an intermediate
buffer. The previous approach was not working as intended in a silo,
because the dir-local value of 'denote-directory' was not present.

Thanks to yetanotherfossman for reporting the problem with
'denote-add-links' when used in a silo and for figuring out that the
temporary buffer was part of the problem. This was done in issue 386:
<https://github.com/protesilaos/denote/issues/386>.
2024-07-01 19:21:35 +03:00
Protesilaos Stavrou 67f5a7bcea
Add accidentally removed buffer-file-name from denote-fontify-links-mode-maybe 2024-06-30 11:11:44 +03:00
Protesilaos Stavrou 05a5334c49
Update Denote to version 3.0.0 2024-06-30 11:06:50 +03:00
Protesilaos Stavrou 9970d09bd6
Expand the docstring of denote-rename-file-signature 2024-06-30 10:55:14 +03:00
Protesilaos Stavrou bf6cc90463
Expand the docstring of denote-rename-file-keywords 2024-06-30 10:55:05 +03:00
Protesilaos Stavrou cf78f863c3
Expand the docstring of denote-rename-file-title 2024-06-30 10:54:52 +03:00
Protesilaos Stavrou a320cebd6a
Include denote-rename-file-title in the manual 2024-06-30 10:53:12 +03:00
Protesilaos Stavrou c9ba0b5bd0
Rewrite the section in the manual about denote-rename-file-signature 2024-06-30 10:53:12 +03:00
Protesilaos Stavrou 5153f01da1
Rewrite the manual about denote-rename-file-keywords 2024-06-30 10:48:45 +03:00
Protesilaos Stavrou a13919d3b1
Mention the user option 'denote-file-name-components-order' in more places 2024-06-30 10:20:36 +03:00
Protesilaos Stavrou 1cfb14f55a
Use 'make-obsolete-variable' in one case 2024-06-30 09:54:43 +03:00
Protesilaos Stavrou 94a2065a71
Tweak denote-fontify-links-mode-maybe 2024-06-30 09:36:48 +03:00
Protesilaos Stavrou 54a5b67cef
Tweak the docstring of denote-fontify-links-mode 2024-06-30 09:32:32 +03:00
Protesilaos Stavrou b47c9b5738
Mention in the manual all the 'denote-use-*' variables we have 2024-06-30 09:26:56 +03:00
Protesilaos Stavrou c637f7f4cb
Acknowledge Nick Bell for participating in issue 332
Here: <https://github.com/protesilaos/denote/issues/332>.
2024-06-30 08:10:25 +03:00
Protesilaos Stavrou 32d98143fd
Merge remote-tracking branch 'origin/excluded-files-regexp' 2024-06-30 07:36:09 +03:00
Protesilaos Stavrou d92fad4cdb
Merge pull request #385 from haji-ali/link-fontification-fix
Added a helper function to conditionally enable `denote-fontify-links-mode`
2024-06-30 07:34:28 +03:00
Al Haji-Ali fb39088ded Added a helper function to conditionally enable denote-fontify-links-mode. 2024-06-26 11:00:12 +01:00
Protesilaos Stavrou e77ef96ccb
Add denote-excluded-files-regexp option to exclude files from prompts
This is in response to requests for such a user option done by Samuel
W. Flint and zadca123 in issues 384, respectively:

- <https://github.com/protesilaos/denote/issues/376>
- <https://github.com/protesilaos/denote/issues/384>
2024-06-25 13:49:31 +03:00
Protesilaos Stavrou 9a08d6bf25
Remove all deprecation notices that were in place before version 2.3.0 2024-06-25 11:38:28 +03:00
Protesilaos Stavrou c93407d6a2
Merge pull request #383 from haji-ali/invisibility-spec
Add an invisibility spec to address disabling `denote-fontify-links-mode`
2024-06-22 21:28:42 +03:00
Al Haji-Ali ccf7d9e737 Add an invisibility spec to address disabling denote-fontify-links-mode 2024-06-22 19:24:39 +01:00
Protesilaos Stavrou abae2d4a86
Document how to use a silo from anywhere
I helped user elge70 as part of issue 381:
<https://github.com/protesilaos/denote/issues/381>.
2024-06-22 13:02:55 +03:00
Protesilaos Stavrou cbc1f3b783
Document how to switch to a silo 2024-06-22 12:51:48 +03:00
Protesilaos Stavrou efe29e6108
Remove faulty extra parentheses from a 'delete' in denote-fontify-links-mode 2024-06-19 10:40:18 +03:00
Protesilaos Stavrou ce1f59af6a
Add TODO and FIXME for new link fontification mode 2024-06-19 10:40:02 +03:00
Protesilaos Stavrou 76098aaafc
Remove obsolete code 2024-06-19 10:39:53 +03:00
Protesilaos Stavrou f3b2f78dd0
Tweak how we deal with thing-at-point-provider-alist in denote-fontify-links-mode 2024-06-19 10:18:21 +03:00
Protesilaos Stavrou 7cdb31acee
Make stylistic tweaks to denote-fontify-links 2024-06-19 09:58:03 +03:00
Protesilaos Stavrou 17dbaaaa2b
Document 'denote-fontify-links-mode'
This builds on top of the new fontification feature provided by Abdul-Lateef Haji-Ali in
pull request 344 (commit 4d12452): <https://github.com/protesilaos/denote/pull/344>.
2024-06-19 09:50:48 +03:00
Protesilaos Stavrou 2b1210c527
Reinstate denote-link-markdown-follow
I had removed it in commit ca79f35, but we seem to still need it for
Markdown's C-c C-o to do the right thing over a 'denote:' link.

This builds on top of the new fontification feature provided by Abdul-Lateef Haji-Ali in
pull request 344 (commit 4d12452): <https://github.com/protesilaos/denote/pull/344>.
2024-06-19 09:44:25 +03:00
Protesilaos Stavrou 5dcbf34fea
Make denote-fontify-links-mode not do anything in Org mode
We do not need it because Org fontifies 'denote:' links natively.

This builds on top of the new fontification feature provided by Abdul-Lateef Haji-Ali in
pull request 344 (commit 4d12452): <https://github.com/protesilaos/denote/pull/344>.
2024-06-19 09:42:12 +03:00
Protesilaos Stavrou 5aeb714ae9
Change how denote-fontify-links-mode handles thingatpt dependency
This builds on top of the new fontification feature provided by Abdul-Lateef Haji-Ali in
pull request 344 (commit 4d12452): <https://github.com/protesilaos/denote/pull/344>.
2024-06-19 09:20:51 +03:00
Protesilaos Stavrou d3d30a5adc
Rename a private function for consistency and tweak its docstring
This builds on top of the new fontification feature provided by Abdul-Lateef Haji-Ali in
pull request 344 (commit 4d12452): <https://github.com/protesilaos/denote/pull/344>.
2024-06-19 09:20:20 +03:00
Protesilaos Stavrou 0e1936b35c
Make several tweaks to denote-fontify-links
This includes stylistic changes, but also the inclusion of a more
informative help-echo, as well as the denote-faces-link.

This builds on top of the new fontification feature provided by Abdul-Lateef Haji-Ali in
pull request 344 (commit 4d12452): <https://github.com/protesilaos/denote/pull/344>.
2024-06-19 09:18:42 +03:00
Protesilaos Stavrou 487692d3af
Placate the compiler for the denote-fontify-links docstring
This builds on top of the new fontification feature provided by Abdul-Lateef Haji-Ali in
pull request 344 (commit 4d12452): <https://github.com/protesilaos/denote/pull/344>.
2024-06-19 09:17:55 +03:00
Protesilaos Stavrou c10e33a01e
Make denote-link-open-at-mouse return an error if link is not resolved 2024-06-19 09:17:16 +03:00
Protesilaos Stavrou ca79f359ff
Make obsolete methods for buttonizing links
This builds on top of the new fontification feature provided by Abdul-Lateef Haji-Ali in
pull request 344 (commit 4d12452): <https://github.com/protesilaos/denote/pull/344>.

I still need to update the manual accordingly.
2024-06-19 09:16:31 +03:00
Protesilaos Stavrou 2b06213c3e
Rename the denote-link-mouse-map and make minor tweaks to it
This builds on top of the new fontification feature provided by Abdul-Lateef Haji-Ali in
pull request 344 (commit 4d12452): <https://github.com/protesilaos/denote/pull/344>.
2024-06-19 09:15:07 +03:00
Protesilaos Stavrou 15c0765951
Acknowledge Abdul-Lateef Haji-Ali for commit 4d12452
Abdul-Lateef has already assigned copyright to the Free Software
Foundation. The new feature was done in pull request 344:
<https://github.com/protesilaos/denote/pull/344>.
2024-06-19 09:13:27 +03:00
Protesilaos Stavrou bb380643f0
Remove now superfluous 'let' from 'denote-link'
This builds on top of the new fontification feature provided by Abdul-Lateef Haji-Ali in
pull request 344 (commit 4d12452): <https://github.com/protesilaos/denote/pull/344>.
2024-06-19 09:11:46 +03:00
Protesilaos Stavrou 7b1bd891ce
Untabify and re-indent denote--rename-get-file-info-from-prompts-or-existing 2024-06-19 09:11:17 +03:00
Al Haji-Ali 4d1245223c
Implemented a fontification method for displaying links and removed buttons 2024-06-19 08:35:29 +03:00
Protesilaos Stavrou dd3755e690
Document how to make silos work for Org export
Thanks to azegas for reporting an issue that led me to investigate
this in-depth. This was done in issue 369:
<https://github.com/protesilaos/denote/issues/369>.
2024-06-18 13:04:52 +03:00
Protesilaos Stavrou 1d84215f7a
Merge pull request #378 from jeanphilippegg/fix-fontification
Only fontify files that have an identifier
2024-06-18 12:34:21 +03:00
Jean-Philippe Gagné Guay 3846d68352 Only fontify files that have an identifier 2024-06-17 21:26:08 -04:00
Protesilaos Stavrou 4d39e1453d
Add missing t condition from denote-link--ol-resolve-link-to-target 2024-06-11 12:24:52 +03:00
Protesilaos Stavrou 07a16f5dac
Expand the tests about retrieving file name components 2024-06-10 20:26:26 +03:00
Protesilaos Stavrou 08223cbb62
Write test for denote-retrieve-filename-signature 2024-06-10 20:19:52 +03:00
Protesilaos Stavrou 3ae0c7816b
Write test for denote-retrieve-filename-keywords 2024-06-10 20:18:04 +03:00
Protesilaos Stavrou d983c5c56b
Write test for denote-retrieve-filename-title 2024-06-10 20:17:43 +03:00
Protesilaos Stavrou 8f61dc1124
Write test for denote-retrieve-filename-identifier 2024-06-10 20:11:26 +03:00
Protesilaos Stavrou 0859135ace
Add missing autoloads for the dynamic blocks
The dynamic blocks in a file do not evaluate with C-c C-c as they
should, unless the user explicitly loads the 'denote-org-extras'
feature. Whereas we want this to work automatically.

Thanks to Kolmas for reporting the bug in issue 371:
<https://github.com/protesilaos/denote/issues/371>.
2024-06-10 19:59:46 +03:00
Protesilaos Stavrou 3029d5668b
Make the file name regexp account for identifier reordering
This ensures that we retrieve the correct file name components from
the file name. One such case where this was failing is with the
identification of the default value of the keywords' prompt while
using 'denote-rename-file'.

Thanks to Kolmas for reporting this bug in issue 375:
<https://github.com/protesilaos/denote/issues/375>.
2024-06-10 19:53:04 +03:00
Protesilaos Stavrou b8fd5afe8f
Merge pull request #368 from jeanphilippegg/fix-bugs
Bug fixes: Fix the fontification + another bug
2024-06-03 07:54:32 +03:00
Jean-Philippe Gagné Guay d4d33019b7 Make identifier remove its delimiter in the file name only if it has a specific format 2024-05-24 23:15:10 -04:00
Jean-Philippe Gagné Guay 07c4a1d426 Prevent infinite loop in denote--find-first-unused-id 2024-05-24 23:09:19 -04:00
Jean-Philippe Gagné Guay 7ebf9b8a87 Make fontification work with general identifiers 2024-05-24 22:48:14 -04:00
Jean-Philippe Gagné Guay 5f6b2a176f Make denote-org-capture use the same id in the file name and the front matter 2024-05-24 22:24:50 -04:00
Jean-Philippe Gagné Guay 376341aa6d Fix fontification of the first item in a Dired buffer 2024-05-24 22:05:32 -04:00
Protesilaos Stavrou 56aabe40ff
Move denote-use-* variables closer to where they are used; tweak docstrings 2024-05-20 12:36:21 +03:00
Protesilaos Stavrou 91c8744033
Merge pull request #365 from jeanphilippegg/denote-use-variables
Add denote-use-* variables
2024-05-20 12:24:44 +03:00
Jean-Philippe Gagné Guay f6b08c79f4 Add denote-use-* variables 2024-05-20 01:52:08 -04:00
Protesilaos Stavrou ed112050d9
Add two cross references in the manual for linking individual files 2024-05-20 07:25:49 +03:00
Protesilaos Stavrou 8a8bb77578
Mention denote-link-with-signature in denote-link docstring 2024-05-20 07:22:40 +03:00
Protesilaos Stavrou ae8db2eefd
Remove needless let* 2024-05-20 07:21:18 +03:00
Protesilaos Stavrou 84f2f28764
Add documentation for a global denote-link
Thanks to Alexis Purslane for suggesting this idea in issue 364:
<https://github.com/protesilaos/denote/issues/364>.
2024-05-20 07:15:41 +03:00
Protesilaos Stavrou bfee3da14c
Reword the documentation of denote-link 2024-05-20 07:14:16 +03:00
Protesilaos Stavrou bd14d37c4d
Make denote-format-link use Org links if FILE-TYPE is nil 2024-05-20 07:13:02 +03:00
Protesilaos Stavrou 24a1a8c6e2
Merge pull request #363 from jeanphilippegg/creation-commands
Bug with `denote-date` + remove code duplication.
2024-05-20 06:13:50 +03:00
Jean-Philippe Gagné Guay 4af0944d13 Use internal functions in denote and denote-org-capture commands 2024-05-19 12:33:53 -04:00
Jean-Philippe Gagné Guay 623da83a31 Use denote-parse-date in denote-org-capture 2024-05-19 12:33:53 -04:00
Jean-Philippe Gagné Guay d284099a01 Be more explicit in denote-valid-date-p and handle dates that are empty strings 2024-05-19 12:33:53 -04:00
Protesilaos Stavrou 0b5bc23718
Merge pull request #362 from jeanphilippegg/comment
Clarify comment in denote--replace-consecutive-token-characters
2024-05-19 18:01:06 +03:00
Protesilaos Stavrou b2c2106020
Update the docs of denote-file-name-components-order for more clarity
The idea to include some examples comes from Maikol Solis in issue
361: <https://github.com/protesilaos/denote/issues/361>.
2024-05-19 17:59:53 +03:00
Jean-Philippe Gagné Guay 519f9b4598 Clarify comment in denote--replace-consecutive-token-characters 2024-05-19 09:58:49 -04:00
Protesilaos Stavrou 74375b1bec
Reword a statement in denote-prompts docstring 2024-05-19 08:08:47 +03:00
Protesilaos Stavrou 53b52d56db
Document new user option denote-file-name-components-order
The new functionality is contributed by Jean-Philippe Gagné Guay in
pull request 360: <https://github.com/protesilaos/denote/pull/360>.
2024-05-19 08:05:28 +03:00
Protesilaos Stavrou 227da429d6
Make denote-file-name-components-order a user option 2024-05-19 07:32:54 +03:00
Protesilaos Stavrou c73c4cf143
Merge pull request #360 from jeanphilippegg/denote-file-name-components-order
Add `denote-file-name-components-order` to allow reordering
2024-05-19 07:06:45 +03:00
Jean-Philippe Gagné Guay 33ca6c25e3 Add denote-file-name-components-order to allow reordering 2024-05-18 21:00:46 -04:00
Jean-Philippe Gagné Guay d8d6f57f19 Simplify denote--replace-consecutive-token-characters 2024-05-18 15:55:26 -04:00
Protesilaos Stavrou 9a82b7d313
Fix typo in the macro's doc string from commit a648205 2024-05-18 20:59:33 +03:00
Protesilaos Stavrou a648205dc9
Define macro to consolidate front matter retrieval functions 2024-05-18 20:55:22 +03:00
Protesilaos Stavrou cc313b685f
Merge pull request #359 from jeanphilippegg/fontification
Rework the fontification
2024-05-18 20:25:30 +03:00
Jean-Philippe Gagné Guay 626b7a8f91 Rework the fontification 2024-05-18 03:35:48 -04:00
Protesilaos Stavrou 33bc34ba55
Remove needless save-excursion added in commit be17fcb
Contributes to the fix for the problem reported by kilesduli in issue
354: <https://github.com/protesilaos/denote/issues/354>.
2024-05-18 09:36:48 +03:00
Protesilaos Stavrou be17fcb027
Fix off-by-one jump to Org heading line
This wouid match the wrong heading if there were no spaces between the
headings. Thanks to kilesduli for bringing this matter to my attention
in issue 354: <https://github.com/protesilaos/denote/issues/354>.
2024-05-18 09:30:39 +03:00
Protesilaos Stavrou 7fe739fed0
Merge pull request #356 from brabalan/patch-1
Typo in denote.el
2024-05-18 09:16:55 +03:00
Protesilaos Stavrou 4157cac287
Merge pull request #358 from jeanphilippegg/fix-denote-command
Fix issue on note creation caused by commit bce7778
2024-05-18 09:15:56 +03:00
Jean-Philippe Gagné Guay adf4e9f7d1 Fix issue on note creation caused by commit bce7778 2024-05-17 21:37:06 -04:00
Alan Schmitt 60c574edf8
Typo in denote.el 2024-05-17 15:05:54 +02:00
Protesilaos Stavrou 23d268a156
Fix regression caused by commit f08bed0
We want the title prompt to do the following:

1. Find the title from the file's front matter.
2. Find the title from the relevant Denote file name component.
3. Fall back to the name of the file UNLESS it already has an
   identifier. In this case, the file does not have a Denote title
   component, so we do not want to put the rest of the file name (e.g.
   identifier plus signature/keywords) as the initial title as that
   will duplicate the contents of the file name.

We had this before, but point 3 was failing.

Thanks to Alan Schmitt for bringing this matter to my attention in
discussion 353: <https://github.com/protesilaos/denote/discussions/353>.
2024-05-17 13:01:59 +03:00
Protesilaos Stavrou 8880bf3ca3
Merge pull request #351 from jeanphilippegg/cleanup
Other fixes
2024-05-17 07:44:55 +03:00
Protesilaos Stavrou 8c6d43106a
Merge pull request #352 from jeanphilippegg/no-prompt-for-current-file
Make renaming commands rename the current file without prompt
2024-05-17 07:41:31 +03:00
Jean-Philippe Gagné Guay 85ae81782b Make renaming commands rename the current file without prompt 2024-05-16 21:48:11 -04:00
Jean-Philippe Gagné Guay bce7778d9d Make denote and denote--rename-file issue an error if the new file already exists 2024-05-16 21:06:49 -04:00
Jean-Philippe Gagné Guay d14a421036 Only rename the file if it exists in denote-rename-file-and-buffer 2024-05-16 21:00:28 -04:00
Jean-Philippe Gagné Guay 0f966d06f8 Do not check that the file exists in denote-file-is-writable-and-supported-p 2024-05-16 21:00:18 -04:00
Jean-Philippe Gagné Guay 9460e457e3 Check file-type first in denote-retrieve-front-matter-* functions 2024-05-16 20:25:21 -04:00
Jean-Philippe Gagné Guay 8834bcd3e1 Revert "Make some stylistic changes for how non-nil arguments are named"
This reverts commit 88a67e9493.
2024-05-16 20:20:21 -04:00
Protesilaos Stavrou 88a67e9493
Make some stylistic changes for how non-nil arguments are named 2024-05-16 16:09:00 +03:00
Protesilaos Stavrou 0dc0162933
Simplify denote-file-is-note-p 2024-05-16 16:04:19 +03:00
Protesilaos Stavrou 6356d5262a
Merge pull request #350 from jeanphilippegg/cleanup
Various cleanup commits and bug fixes
2024-05-16 16:00:31 +03:00
Jean-Philippe Gagné Guay 80827dfb1d Use denote-filename-is-note-p instead of denote-file-is-note-p in some functions 2024-05-15 22:29:32 -04:00
Jean-Philippe Gagné Guay d63c10dc1a Update docstring of denote--add-front-matter 2024-05-15 22:29:32 -04:00
Jean-Philippe Gagné Guay 9e893fb82c Remove outdated info in docstring of denote-directory-files 2024-05-15 22:29:32 -04:00
Jean-Philippe Gagné Guay df44843766 Make denote-filetype-heuristics return nil with unrecognized file types 2024-05-15 22:29:28 -04:00
Jean-Philippe Gagné Guay 6becb0951e Make denote-retrieve-front-matter-* functions handle nil file-type 2024-05-15 21:13:53 -04:00
Jean-Philippe Gagné Guay efa9587a6c Handle nil case when using denote-retrieve-title-or-filename 2024-05-15 20:10:05 -04:00
Jean-Philippe Gagné Guay 10be24b0ed Make denote--directory-get-files return only regular files 2024-05-15 20:03:12 -04:00
Protesilaos Stavrou 27ca3c9b02
Merge pull request #348 from jeanphilippegg/denote-file-prompt
Make denote-file-prompt return an absolute path
2024-05-15 06:47:34 +03:00
Jean-Philippe Gagné Guay b768741100 Make denote-file-prompt return an absolute path and remove denote-file-or-action-prompt 2024-05-13 21:52:11 -04:00
Protesilaos Stavrou b76221d9f5
Update denote-link-description-with-signature-and-title to match commit f08bed0 2024-05-12 11:32:32 +03:00
Protesilaos Stavrou f08bed0909
Make denote-retrieve-title-or-filename be a wrapper only
We do not want it to return the file-name-base because this will
duplicate the text of the file name when there is no TITLE component,
as demonstrated by duli in issue 347: <https://github.com/protesilaos/denote/issues/347>.
2024-05-12 11:32:24 +03:00
Protesilaos Stavrou a6a5698acf
Fix typo in docstring 2024-05-12 11:28:53 +03:00
Protesilaos Stavrou a7cfe4a5c2
Revise the denote-file-prompt to improve the user experience
The goal is to decouple file selection from the logic of the "... or
create" commands we have. We want to require a match to a file by
default and to only have a fallback "or create" action in those cases
where it is requested.

The changes I make here apply to the "... or create" commands, though
they also affect 'denote-link' and related. When we prompt to link to
a file, we require a match, such that the user cannot exit the
minibuffer with a string that does not expand to an existing file.
This was an error we were not handling. It was also an easy mistake to
make.

This follows the discussion with Jean-Philippe Gagné Guay and Alan
Schmitt in issue 339: <https://github.com/protesilaos/denote/issues/339>.
2024-05-12 07:54:44 +03:00
Protesilaos Stavrou d57dd28af1
Revert "Return a user-error if denote-directory has no files"
This reverts commit 3badc7f2e8.

Thanks to Kolmas for bringing this matter to my attention in issue
345: <https://github.com/protesilaos/denote/issues/345>.
2024-05-11 17:39:02 +03:00
Protesilaos Stavrou 3badc7f2e8
Return a user-error if denote-directory has no files 2024-05-11 10:40:45 +03:00
Protesilaos Stavrou 9b7eaad07e
Use new parameter to match only Org files for heading backlinks (per b8d1ae3) 2024-05-11 10:33:22 +03:00
Protesilaos Stavrou b8d1ae3e68
Make denote-link--prepare-backlinks accept files-matching-regexp parameter 2024-05-11 10:32:45 +03:00
Protesilaos Stavrou 0bc53a4bce
Make public the prompt for selecting linked file 2024-05-11 06:33:04 +03:00
Protesilaos Stavrou 791ac93f4d
Fix regression with wrong extension assignment while renaming
Thanks to Kolmas for bringing this matter to my attention in issue
343: <https://github.com/protesilaos/denote/issues/343>.
2024-05-10 20:17:58 +03:00
Protesilaos Stavrou df9ef78dda
Merge pull request #342 from jeanphilippegg/denote-file-prompt
Rework denote-file-prompt to work with relative paths in denote-file-history
2024-05-10 06:49:58 +03:00
Jean-Philippe Gagné Guay e165c21196 Rework denote-file-prompt to work with relative paths in denote-file-history 2024-05-09 22:49:24 -04:00
Protesilaos Stavrou d0effdb11d
Remove FIXME from denote-file-prompt (it is fine) 2024-05-09 13:59:45 +03:00
Protesilaos Stavrou c738198b4a
Tweak the docstring of denote-file-prompt 2024-05-09 13:59:35 +03:00
Protesilaos Stavrou d96ff79cf3
Merge branch 'main' of github.com:protesilaos/denote 2024-05-09 13:49:58 +03:00
Protesilaos Stavrou ff7982f2fd
Make denote-file-prompt more robust
Because we do not force a match, we need to check if the user's input
matches a file uniquely. Otherwise we return the input as-is, which is
then used by 'denote-open-or-create' (and related).

To make sure that the latest input is used and to not mess up with the
minibuffer history, we now have a new internal variable that handles
this case.
2024-05-09 13:48:12 +03:00
Protesilaos Stavrou cd11a78901
Merge pull request #341 from jeanphilippegg/renaming-commands
Revert some changes in #333 and do not prompt for front matter if only signature is modified
2024-05-09 07:07:14 +03:00
Jean-Philippe Gagné Guay 15a663c0c5 Only edit front matter if title or keywords are modified 2024-05-08 22:34:34 -04:00
Jean-Philippe Gagné Guay 5f0a1f6c18 Remove file-type and directory parameters from denote-rename-file 2024-05-08 21:47:59 -04:00
Protesilaos Stavrou 41e0d9a41a
Make denote-file-prompt process its history better
We do not need to have full file system paths there, nor the user's
raw input. What we want are file names relative to the
denote-directory.

Thanks to Alan Schmitt for noting that the history was not working
properly. This was done in issue 339:
<https://github.com/protesilaos/denote/issues/339>.
2024-05-08 11:27:53 +03:00
Protesilaos Stavrou 781ba35280
Tweak doc string of denote-rename-file 2024-05-08 07:37:40 +03:00
Protesilaos Stavrou 927fa43615
Merge pull request #333 from jeanphilippegg/renaming-commands
Streamline the renaming commands
2024-05-08 07:11:49 +03:00
Protesilaos Stavrou c79da89b23
Clarify that denote-org-extras.el is part of Denote and autoloadable
Thanks to Julian Hoch for asking for this clarification. This was done
in issue 337: <https://github.com/protesilaos/denote/issues/337>.
2024-05-07 09:04:55 +03:00
Protesilaos Stavrou e197f3157a
Make denote-add-prompts public 2024-05-02 10:55:36 +03:00
Jean-Philippe Gagné Guay b6a93b75d6 Add denote--rename-file and denote--rename-get-file-info-from-prompts-or-existing and simplify renaming commands 2024-04-28 23:12:12 -04:00
Protesilaos Stavrou 13c161ac1b
Reindent and untabify files 2024-04-27 12:10:57 +03:00
Protesilaos Stavrou 0a7560882e
Update the denote-sluggify entry in the manual
This reflects the change made by Jean-Philippe Gagné Guay in pull
request 331: <https://github.com/protesilaos/denote/pull/331>.
2024-04-27 07:37:33 +03:00
Protesilaos Stavrou 5a7b408b4a
Merge pull request #331 from jeanphilippegg/title-sluggification
Fix issue #271 (Allow -- in titles)
2024-04-27 07:31:01 +03:00
Protesilaos Stavrou be3ca425d6
Merge pull request #330 from jeanphilippegg/denote--used-ids
Add denote--used-ids and simplify renaming commands
2024-04-27 07:24:18 +03:00
Protesilaos Stavrou 337e99abaf
Merge pull request #329 from jeanphilippegg/refactoring
Refactorings
2024-04-27 07:21:37 +03:00
Jean-Philippe Gagné Guay ac21068d3c Allow consecutive hyphens in file name titles 2024-04-26 19:45:51 -04:00
Jean-Philippe Gagné Guay 503967372e Include signature delimiter in denote-*-regexp variables 2024-04-26 19:36:23 -04:00
Jean-Philippe Gagné Guay ee13dc8641 Add denote--used-ids and simplify renaming commands 2024-04-26 19:19:36 -04:00
Jean-Philippe Gagné Guay 63c65c0cc0 Compare identifier with what denote-retrieve-filename-identifier returns 2024-04-26 19:04:08 -04:00
Jean-Philippe Gagné Guay 5894fe704f Use denote-retrieve-front-matter-title-value instead of an alias 2024-04-26 19:01:17 -04:00
Protesilaos Stavrou 31e94d0568
Update the manual of all commands tha respect denote-rename-confirmations
This new user option was contributed by Jean-Philippe Gagné Guay in
pull request 324: <https://github.com/protesilaos/denote/pull/324>.
2024-04-26 08:26:01 +03:00
Protesilaos Stavrou a0f324a6e3
Reword some docstrings to use the imperative mood 2024-04-26 08:24:35 +03:00
Protesilaos Stavrou 8ee7eb5b57
Include reference to denote-save-buffers in manual's denote-rename-file entry 2024-04-26 08:15:03 +03:00
Protesilaos Stavrou 4723147554
Update the manual for denote-rename-file to mention denote-rename-confirmations
This new user option was contributed by Jean-Philippe Gagné Guay in
pull request 324: <https://github.com/protesilaos/denote/pull/324>.
2024-04-26 08:12:06 +03:00
Protesilaos Stavrou a5a52d6b6c
Reword the doc string of denote-rename-confirmations 2024-04-26 08:10:00 +03:00
Protesilaos Stavrou 52bc45fc86
Deprecate denote-rename-no-confirm (superseded by denote-rename-confirmations) 2024-04-26 08:09:10 +03:00
Protesilaos Stavrou 2f50fe45d6
Include :package-version for modified denote-save-buffers 2024-04-26 08:08:14 +03:00
Protesilaos Stavrou 68915b1545
Document functions for developers affected by the new denote-rename-confirmations 2024-04-26 08:07:41 +03:00
Protesilaos Stavrou 9eacb2f4e8
Document the denote-rename-confirmations in the manual 2024-04-26 08:07:21 +03:00
Protesilaos Stavrou 05d378ec08
Update the manual about denote-save-buffers 2024-04-26 07:45:05 +03:00
Protesilaos Stavrou 2a8aa0030b
Merge pull request #324 from jeanphilippegg/denote-rename-confirmations
Fix issues #274 and #299
2024-04-26 07:39:24 +03:00
Protesilaos Stavrou 534c8075b3
Update the manual's acknowledgements
This covers the contribution by Alexandre Rousseau in commit 6f1773a.
The change is small, so Alexandre does not need to assign copyright to
the Free Software Foundation.
2024-04-26 07:23:11 +03:00
Protesilaos Stavrou 2acca69a24
Tweak the denote-org-extras function that checks org-link-file-path-type
This was originally contributed by Alexandre Rousseau in pull request
325: <https://github.com/protesilaos/denote/pull/325>.
2024-04-26 07:21:26 +03:00
Protesilaos Stavrou 11a4d1f9a9
Merge pull request #325 from gamecubate/main
File link conversion tracks the value of org-link-file-path-type
2024-04-26 07:16:52 +03:00
Alexandre Rousseau 6f1773a9b7 File link conversion tracks the value of org-link-file-path-type 2024-04-22 11:27:40 -04:00
Protesilaos Stavrou 59e6c43f9b
Make denote-org-extras-link-to-heading use selected text for description 2024-04-21 09:37:13 +03:00
Protesilaos Stavrou 6c330d4b35
Include cross reference to Org heading backlinks 2024-04-21 08:34:26 +03:00
Protesilaos Stavrou 8d88617a03
Refactor backlink buffer commands to specify their own buffer name
This makes the buffer name easier to read, but also easier to extend.
2024-04-21 08:31:26 +03:00
Protesilaos Stavrou 4797af4be6
Do not insert any heading text into the backlinks buffer
It does not look right, especially when we show context with Xref. We
better control the name of the buffer, but otherwise limit the
contents to backlinks only.
2024-04-21 08:30:05 +03:00
Protesilaos Stavrou f69767ef1d
Do not display bakclinks buffer if there are no matches 2024-04-21 08:29:37 +03:00
Protesilaos Stavrou 3100af5903
Update the value of denote-link-backlinks-display-buffer-action 2024-04-21 08:29:11 +03:00
Protesilaos Stavrou e98b9e2f9b
Further simplify denote-link--prepare-backlinks 2024-04-21 07:20:12 +03:00
Jean-Philippe Gagné Guay fb2d14a763 Add denote-save-buffers and denote-rename-confirmations 2024-04-20 20:39:08 -04:00
Protesilaos Stavrou 1aa09dbff3
Update acknowledgements per commit 7a16d7b 2024-04-20 21:45:55 +03:00
Protesilaos Stavrou 1945480e5a
Simplify how the backlinks are generated
We do not need to have a parameter for a fetcher function, since we
never use that feature.
2024-04-20 21:39:41 +03:00
Protesilaos Stavrou 7a16d7bb69
Add optional command to sshow backlinks for an individual Org heading
Thanks to Harold Ollivier for suggesting this idea in issue 297:
<https://github.com/protesilaos/denote/issues/297>.
2024-04-20 21:00:30 +03:00
Protesilaos Stavrou 2a24919055
Make it possible to get backlinks with arbitrary query
The use-case here is to have compound identifiers, such as what we do
when we are linking to an Org heading.
2024-04-20 20:51:01 +03:00
Protesilaos Stavrou aa58047dba
Reword a comment about denote-link--prepare-backlinks absolute paths 2024-04-20 18:09:33 +03:00
Protesilaos Stavrou 555e5af2d2
Further simplify docstring of denote-link--prepare-backlinks 2024-04-20 18:08:03 +03:00
Protesilaos Stavrou 6c3713f7a7
Make denote-link--prepare-backlinks accept optional diplay-buffer alist 2024-04-20 18:04:04 +03:00
Protesilaos Stavrou d1bb84c2e4
Remove implementation details from denote-link--prepare-backlinks docstring 2024-04-20 18:01:49 +03:00
Protesilaos Stavrou 0f42c12695
Add make-obsolete for 'denote-convert-file-name-keywords-to-crm' 2024-04-20 12:58:05 +03:00
Protesilaos Stavrou 6f520ac521
Merge pull request #322 from jeanphilippegg/remove-unused-functions
Remove unused functions
2024-04-20 12:56:23 +03:00
Protesilaos Stavrou 8a8eb3b17a
Merge pull request #321 from jeanphilippegg/small-fix
Use the new denote--file-type-org-extra-p in denote-link-dired-marked-notes
2024-04-20 12:53:30 +03:00
Protesilaos Stavrou c6be1d0f98
Merge pull request #320 from jeanphilippegg/denote-keywords--combine
Minor cleanup in `denote-keywords--combine`
2024-04-20 12:52:58 +03:00
Jean-Philippe Gagné Guay 943d20d124 Remove denote-convert-file-name-keywords-to-crm 2024-04-14 15:28:19 -04:00
Jean-Philippe Gagné Guay 417818b331 Remove denote-retrieve-front-matter-keywords-value-as-string 2024-04-14 15:26:43 -04:00
Jean-Philippe Gagné Guay 980bf44327 Use the new denote--file-type-org-extra-p in denote-link-dired-marked-notes 2024-04-14 13:23:11 -04:00
Jean-Philippe Gagné Guay 7bdfeb7e27 Use seq-union and seq-difference in denote-keywords--combine 2024-04-14 11:17:06 -04:00
Jean-Philippe Gagné Guay 20bda6b855 Remove unnecessary check in denote-link-ol-get-id 2024-04-14 11:14:37 -04:00
Protesilaos Stavrou b914c2f6ea
Document denote-dired-rename-marked-files-{add,remove}-keywords 2024-04-13 13:40:10 +03:00
Protesilaos Stavrou d74cf5d5bf
Refine doc strings of the renaming commands that add/remove keywords in Dired 2024-04-13 13:40:10 +03:00
Protesilaos Stavrou 8154f3a161
Acknowledge Jianwei Hou for fixing a typo in the manual 2024-04-13 13:40:10 +03:00
Protesilaos Stavrou fa5530e39d
Tweak denote--file-type-org-extra-p 2024-04-13 08:29:58 +03:00
Protesilaos Stavrou 3fea12e778
Merge pull request #310 from brabalan/org-note-file-type
Extend org file type detection
2024-04-13 08:27:43 +03:00
Protesilaos Stavrou a715be3efe
Merge pull request #313 from jeanphilippegg/small-cleanup
Use denote-extract-keywords-from path in renaming commands
2024-04-13 08:26:54 +03:00
Protesilaos Stavrou ec698bb053
Merge pull request #316 from vedang/feat/add-remove-keywords-dired
Create -add-keywords and -remove-keywords variants for denote-dired-rename-marked-files
2024-04-13 08:23:43 +03:00
Protesilaos Stavrou a1f9561d9c
Merge pull request #307 from jeanphilippegg/denote--valid-file-type
Issue error in denote--valid-file-type if denote-file-types is nil
2024-04-13 08:21:44 +03:00
Protesilaos Stavrou 61b0c4e7b2
Merge pull request #306 from jeanphilippegg/denote-link-dired-marked-notes
Issue error if buffer is not recognized in denote-link-dired-marked-notes
2024-04-13 08:19:32 +03:00
Protesilaos Stavrou 5b2abf3d31
Merge pull request #305 from jeanphilippegg/renote--path
Remove denote--path
2024-04-13 08:17:48 +03:00
Protesilaos Stavrou 0857b75de4
Merge pull request #308 from jeanphilippegg/return-path-in-denote-command
Make denote command return the path of the new note
2024-04-13 08:16:33 +03:00
Protesilaos Stavrou d99374da6e
Merge pull request #304 from jeanphilippegg/backlinks
Make backlinks work even on files that have a non supported extension
2024-04-13 08:15:11 +03:00
Protesilaos Stavrou ad264e3e7c
Merge pull request #311 from jhou1/typo
fix a minor typo in section 3.1.5 in README.org
2024-04-13 08:09:22 +03:00
Vedang Manerikar 714b398281 Create -add-keywords and -remove-keywords variants for denote-dired-rename-marked-files
The built-in `denote-dired-rename-marked-files-with-keywords` function
replaces all the keywords of marked files with user-input keywords.
This is really useful, but my most common use-case is needing to add
a particular keyword or remove a particular keyword from marked notes.

This commit re-arranges the plumbing of
`denote-dired-rename-marked-files-with-keywords` into two internal
functions: `denote-dired-rename-marked-files--change-keywords` and
`denote-keywords--combine`.

This lets us create two new functions --
`denote-dired-rename-marked-files-add-keywords` and
`denote-dired-rename-marked-files-remove-keywords`.

Closes: #315
2024-04-10 21:06:07 +05:30
Jean-Philippe Gagné Guay f06c5fc6d6 Use denote-extract-keywords-from-path in renaming commands 2024-04-06 16:42:04 -04:00
Jianwei Hou 7c2681e8cb fix a doc typo in section 3.1.5 The denote-save-buffer-after-creation option 2024-04-04 22:34:17 +08:00
Alan Schmitt ef16d52bd9 Extend org file type detection
- rename `denote--file-type-org-capture-p` into
`denote--file-type-org-extra-p`
- add case for an `*Org Note*` buffer
2024-04-03 11:41:12 +02:00
Jean-Philippe Gagné Guay 8c6ccd9f0c Make denote command return the path of the new note 2024-03-31 20:57:11 -04:00
Jean-Philippe Gagné Guay f8e5649cb3 Issue error in denote--valid-file-type if denote-file-types is nil 2024-03-31 20:44:27 -04:00
Jean-Philippe Gagné Guay e2bea37b6a Issue error if buffer is not recognized in denote-link-dired-marked-notes 2024-03-31 17:41:14 -04:00
Jean-Philippe Gagné Guay 36d763531e Remove denote--path 2024-03-31 17:10:00 -04:00
Jean-Philippe Gagné Guay e035ac1ebe Make backlinks work even on files that have a non supported extension 2024-03-31 16:57:26 -04:00
Protesilaos Stavrou 914e5be6c1
Bump version number to trigger GNU ELPA package rebuild 2024-03-31 07:07:32 +03:00
Protesilaos Stavrou 1d2ae08b5d
Merge pull request #303 from jeanphilippegg/fix-denote-org-capture
Insert string template in denote-org-capture (fix for issue #302)
2024-03-31 07:05:21 +03:00
Jean-Philippe Gagné Guay 32873d6585 Insert string template in denote-org-capture 2024-03-30 20:23:59 -04:00
Protesilaos Stavrou 514a5d0d39
Autoload all the Org dynamic blocks
We need this to make sure existing blocks work even without requiring
the 'denote-org-extras' feature.
2024-03-30 07:18:32 +02:00
Protesilaos Stavrou 12c08b96a4
Bump version number to trigger GNU ELPA package rebuild 2024-03-28 07:58:26 +02:00
Protesilaos Stavrou cade4108a2
Include and document the user option denote-link-description-function
Thanks to Sven Seebeck for noticing that we did not document this for
the 2.3.0 release. Thanks to Jean-Philippe Gagné Guay for helping me
refine the code. This was all done in issue 298:
<https://github.com/protesilaos/denote/issues/298>.
2024-03-28 07:56:25 +02:00
Protesilaos Stavrou 12afccb758
Add a missing heading in the manual 2024-03-28 07:55:47 +02:00
Protesilaos Stavrou fd991d40b5
Reword an outdated statement in the manual 2024-03-28 07:55:22 +02:00
Protesilaos Stavrou 745b536140
Fix typo in denote-org-store-link-to-heading doc string 2024-03-28 07:47:42 +02:00
Protesilaos Stavrou 83a1736f83
Upcase the scope in a few more prompts
We did this with other prompts. Those fell through the cracks.
2024-03-27 16:47:31 +02:00
Protesilaos Stavrou 9a9aac1780
Use "file" instead of "note" terminology in denote-file-prompt 2024-03-27 16:46:32 +02:00
Protesilaos Stavrou b90d349bf5
Remove duplicate nodes in the manual about "link or create" commands 2024-03-27 06:58:10 +02:00
Protesilaos Stavrou 1296dbef0a
Mention the denote-save-buffer-after-creation in two doc places 2024-03-27 06:57:37 +02:00
Protesilaos Stavrou d0d9e1228b
Bump version to trigger GNU ELPA package rebuild 2024-03-26 13:44:23 +02:00
Protesilaos Stavrou e079166610
Make sure denote-journal-extras-directory falls back to denote-directory
This is what the user option denote-journal-extras-directory promises
in its doc string.
2024-03-26 13:42:59 +02:00
Protesilaos Stavrou 8fbd0b6d1b
Merge pull request #300 from jeanphilippegg/fix-linking-commands
Fix error message for all linking commands in Org capture buffers
2024-03-26 06:36:09 +02:00
Jean-Philippe Gagné Guay 7356faac8e Fix error message for all linking commands in Org capture buffers 2024-03-25 21:21:48 -04:00
Protesilaos Stavrou e79411f71a
Reword the doc string of denote--file-type-org-capture-p 2024-03-25 15:52:33 +02:00
Protesilaos Stavrou 76687bb708
Bump version number to trigger GNU ELPA package rebuild 2024-03-25 15:38:07 +02:00
Protesilaos Stavrou 2f5df0fb40
Make denote-filetype-heuristics not fail with nil file argument 2024-03-25 15:37:44 +02:00
Protesilaos Stavrou db5acd3317
Fix regression to make denote-link not fail in Org capture buffers
Thanks to Sven Seebeck for reporting this bug in issue 298:
<https://github.com/protesilaos/denote/issues/298>.
2024-03-25 15:35:15 +02:00
Protesilaos Stavrou 93887bea48
Update to Denote version 2.3.0 2024-03-24 19:51:48 +02:00
Protesilaos Stavrou 5f90cc9617
Make minor rewording in the manual 2024-03-24 18:07:15 +02:00
Protesilaos Stavrou 6744a4be19
Make one correction about a symbol being a variable, not function 2024-03-24 10:54:32 +02:00
Protesilaos Stavrou 35c8d1a8c5
Clarify how denote-org-store-link-to-heading affects org-capture
Thanks to Kristoffer Balintona for discussing with me how
~org-capture~ interfaces with ~org-store-link~. I updated the
documentation accordingly. This was done in issue 267:
<https://github.com/protesilaos/denote/issues/267>.
2024-03-24 10:40:45 +02:00
Protesilaos Stavrou 3394f75a10
Update docs of all 'denote' wrappers to reflect 'denote-prompts' conformity 2024-03-24 07:15:59 +02:00
Protesilaos Stavrou 0e0a6e44f1
Update the denote-prompts documentation to reflect its current state 2024-03-24 07:08:10 +02:00
Protesilaos Stavrou fe3e23621c
Merge pull request #296 from jeanphilippegg/denote-project-find
Actually... remove `project.el` integration again
2024-03-24 06:38:40 +02:00
Protesilaos Stavrou 2849de0f48
Pass PROMPT-TEXT to denote-title-prompt from denote-link (per 5c10aa2) 2024-03-23 08:07:36 +02:00
Protesilaos Stavrou 5c10aa2863
Make denote-file-prompt accept a PROMPT-TEXT argument like other prompts 2024-03-23 08:06:39 +02:00
Protesilaos Stavrou ce134fed64
Upcase FILE in denote--rename-dired-file-or-prompt for easier scanning 2024-03-23 08:03:37 +02:00
Protesilaos Stavrou 32f9974b21
Update the link to the project's repo in the CHANGELOG file 2024-03-23 07:41:22 +02:00
Protesilaos Stavrou d8d4b79869
Merge pull request #295 from jeanphilippegg/desluggification
Remove denote-desluggify
2024-03-23 06:46:12 +02:00
Jean-Philippe Gagné Guay 29eb111344 Remove denote-project-find 2024-03-22 23:44:31 -04:00
Jean-Philippe Gagné Guay 10cede7f5c Remove denote-desluggify 2024-03-22 23:22:42 -04:00
Protesilaos Stavrou 60ff790d33
Ensure that keywords are a list in denote-rename-file and denote-dired-rename-files
This is a follow-up to the change made by Jean-Philippe Gagné Guay in
pull request 293: <https://github.com/protesilaos/denote/pull/293>.
2024-03-18 07:42:13 +02:00
Protesilaos Stavrou 5789ca599b
Clarify denote-rename-file docs about keeping components not covered by denote-prompts 2024-03-18 07:33:27 +02:00
Protesilaos Stavrou 768464999f
Fix typo "sepator" to "separator" 2024-03-18 07:07:10 +02:00
Protesilaos Stavrou e4d070e028
Merge pull request #293 from jeanphilippegg/renaming-commands
Renaming commands
2024-03-18 07:03:55 +02:00
Protesilaos Stavrou e94cc50fd4
Make denote-file-name-slug-functions a user option; expand its documentation 2024-03-18 07:01:30 +02:00
Protesilaos Stavrou 13407bf7ba
Reword some statements in the manual about sluggification 2024-03-18 07:00:49 +02:00
Jean-Philippe Gagné Guay 11396de4c9 Simplify :safe declaration 2024-03-16 21:37:46 -04:00
Jean-Philippe Gagné Guay 090b4dbbef Only modify prompted components in renaming commands
Also make denote-dired-rename-files obey the order of the prompts in denote-prompts
2024-03-16 21:37:39 -04:00
Jean-Philippe Gagné Guay 4a94e03e5e Revert "Make denote-rename-file and denote-dired-rename-files prompt for signature, if it exists"
This reverts commit 232bd908ef.
2024-03-16 10:18:40 -04:00
Protesilaos Stavrou 2e1d5f318f
Document denote-retrieve-title-or-filename as a public function and use it
The function is stable. Others who extend Denote may find it useful.

Thanks to Peter Prevos for starting this effort in pull request 291:
<https://github.com/protesilaos/denote/pull/291>.
2024-03-16 13:27:50 +02:00
Protesilaos Stavrou 3efb404cf5
Merge pull request #291 from pprevos/main
Make denote--retrieve-title-or-filename public
2024-03-16 13:19:40 +02:00
Protesilaos Stavrou a71f042696
Upcase the operative term in prompts while renaming
This makes it easier to scan the prompt while renaming a file. More so
if there are multiple prompts.
2024-03-16 13:16:39 +02:00
Protesilaos Stavrou 232bd908ef
Make denote-rename-file and denote-dired-rename-files prompt for signature, if it exists
This is a case where we do not want to unconditionally remove the
signature when 'denote-prompts' does not include a signature prompt.
Signatures only exist in the file name, not any front matter, so we
want to give the user the chance to decide what to do with an existing
one while renaming the file.

Files without a signature are not affected by this change.
2024-03-16 12:22:32 +02:00
Peter Prevos e2247be527 Make denote--retrieve-title-or-filename public 2024-03-16 18:56:07 +11:00
Protesilaos Stavrou b945fed027
Add commands denote-rename-{add,remove}-signature 2024-03-14 16:30:38 +02:00
Protesilaos Stavrou 8505a48ecf
Document that denote-rename-{add,remove}-keywords run the denote-after-rename-file-hook 2024-03-14 16:25:27 +02:00
Protesilaos Stavrou fa8bda2cab
Use denote-link-markdown-follow only if there is a link
Otherwise, we are breaking general markdown-mode functionality.

Thanks to pmenair for bringing this matter to my attention in issue
290: <https://github.com/protesilaos/denote/issues/290>.
2024-03-14 15:50:39 +02:00
Protesilaos Stavrou 1718cac272
Document how to create a new note in any directory
This is in response to a question by Zhenxu Xu in issue 289:
<https://github.com/protesilaos/denote/issues/289>.
2024-03-13 12:44:06 +02:00
Protesilaos Stavrou 841af5baaa
Rephrase the doc string of denote-filetype-heuristics 2024-03-13 12:30:15 +02:00
Protesilaos Stavrou e14fe436d3
Avoid needless 'buffer-file-name' function calls in 'denote-link' 2024-03-13 12:11:22 +02:00
Protesilaos Stavrou 3e7273953a
Reinstate denote-project-find function for project/xref to work properly
We had removed this in commit ac0c361, thinking it was not necessary,
though Alan Schmitt reported a case where we actually needed this
functionality. This was reported in issue 283:
<https://github.com/protesilaos/denote/issues/283>.

Thanks to Jean-Philippe Gagné Guay for identifying the regression and
for taking the initiative to bring back the feature in pull request
286: <https://github.com/protesilaos/denote/pull/286>. We cannot merge
that one because it includes other in-development snippets.
2024-03-13 09:18:34 +02:00
Protesilaos Stavrou e0d67485c0
Fix inconsistency in the implementation of denote--edit-front-matter-p
The doc string described the desired behaviour.

Thanks to mentalisttraceur for reporting this in issue 288:
<https://github.com/protesilaos/denote/issues/288>.
2024-03-13 09:04:23 +02:00
Protesilaos Stavrou e9f418968b
Define more faces for fine-grained control of the identifier in Dired
Thanks to mentalisttraceur for suggesting the idea in issue 276:
<https://github.com/protesilaos/denote/issues/276>.
2024-03-11 10:53:58 +02:00
Protesilaos Stavrou 5f7e8f50da
Allow safe buffer-local values for denote-known-keywords 2024-03-11 10:25:52 +02:00
Protesilaos Stavrou 928c1b4a8c
Allow safe buffer-local values for denote-infer-keywords 2024-03-11 10:25:35 +02:00
Protesilaos Stavrou 88c80736fa
Fix docstring of denote-retrieve-filename-title
Other mentions of this are correct, as is the intent expressed in the
code.

Thanks to mentalisttraceur for bringing this matter to my attention in
issue 275: <https://github.com/protesilaos/denote/issues/275>.
2024-03-11 10:21:42 +02:00
Protesilaos Stavrou abbe7721de
Prevent mutation of keywords
Thanks to mentalisttraceur for explaining this in issue 270:
<https://github.com/protesilaos/denote/issues/270>.
2024-03-06 10:29:42 +02:00
Protesilaos Stavrou c320c6cccf
Make version 2.3.0 be the current development target 2024-03-05 11:54:58 +02:00
Protesilaos Stavrou 53fee204b8
Add :link to defcustom of denote-after-new-note-hook 2024-03-05 11:52:14 +02:00
Protesilaos Stavrou 3628cfa514
Add :link to defcustom of denote-after-rename-file-hook 2024-03-05 11:51:46 +02:00
Protesilaos Stavrou 92a6d8cd8d
Add denote-files-matching-regexp-prompt to denote-prompts-with-history-as-completion 2024-03-05 11:47:07 +02:00
Protesilaos Stavrou 7e8d70ae61
Use correct version for new user option 2024-03-05 08:18:25 +02:00
Protesilaos Stavrou 334f5675f7
Revert ef71032 by adding option to toggle history completion for title, signature prompts
It is better to keep what we introduced in a previous version than to
remove it outright. Those who do not find such completion useful can
simply disable it. If there are any issues with the reliability of
history entries, we can assess our options and act accordingly.
2024-03-05 08:15:55 +02:00
Protesilaos Stavrou d230b435d0
Merge pull request #268 from brabalan/rename-buffer-keywords
rename-buffer: really retrieve keywords for non-text files
2024-03-04 13:34:51 +02:00
Alan Schmitt 46d7ff1bef rename-buffer: really retrieve keywords for non-text files 2024-03-04 12:22:56 +01:00
Protesilaos Stavrou b08cba4b8f
Fix typo in a comment 2024-02-29 13:13:28 +02:00
Protesilaos Stavrou 8e30eb435c
Revise comment about denote-file-prompt 2024-02-29 09:43:20 +02:00
Protesilaos Stavrou a0796ef2d3
Simplify denote-file-prompt and make it always add absolute paths to its history 2024-02-29 09:42:42 +02:00
Protesilaos Stavrou bb4fda2f1f
Use more specific prompts in 'denote-add-front-matter' 2024-02-29 09:26:48 +02:00
Protesilaos Stavrou c50167d03b
Make denote-keywords-add prompt more specific 2024-02-29 09:26:35 +02:00
Protesilaos Stavrou d05e6b8da0
Tweak default prompt text of 'denote-keywords-prompt' 2024-02-29 09:26:26 +02:00
Protesilaos Stavrou f8a63fbc52
Tweak default prompt text of 'denote-signature-prompt' 2024-02-29 09:18:59 +02:00
Protesilaos Stavrou 3c1662db48
Tweak default prompt text of 'denote-title-prompt' 2024-02-29 09:16:28 +02:00
Protesilaos Stavrou 970b06c360
Make 'denote-link-or-create' not fail if there are no files (also see 8b6c019) 2024-02-29 09:13:15 +02:00
Protesilaos Stavrou 8b6c01915b
Make 'denote-file-prompt' not choke on an empty 'denote-directory-files' return value 2024-02-29 09:12:48 +02:00
Protesilaos Stavrou 6a486173a5
Reinstate relative file paths in 'denote-file-prompt'
This affects every Denote command that prompts for a file (e.g. to
link to it).

Previous versions of Denote had this feature, but it was depending on
a project.el code that did not do exactly what we were expecting.

With Jean-Philippe Gagné Guay we tried to relativise file paths using
display properties, but could not get the completion highlights to
work correctly. This was discussed in pull request 239, with input
from Mark Olson: <https://github.com/protesilaos/denote/pull/239>. A
similar request for relative file names was considered in issue 233
with the participation of Vick (VicZz):
<https://github.com/protesilaos/denote/issues/233>.
2024-02-29 08:40:21 +02:00
Protesilaos Stavrou ac0c361385
Remove the denote "modules" integration
This was done upon the request of Noboru Ota (nobiot), who is the
author of this code. The discussion is part of issue 264:
<https://github.com/protesilaos/denote/issues/264>.
2024-02-29 08:31:29 +02:00
Protesilaos Stavrou d6da5ba074
Make denote-rename-buffer--format work with files that have no front matter
Thanks to Alan Schmitt for reporting the relevant issue with PDFs and
for commenting on the code I suggested. This was done in issue 261:
<https://github.com/protesilaos/denote/issues/261>.
2024-02-29 07:48:59 +02:00
Protesilaos Stavrou ef71032d6f
Stop using minibuffer completion for titles and signatures 2024-02-29 07:46:46 +02:00
Protesilaos Stavrou 864320c4eb
Define commands to convert links from denote: to file: and vice versa
I am rewriting the relevant entry from the manual because it was not
fully developed. What we have here should be more robust.
2024-02-28 15:42:29 +02:00
Protesilaos Stavrou 88103f73fd
Use less confusing names for navigation in denote-backlinks-mode 2024-02-25 09:55:17 +02:00
Protesilaos Stavrou be5670eb45
Make the denote-backlinks-mode non-interactive
We do not want to confuse users with similarly named commands. This
mode is an internal implementation detail. If anyone needs to run
manually, they are probably doing something out-of-the-ordinary, in
which case we can assume they know how to (funcall major-mode).
2024-02-25 09:54:00 +02:00
Protesilaos Stavrou daf823850d
Add TODO for moving "modules" out of denote.el 2024-02-25 07:22:37 +02:00
Protesilaos Stavrou 3cc333b978
Remove another TODO that we will not work on 2024-02-25 07:21:13 +02:00
Protesilaos Stavrou 6c0ad54f8a
Remove TODO that we will not work on 2024-02-25 07:20:41 +02:00
Protesilaos Stavrou f2ff5efadd
Reinstate support for vc-rename-file in denote-rename-file-and-buffer 2024-02-25 07:18:57 +02:00
Protesilaos Stavrou 111aea86ef
Clarify a comment about a possible change to 'denote-directory' conditionality 2024-02-25 07:16:27 +02:00
Protesilaos Stavrou 8fa603e06b
Merge pull request #263 from jeanphilippegg/remove-parameter
Make denote-link-description-function require a function with only one argument
2024-02-24 12:58:30 +02:00
Jean-Philippe Gagné Guay 7de413b1ea Make denote-link-description-function require a function with only one argument 2024-02-23 19:44:08 -05:00
Protesilaos Stavrou a5d9d919db
Merge pull request #260 from vedang/fix-missing-links-edge-case
Fix edge-cases when inserting missing links via org-dblock
2024-02-23 08:22:37 +02:00
Protesilaos Stavrou f3daeb2eda
Add comments to a sample code snippet to make it more obvious 2024-02-22 16:10:28 +02:00
Protesilaos Stavrou fa617d494b
Add a TODO about examples for denote-link-description-function 2024-02-22 16:09:57 +02:00
Protesilaos Stavrou ba5d3ef7ef
Document in the manual all the new link description/format variables and functions 2024-02-22 16:09:28 +02:00
Protesilaos Stavrou cbf67641b9
Update definition and docs of denote-link-description-with-signature-and-title 2024-02-22 16:09:00 +02:00
Protesilaos Stavrou afd2f27b1a
Fix a typo 2024-02-22 16:00:32 +02:00
Protesilaos Stavrou 2755448710
Make denote-link-signature-format public 2024-02-22 16:00:24 +02:00
Vedang Manerikar 55dcf234bd Fix edge-cases when inserting missing links via org-dblock
To reproduce the problem: open a new note and while it is empty, try
to insert and populate an org dblock of type "denote-missing-links".

This leads to the following stack-trace:

```
Debugger entered--Lisp error: (wrong-type-argument stringp 65)
  file-name-nondirectory(65)
  file-name-extension(65 :period)
  denote-get-file-extension(65)
  denote-get-file-extension-sans-encryption(65)
  denote-filetype-heuristics(65)
  denote-link-description-with-signature-and-title(65 nil)
  denote--link-get-description(65)
  #f(compiled-function (file) #<bytecode -0x3aa12408d80ef11>)(65)
  mapc(#f(compiled-function (file) #<bytecode -0x3aa12408d80ef11>) "All links matching ‘reference/2024012’ are present")
  denote-link--prepare-links("All links matching ‘reference/2024012’ are present" org nil :no-other-sorting)
  denote-link--insert-links("All links matching ‘reference/2024012’ are present" org nil :no-other-sorting)
  org-dblock-write:denote-missing-links((:name "denote-missing-links" :regexp "reference/2024012" :indentation-column 0 :content #("\n" 0 1 (org-fold-core-fontified t fontified t))))
```

There are two issues in the underlying code:

1. When `denote-org-extras-dblock--get-missing-links` finds 0
missing-links, it returns with a string (return value of `message`)
instead of with an empty list.

2. When there are 0 pre-existing denote links in the current
buffer, `(denote-link--expand-identifiers
denote-org-link-in-context-regexp)` returns nil. This sets
`linked-files` value to `nil` and short-circuits the `if-let` when it
should not.

This commit fixes these two issues.
2024-02-21 22:26:26 +05:30
Protesilaos Stavrou ce7cdb5b21
Add a wishlist section to the manual
This replaces the "things to do" we had before. These are not "to do"
per se. We want to think about them and check if they are worth doing.
2024-02-18 08:32:37 +02:00
Protesilaos Stavrou 11bc6c1371
Remove needless empty space 2024-02-18 08:32:26 +02:00
Protesilaos Stavrou b7a4816d59
Make minor tweaks to the "Contributing" section in the manual 2024-02-18 08:10:03 +02:00
Protesilaos Stavrou c6bac31d56
Remove section from the manual that is out-of-date
We do not need this type of information in the manual, anyway.
2024-02-18 08:05:49 +02:00
Protesilaos Stavrou f2d3c6c254
Update the manual's acknowledgements (per commit e8d4a83)
The change done in commit e8d4a83 is about the placement of one
parenthesis. The author does not need to assign copyright to the Free
Software Foundation.
2024-02-18 06:45:50 +02:00
Protesilaos Stavrou f7dcf403bf
Merge pull request #258 from jarofromel/fix-date-parsing
Fix condition in denote-parse-date
2024-02-18 06:44:53 +02:00
random e8d4a8397d fix brackets in denote-parse-date
previous version returned always current-time
2024-02-17 16:14:27 +01:00
Protesilaos Stavrou 6ecadb3e3f
Document how to convert 'denote:' links to 'file:' links 2024-02-17 09:54:36 +02:00
Protesilaos Stavrou 979cb7a0fa
Move section about denote-journal-extras further up 2024-02-17 08:52:49 +02:00
Protesilaos Stavrou 19fd62fb6b
Fix critical typo that broke name of user option 2024-02-15 15:32:22 +02:00
Protesilaos Stavrou d28f66aa71
Make denote--add-prompts prepend ADDITIONAL-PROMPTS
This way we retain the original behaviour of the convenience
functions, such as 'denote-type', which first prompt for what they are
about.
2024-02-15 15:30:41 +02:00
Protesilaos Stavrou ae53d463ad
Make denote-keywords-{add,remove} accept an optional SAVE-BUFFER argument 2024-02-15 08:55:54 +02:00
Protesilaos Stavrou 76d6101ab5
Update all commands that build on denote-rename-file-using-front-matter (per commit 58568d3) 2024-02-15 08:46:59 +02:00
Protesilaos Stavrou 58568d3be5
Add SAVE-BUFFER arg to denote-rename-file-using-front-matter and conform with denote-rename-no-confirm 2024-02-15 08:45:45 +02:00
Protesilaos Stavrou 69408a5ef8
Remove needless private helper function 2024-02-15 08:45:02 +02:00
Protesilaos Stavrou b82da20d5d
Clarify that all convenience commands append to the denote-prompts 2024-02-15 07:56:47 +02:00
Protesilaos Stavrou 79e5ec02d3
Update the documentation of denote-keywords-{add,remove}; group as "rename" 2024-02-15 07:53:39 +02:00
Protesilaos Stavrou c6ef5ec335
Define aliases for denote-keywords-{add,remove} 2024-02-15 07:50:06 +02:00
Protesilaos Stavrou 5a53344bbd
Make denote-save-buffer-after-creation a user option and document it 2024-02-15 07:47:42 +02:00
Protesilaos Stavrou 489e59e61c
Move denote-keywords-{add,remove} where the renaming commands are 2024-02-15 07:36:00 +02:00
Protesilaos Stavrou 6035d777cd
Update the documentation of denote-after-new-note-hook 2024-02-15 07:31:41 +02:00
Protesilaos Stavrou 969367db4b
Update the documentation of the user option denote-rename-no-confirm 2024-02-15 07:31:24 +02:00
Protesilaos Stavrou 1646c43bc3
Make denote-keywords-{add,remove} honour denote-rename-no-confirm
We want all commands that rename the file to conform with this use
option. The idea is to have an "expert mode" for those who know what
is happening and do not need to go through any further prompts or
extra steps.
2024-02-15 07:25:59 +02:00
Protesilaos Stavrou f978dd746d
Acknowledge mattyonweb for commit edac333
The change is small and does not require copyright assignment to the
Free Software Foundation.
2024-02-15 06:30:01 +02:00
Protesilaos Stavrou 2f122d374f
Merge pull request #252 from mattyonweb/main
Kill "hidden" buffer generated by `denote-link-return-links`
2024-02-15 06:28:47 +02:00
mattyonweb 13a64f7709
Merge branch 'protesilaos:main' into main 2024-02-14 15:18:52 +01:00
Matteo Cavada edac33337c Avoid keeping opened buffers in denote-link-return-links 2024-02-14 15:16:00 +01:00
Protesilaos Stavrou 127c9a38a8
Add denote-after-rename-file-hook for all renaming operations 2024-02-14 15:57:00 +02:00
Protesilaos Stavrou bcdae9266a
Make denote-dired-rename-marked-files-with-keywords respect denote-rename-no-confirm 2024-02-14 15:56:23 +02:00
Protesilaos Stavrou 1d6ea5a6d9
Add the denote-rename-no-confirm to the sample configuration 2024-02-14 12:54:14 +02:00
Protesilaos Stavrou 1cdb49e227
Merge branch 'rename-honours-denote-prompts' of github.com:protesilaos/denote into rename-honours-denote-prompts 2024-02-14 12:49:33 +02:00
Protesilaos Stavrou ad13d32348
Clarify that absent denote-prompts mean nil for relevant denote-rename-file arguments 2024-02-14 12:48:21 +02:00
Protesilaos Stavrou cd109c1e8c
Update the documentation of denote-dired-rename-marked-files 2024-02-14 12:48:21 +02:00
Protesilaos Stavrou 453b241d58
Make denote-dired-rename-files honour the denote-prompts (same as denote-rename-file) 2024-02-14 12:48:21 +02:00
Protesilaos Stavrou ecd18be7a4
Ensure double spacing in a sentence of denote-rename-file docstring 2024-02-14 12:48:21 +02:00
Protesilaos Stavrou 7f76d52e80
Complete the documentation of denote-rename-file, noting all modalities of interaction 2024-02-14 12:48:21 +02:00
Protesilaos Stavrou 8faf120dff
Broaden the scope of denote-rename-no-confirm to save buffers as well
We effectively make this an "expert mode".
2024-02-14 12:48:20 +02:00
Protesilaos Stavrou 77eafb2dfe
Start updating the manual for denote-rename-file (WORK-IN-PROGRESS) 2024-02-14 12:48:20 +02:00
Protesilaos Stavrou a1e1e21251
Fix typo in denote-rename-file doc string 2024-02-14 12:48:20 +02:00
Protesilaos Stavrou c5f8ef1d8a
Add TODO about possible tweak to denote-rename-file 2024-02-14 12:48:20 +02:00
Protesilaos Stavrou 4cce51a092
Change how denote-rename-file passes DATE to denote-create-unique-file-identifier (per e9e9c8e) 2024-02-14 12:48:20 +02:00
Protesilaos Stavrou 02a1645f95
Tweak the behaviour of denote-create-unique-file-identifier 2024-02-14 12:48:20 +02:00
Protesilaos Stavrou 779dfb0439
Update denote-rename-file doc string to describe its current behaviour 2024-02-14 12:48:20 +02:00
Vedang Manerikar 96d432f746
Update denote-create-* commands to respect denote-prompts
This commit modifies the following functions:

- `denote-type`
- `denote-date`
- `denote-subdirectory`
- `denote-template`
- `denote-signature`

Instead of overwriting the value of `denote-prompts`, this change adds
the specific symbol to the existing value of `denote-prompts`.
2024-02-14 12:48:20 +02:00
Protesilaos Stavrou 8e18c5664d
Add WORK-IN-PROGRESS implementation of 'denote-rename-file' that honours 'denote-prompts'
I have to stop because my hand is in pain... But this is already
looking promising. Putting it in a new branch for now to pick it up
later.
2024-02-14 12:48:20 +02:00
Protesilaos Stavrou 357c363242
Clarify that absent denote-prompts mean nil for relevant denote-rename-file arguments 2024-02-14 12:47:00 +02:00
Protesilaos Stavrou 37508c99d4
Update the documentation of denote-dired-rename-marked-files 2024-02-14 12:43:43 +02:00
Protesilaos Stavrou ab20f4b0af
Make denote-dired-rename-files honour the denote-prompts (same as denote-rename-file) 2024-02-14 12:42:04 +02:00
Protesilaos Stavrou 6179fb7541
Ensure double spacing in a sentence of denote-rename-file docstring 2024-02-14 12:26:13 +02:00
Protesilaos Stavrou ce9e2dd1bf
Complete the documentation of denote-rename-file, noting all modalities of interaction 2024-02-14 12:22:36 +02:00
Protesilaos Stavrou 764125525e
Broaden the scope of denote-rename-no-confirm to save buffers as well
We effectively make this an "expert mode".
2024-02-14 12:22:00 +02:00
Protesilaos Stavrou 561911e747
Use the new 'denote-parse-date' throughout denote-journal-extras
It handles all the cases covered by the previous 'denote-journal-extras--get-date'.
2024-02-14 10:02:33 +02:00
Protesilaos Stavrou f1036f9af3
Remove needless comment about possible tweak to Org ascii export 2024-02-14 09:54:30 +02:00
Protesilaos Stavrou 0c5a044019
Fix file extension of Org markdown export
We should not be adding the .md suffix because the export mechanism
does not also convert the target file into Markdown format. Instead,
we must preserve the original path.
2024-02-14 09:52:47 +02:00
Protesilaos Stavrou b0eee438c1
Make Org export correctly add the search to the anchor
This is relevant when the 'denote:' link has an optional search
extension to jump to a location (same as with the standard Org 'file:'
link type). Denote uses this facility with the command
'denote-org-extras-link-to-heading', which is part of the new optional
extension 'denote-org-extras.el'.

Thanks to @fingerknight for noting that the search extension for not
part of the exported link anchor. This was done in issue 250:
<https://github.com/protesilaos/denote/issues/250>.
2024-02-14 09:50:20 +02:00
Protesilaos Stavrou 37d24168ba
Update the manual's acknowledgements.
This is in light of the discussion that eventually led to the removal
of the user option denote-user-enforced-denote-directory.

Discussed in issue 244 with the participation of Jean-Philippe Gagné
Guay and Mirko Hernandez: <https://github.com/protesilaos/denote/issues/244>

Done in pull request 246, by Jean-Philippe Gagné Guay:
<https://github.com/protesilaos/denote/pull/246>

Thanks to everyone involved!
2024-02-14 08:40:00 +02:00
Jean-Philippe Gagné Guay a48a1da067
Make denote-user-enforced-denote-directory an alias of denote-directory 2024-02-14 08:36:12 +02:00
Jean-Philippe Gagné Guay afe1f37d4f
Remove denote-user-enforced-denote-directory 2024-02-14 08:36:12 +02:00
Protesilaos Stavrou 6e050e4268
Start updating the manual for denote-rename-file (WORK-IN-PROGRESS) 2024-02-13 10:33:41 +02:00
Protesilaos Stavrou 5d4c78361a
Fix typo in denote-rename-file doc string 2024-02-13 10:32:59 +02:00
Protesilaos Stavrou b02bf9d7c2
Add TODO about possible tweak to denote-rename-file 2024-02-13 10:03:44 +02:00
Protesilaos Stavrou 16b48265e2
Change how denote-rename-file passes DATE to denote-create-unique-file-identifier (per e9e9c8e) 2024-02-13 08:42:25 +02:00
Protesilaos Stavrou e9e9c8ef2b
Tweak the behaviour of denote-create-unique-file-identifier 2024-02-13 08:41:44 +02:00
Protesilaos Stavrou aa865fa0d9
Update denote-rename-file doc string to describe its current behaviour 2024-02-13 08:22:26 +02:00
Protesilaos Stavrou 60cf6b6125
Acknowledge maxbrieiev for commit 7d18b7b
This was done in pull request 249:
<https://github.com/protesilaos/denote/pull/249>.

The change is below the ~15 line limit and, as such, the author does
not need to assign copyright to the Free Software Foundation.
2024-02-13 08:22:26 +02:00
Max ab04f5b774
Fix typo in variable name in documentation
- Corrected variable name from `user-enforced-denote-directory` to
`denote-user-enforced-denote-directory`.

- Removed the paragraph that referred to its usage in
`denote-org-extras-extract-org-subtree' function. Apparently, this
function does not use `denote-user-enforced-denote-directory`
variable.
2024-02-13 08:22:26 +02:00
Protesilaos Stavrou 779ef33436
Merge pull request #248 from vedang/rename-honours-denote-prompts
Update denote-create-* commands to respect `denote-prompts`
2024-02-13 07:18:11 +02:00
Vedang Manerikar adf8c6fdc8 Update denote-create-* commands to respect denote-prompts
This commit modifies the following functions:

- `denote-type`
- `denote-date`
- `denote-subdirectory`
- `denote-template`
- `denote-signature`

Instead of overwriting the value of `denote-prompts`, this change adds
the specific symbol to the existing value of `denote-prompts`.
2024-02-12 16:45:51 +05:30
Protesilaos Stavrou 38ada4ecba
Acknowledge maxbrieiev for commit 7d18b7b
This was done in pull request 249:
<https://github.com/protesilaos/denote/pull/249>.

The change is below the ~15 line limit and, as such, the author does
not need to assign copyright to the Free Software Foundation.
2024-02-12 09:34:33 +02:00
Protesilaos Stavrou 993a4baa2c
Merge pull request #249 from maxbrieiev/doc-typo
Fix typo in variable name in documentation
2024-02-12 09:32:57 +02:00
Max 7d18b7bbac Fix typo in variable name in documentation
- Corrected variable name from `user-enforced-denote-directory` to
`denote-user-enforced-denote-directory`.

- Removed the paragraph that referred to its usage in
`denote-org-extras-extract-org-subtree' function. Apparently, this
function does not use `denote-user-enforced-denote-directory`
variable.
2024-02-12 00:16:09 +02:00
Protesilaos Stavrou 9a764923bc
Add WORK-IN-PROGRESS implementation of 'denote-rename-file' that honours 'denote-prompts'
I have to stop because my hand is in pain... But this is already
looking promising. Putting it in a new branch for now to pick it up
later.
2024-02-11 10:49:14 +02:00
Protesilaos Stavrou 55e923ffc5
Make denote-format-file-name also accept nil TITLE and SIGNATURE
We do not want to limit this to empty strings, because there are cases
we will need to arrange for the return value to be that. Whereas we
get nil for free.
2024-02-11 10:46:42 +02:00
Protesilaos Stavrou 121ed6d04d
Use the new 'denote-get-identifier' where appropriate 2024-02-11 10:44:36 +02:00
Protesilaos Stavrou 91f51e6cab
Use the correct number for the {{{development-version}}} in the docs 2024-02-11 10:40:51 +02:00
Protesilaos Stavrou a2229e03ff
Simplify 'denote-parse-date' now that 'denote-valid-date-p' does the work 2024-02-11 10:36:30 +02:00
Protesilaos Stavrou 07e8d0bf90
Clarify the documentation of denote-valid-date-p 2024-02-11 10:35:21 +02:00
Protesilaos Stavrou 9dced4b7fd
Harden the conditionality of denote-valid-date-p 2024-02-11 10:26:48 +02:00
Protesilaos Stavrou d862b65526
Define denote-get-identifier function
The idea is to streamline how we do the 'format-time-string', so that
we do not get any weird bugs.
2024-02-11 10:05:16 +02:00
Protesilaos Stavrou 2339e51633
Rename 'denote--valid-date' to 'denote-valid-date-p' 2024-02-11 09:56:40 +02:00
Protesilaos Stavrou af17af9f2b
Move a helper function above where it is first called
This makes it easier to follow the sequence of definitions and
calls (a style we generally try to follow).
2024-02-11 08:19:59 +02:00
Protesilaos Stavrou 675f5e44ba
Add denote-format-string-for-org-front-matter 2024-02-11 08:17:09 +02:00
Protesilaos Stavrou 6c503ed953
Rename denote-surround-with-quotes to denote-format-string-for-md-front-matter
This is to ensure the consistency of names in functions we use for
related tasks.
2024-02-11 08:15:39 +02:00
Protesilaos Stavrou e66f275c15
Ensure that denote-surround-with-quotes does not return "nil" if S is nil
In that scenario, we want to return a literal emptry string. In
practice, this means that when we format the front matter, a nil value
for the title is inserted thus:

    ---
    title: ""
    ---

Not like this:

    ---
    title: "nil"
    ---
2024-02-11 08:12:00 +02:00
Protesilaos Stavrou 9353d23aa4
Update the documentation of denote-org-extras-extract-org-subtree
This now reflects the refinements made by Vedang Manerikar to honour
the user option 'denote-prompts'. Done in pull request 241:
<https://github.com/protesilaos/denote/pull/241>.
2024-02-11 07:10:22 +02:00
Protesilaos Stavrou 2ba496bbf0
Merge pull request #241 from vedang/add-prompts-when-extracting-org-subtree
Use denote-prompts to prompt user when extracting org subtree
2024-02-11 07:09:23 +02:00
Protesilaos Stavrou 3a1d857850
Define denote-link-markdown-follow for C-c C-o in markdown-mode buffers 2024-02-10 15:53:13 +02:00
Protesilaos Stavrou 571abd42e8
Document denote-journal-extras-link-or-create-entry
Thanks to Alan Schmitt for contributing this command in pull request
243: <https://github.com/protesilaos/denote/pull/243>.
2024-02-10 08:49:22 +02:00
Protesilaos Stavrou 312ed56097
Merge pull request #243 from brabalan/journal-link-create
add denote-journal-extras-link-or-create-entry
2024-02-10 08:43:14 +02:00
Vedang Manerikar 799fc5d4d3 Use denote-prompts to prompt user when extracting org subtree
This change ensures that `denote-org-extras-extract-org-subtree`
behaves similar to the standard denote system when extracting existing
data into denotes.

Closes: #241
2024-02-09 20:31:55 +05:30
Protesilaos Stavrou 03f8a93b94
Fix a typo in the manual 2024-02-08 11:34:34 +02:00
Protesilaos Stavrou cc8ab0db83
Refine the documentation of denote-org-extras-extract-org-subtree 2024-02-06 07:33:51 +02:00
Protesilaos Stavrou 36ce5f8159
Merge pull request #240 from vedang/fix/changes-extract-org-subtree
Fix: Consider the CLOSED property of the org-heading for heading-date
2024-02-06 07:22:24 +02:00
Alan Schmitt 1be28e5b98 add denote-journal-extras-link-or-create-entry 2024-02-05 11:26:02 +01:00
Protesilaos Stavrou d769f445dd
Make stylistic tweaks to the heading about denote-explore
This is a package by Peter Prevos. The contribution to the manual was
done in pull request 242: <https://github.com/protesilaos/denote/pull/242>.
2024-02-05 11:41:03 +02:00
Protesilaos Stavrou 68b77a159b
Merge pull request #242 from pprevos/main
Added denote-explore package to manual
2024-02-05 11:39:21 +02:00
Protesilaos Stavrou 703f85b330
Merge pull request #237 from jeanphilippegg/cleanup
Cleanup and bug fix
2024-02-05 11:18:10 +02:00
Peter Prevos 7344d0c4e3 Added denote-explore package to manual 2024-02-05 06:48:38 +01:00
Vedang Manerikar c788b2f9f3 Fix: Consider the CLOSED property of the org-heading for heading-date
This property is automatically added to a task when we mark it as
DONE. If both DATE as well as CREATED are not available, this is a
valuable property to use when determining the date of the new note.
2024-02-01 10:20:01 +05:30
Protesilaos Stavrou 91f0208506
Define Org dynamic block to insert only missing links
This brings back a feature that was deprecated in version 2.2.0, but
makes changes to it so that (i) it is more limited in scope and (ii)
available as a standalone Org dynamic block.

Thanks to Stephen R. Kifer, Peter Prevos, and Elias Storms for the
discussion which made it clear to me that users do have a need for
such functionality:
<https://lists.sr.ht/~protesilaos/denote/%3C1db2104e-70bd-47f9-a7ed-b8d4bb370a7f%40app.fastmail.com%3E>.
2024-01-29 07:15:23 +02:00
Protesilaos Stavrou 92953e6eb6
Use nil argument in reverse condition of denote-org-extras-dblock--files 2024-01-29 03:20:49 +02:00
Protesilaos Stavrou f97b6c3c45
Declare mode in two denote-org-extras commands 2024-01-29 03:17:05 +02:00
Jean-Philippe Gagné Guay a02eca9847 Fix denote-find-link when called from a subdirectory 2024-01-28 11:27:20 -05:00
Jean-Philippe Gagné Guay eb13ba0231 Remove denote--command-with-default-title and use denote--command-with-features instead 2024-01-28 11:27:11 -05:00
Protesilaos Stavrou be24aafdfc
Merge pull request #236 from jeanphilippegg/linking-functions-outside-denote-directory
Linking functions can be used in files outside denote-directory
2024-01-28 17:49:47 +02:00
Jean-Philippe Gagné Guay 826cf968da Linking functions can be used in files outside denote-directory 2024-01-28 09:41:52 -05:00
Protesilaos Stavrou 69709f8e8a
Merge pull request #231 from jeanphilippegg/fixes
Various fixes
2024-01-27 07:46:21 +02:00
Jean-Philippe Gagné Guay 1da462420f Make denote--keyword-history an alias of denote-keyword-history 2024-01-26 22:52:19 -05:00
Jean-Philippe Gagné Guay b1da04bc30 Do not return nil when date is nil in denote-parse-date
Also use the same id for file name and front matter in denote--prepare-note
2024-01-26 22:48:54 -05:00
Jean-Philippe Gagné Guay 2261b7008a Fix denote-org-extras-dblock--get-file-contents 2024-01-26 22:27:27 -05:00
Jean-Philippe Gagné Guay b7eb017b02 Update docstrings and README.org about link descriptions 2024-01-26 22:21:23 -05:00
Protesilaos Stavrou 68121fdf0c
Document in the manual fix for needless C-u in silos (per commit fa5548f) 2024-01-25 06:56:59 +02:00
Protesilaos Stavrou 5eabd7745b
Clarify type of SILO argument when called from Lisp 2024-01-25 06:54:16 +02:00
Protesilaos Stavrou fa5548f766
Make silo commands not require superfluous prefix argument
This was a mistake. The intent was to run those commands without a
prefix argument.

Thanks to l-o-l-h for mentioning this in issue 216:
<https://github.com/protesilaos/denote/issues/216>.
2024-01-25 06:52:05 +02:00
Protesilaos Stavrou 1bd8e36f2f
Define compatibility aliases for all history variables (don't use 'define-obsolete-variable-alias')
The define-obsolete-variable-alias is producing a warning each time
Emacs runs about how the old symbol's value is copied to the new
symbol. We do not want this.

Thanks to Jean-Philippe Gagné Guay and Jousimies for mentioning this
in issue 224: <https://github.com/protesilaos/denote/issues/224>.
2024-01-25 06:44:55 +02:00
Protesilaos Stavrou 984c3feb24
Make denote-rename-buffer do nothing if there is no underlying file
If the buffer-file-name is nil, then we do not want to proceed because
'denote-file-has-identifier-p' will return an error.

This should fix the issue with epub files opened with nov.el, as
reported by arsaber101 in issue 229:
<https://github.com/protesilaos/denote/issues/229>.
2024-01-25 06:31:25 +02:00
Protesilaos Stavrou 886c24db07
Move helper function before its first call 2024-01-25 06:27:04 +02:00
Protesilaos Stavrou 941303ee23
Move helper for Org link to heading into denote.el; make adaptations 2024-01-23 07:59:39 +02:00
Protesilaos Stavrou a9fd4273f7
Use more appropriate helper to get link description
Thanks to Jean-Philippe Gagné Guay for pointing this out in issue 224:
<https://github.com/protesilaos/denote/issues/224>.
2024-01-23 07:50:22 +02:00
Protesilaos Stavrou e4fcef956b
Make denote-org-extras.el commands only work in Org mode
Thanks to Jean-Philippe Gagné Guay for pointing this out in issue 224:
<https://github.com/protesilaos/denote/issues/224>.
2024-01-23 07:41:20 +02:00
Protesilaos Stavrou edbc0e4322
Absorb denote-org-dblock.el into denote-org-extras.el 2024-01-23 07:34:13 +02:00
Protesilaos Stavrou 5e6a97d8aa
Refine the denote-org-extras--outline-prompt text 2024-01-20 15:24:17 +02:00
Protesilaos Stavrou 5b959af6ae
Reword the manual's introduction to denote-org-extras-extract-org-subtree 2024-01-20 12:54:47 +02:00
Protesilaos Stavrou 847323c935
Move documentation about denote-region command further up 2024-01-20 11:40:33 +02:00
Protesilaos Stavrou 2b91799ca3
Define denote-org-extras-extract-org-subtree command and document it 2024-01-20 11:39:25 +02:00
Protesilaos Stavrou 8efc04c48b
Add denote-parse-date function 2024-01-20 11:25:38 +02:00
Protesilaos Stavrou 2f697cbe60
Make denote-sort-component-history public
Same idea as with commit 90823f7.
2024-01-20 10:23:06 +02:00
Protesilaos Stavrou fd801ef5e7
Make denote-silo-extras-directory-history public
Same idea as with commit 90823f7.
2024-01-20 10:22:00 +02:00
Protesilaos Stavrou 90823f7bd0
Make all denote.el history variables public
They should be public because they pertain to user interactions (via
the minibuffer). The user can modify their value.
2024-01-20 10:20:36 +02:00
Protesilaos Stavrou e84dec73e9
BREAKING: rename denote-org.el to denote-org-extras.el
The new name better describes the role of this file.
2024-01-20 10:06:13 +02:00
Protesilaos Stavrou a4f11d3a77
Simplify regexp in denote--trim-right-token-characters 2024-01-20 07:51:37 +02:00
Protesilaos Stavrou d21e5e0644
Merge pull request #227 from jeanphilippegg/fix-denote--trim-right-token-characters
Fix denote--trim-right-token-characters
2024-01-20 07:48:38 +02:00
Jean-Philippe Gagné Guay 3110c6dd16 Fix denote--trim-right-token-characters 2024-01-20 00:41:33 -05:00
Protesilaos Stavrou 48b8abc43d
Merge pull request #226 from jeanphilippegg/empty-region-and-links
Fix denote-link-description-with-signature-and-title
2024-01-20 07:20:01 +02:00
Protesilaos Stavrou e11a468873
Merge pull request #225 from jeanphilippegg/file-name-rules
Enforce other rules in the file name
2024-01-20 07:19:00 +02:00
Protesilaos Stavrou cfd8961ac4
Mention 'denote-link' in 'denote-org-link-to-heading' doc string 2024-01-20 07:14:43 +02:00
Protesilaos Stavrou cdb8a19116
Document the denote-org-link-to-heading command in the manual 2024-01-20 07:12:49 +02:00
Protesilaos Stavrou 524203e403
Make org-store-link also capture the heading text as part of the description
This is subject to the new user option denote-org-store-link-to-heading,
which defaults to a non-nil value.
2024-01-20 07:11:02 +02:00
Jean-Philippe Gagné Guay eaa00f2fd4 Make denote-link-description-with-signature-and-title return the active region even if empty 2024-01-20 00:10:20 -05:00
Protesilaos Stavrou 8faccbd216
Mention denote-org-store-link-to-heading in the link handler 2024-01-20 07:07:40 +02:00
Jean-Philippe Gagné Guay 6a1e7a11d1 Add denote--remove-dot-characters and denote--trim-right-token-characters and use them in denote-sluggify 2024-01-20 00:07:09 -05:00
Protesilaos Stavrou 3e6bf5be6c
Use denote-link-ol-get-heading instead of the underlying Org function
This will help us with consistency.
2024-01-20 07:06:14 +02:00
Protesilaos Stavrou ff61ed7fed
Define denote-link-ol-get-heading function 2024-01-20 07:05:39 +02:00
Protesilaos Stavrou 158d94735f
Expand denote-org-link-to-heading doc string to explain some technicalities 2024-01-20 06:59:05 +02:00
Protesilaos Stavrou e026e60fd9
Update denote-org-store-link-to-heading doc to mention org-insert-link 2024-01-20 06:56:56 +02:00
Protesilaos Stavrou 423122e5e6
Clarify that org-insert-link is needed after org-store-link 2024-01-20 06:54:41 +02:00
Protesilaos Stavrou 94168f2fd5
Add missing vindex for denote-org-store-link-to-heading
This is metadata that is used by the Info manual to generate the
indices that point to the given sections of the document.
2024-01-20 06:38:43 +02:00
Protesilaos Stavrou a86267786b
Add denote-org.el, which defines 'denote-org-link-to-heading' command 2024-01-20 06:37:03 +02:00
Protesilaos Stavrou cc02a5160d
Merge branch 'link-to-org-headings' of github.com:protesilaos/denote into link-to-org-headings 2024-01-20 05:54:03 +02:00
Protesilaos Stavrou 2e04e409ae
Fix typo in the manual 2024-01-20 05:53:30 +02:00
Protesilaos Stavrou 0d27b6ef20
Rename user option to denote-org-store-link-to-heading and document it better
The new name is more descriptive and better describes what the effect is.
2024-01-20 05:53:30 +02:00
Protesilaos Stavrou 10d332bb29
Expand the documentation of user option to link to Org heading 2024-01-20 05:53:30 +02:00
Protesilaos Stavrou 4651a880d6
Rename the function that returns an Org heading ID 2024-01-20 05:53:30 +02:00
Protesilaos Stavrou ad4532e2fc
Make links to Org headings only work for Org
We do not want to create a PROPERTIES drawer in txt files, for example.
2024-01-20 05:53:30 +02:00
Protesilaos Stavrou c650b9901d
Add user option and concomitant functionality to link to Org headings 2024-01-20 05:53:30 +02:00
Protesilaos Stavrou 10b9b984e4
Add denote--completion-table-no-sort
We might need it for something I have in the works. The idea is to
define a completion table which instructs the completion user
interface to not do any sorting of its own, while also defining a
completion category.
2024-01-20 05:52:02 +02:00
Protesilaos Stavrou 2ffc70bc29
Fix typo in the manual 2024-01-18 15:55:31 +02:00
Protesilaos Stavrou 76755e9a3c
Merge pull request #223 from jeanphilippegg/denote--replace-consecutive-token-characters
Always remove consecutives -,_ or = from file names
2024-01-18 15:50:34 +02:00
Protesilaos Stavrou fb1ed38229
Merge pull request #222 from jeanphilippegg/denote-link-description-function
New variable `denote-link-description-function` and some bug fixes
2024-01-18 15:50:29 +02:00
Protesilaos Stavrou e83a377d08
Merge pull request #221 from jeanphilippegg/denote--command-with-features
Add denote--command-with-features and denote-save-buffer-after-creation
2024-01-18 15:50:19 +02:00
Protesilaos Stavrou cc393d7616
Rename user option to denote-org-store-link-to-heading and document it better
The new name is more descriptive and better describes what the effect is.
2024-01-18 08:07:39 +02:00
Protesilaos Stavrou 2957fe832d
Expand the documentation of user option to link to Org heading 2024-01-18 07:49:39 +02:00
Protesilaos Stavrou 034427006d
Rename the function that returns an Org heading ID 2024-01-18 07:48:57 +02:00
Protesilaos Stavrou 3319970d08
Make links to Org headings only work for Org
We do not want to create a PROPERTIES drawer in txt files, for example.
2024-01-18 07:48:23 +02:00
Protesilaos Stavrou ae11205800
Add user option and concomitant functionality to link to Org headings 2024-01-18 07:35:42 +02:00
Protesilaos Stavrou 99709c7a62
Update development links 2024-01-17 04:41:40 +02:00
Jean-Philippe Gagné Guay d1ee270784 Add denote--replace-consecutive-token-characters and use it in denote-sluggify 2024-01-14 23:25:33 -05:00
Jean-Philippe Gagné Guay e715d68338 Add denote-link-description-function 2024-01-14 23:11:56 -05:00
Jean-Philippe Gagné Guay 8d3900f8bf Add denote--command-with-features and denote-save-buffer-after-creation
Replace denote--use-region-in-denote-command with denote-ignore-region-in-denote-command
2024-01-13 20:04:00 -05:00
Protesilaos Stavrou 728a7769b1
Merge branch 'main' of github.com:protesilaos/denote 2024-01-12 08:20:27 +02:00
Protesilaos Stavrou afc5f71217
Update copyright years 2024-01-12 08:19:55 +02:00
Protesilaos Stavrou 87518c2468
Merge pull request #219 from jeanphilippegg/revert-changes
Revert changes about denote-user-enforced-denote-directory
2024-01-08 06:53:17 +02:00
Jean-Philippe Gagné Guay 983c2e7ad4 Revert "Remove denote-user-enforced-denote-directory"
This reverts commit 49a060817b.
2024-01-06 22:22:13 -05:00
Jean-Philippe Gagné Guay f119f7dfbe Revert "Add clarification about obsolete denote-user-enforced-denote-directory"
This reverts commit 5e9b6b3bf0.
2024-01-06 22:22:04 -05:00
Protesilaos Stavrou 63aa505713
Placate the compiler about double-spacing between sentences 2024-01-05 15:41:46 +02:00
Protesilaos Stavrou bc0d3fbe73
Placate the compiler about double-spacing between sentences 2024-01-05 13:07:53 +02:00
Protesilaos Stavrou 9c5d490109
Fix broken link in the manual 2024-01-05 13:07:31 +02:00
Protesilaos Stavrou 4731e0ab0f
Merge pull request #217 from jeanphilippegg/denote-region
Make denote-region obey denote-prompts
2024-01-04 13:46:33 +02:00
Protesilaos Stavrou 6da2d7b2e4
Merge pull request #210 from jeanphilippegg/slug-functions
Slug functions
2024-01-04 13:45:11 +02:00
Protesilaos Stavrou 15736c648e
Merge pull request #208 from jeanphilippegg/denote-rename-file
Fix `denote-rename-file` when called with empty inputs
2024-01-04 13:44:37 +02:00
Jean-Philippe Gagné Guay ca1c534ac9 Make denote-region obey denote-prompts 2024-01-02 22:47:41 -05:00
Jean-Philippe Gagné Guay 63d25e0cfd Update README section on the file naming scheme 2024-01-02 18:03:12 -05:00
Jean-Philippe Gagné Guay c76eba3708 Refactor slug functions and denote-letter-case 2024-01-02 18:03:07 -05:00
Jean-Philippe Gagné Guay 083862d829 Use new denote--slug-no-punct-for-signature in denote-sluggify-signature 2024-01-01 17:51:29 -05:00
Jean-Philippe Gagné Guay c41d3427f8 Sort keywords outside denote-keywords-sort 2024-01-01 14:13:54 -05:00
Jean-Philippe Gagné Guay 7011c3894a Fix denote-directory-files 2024-01-01 13:49:22 -05:00
Jean-Philippe Gagné Guay 0fde4498e5 Simplify denote-keywords-prompt 2024-01-01 13:49:22 -05:00
Jean-Philippe Gagné Guay b5ef3f5481 Simplify denote-convert-file-name-keywords-to-crm 2024-01-01 13:49:16 -05:00
Jean-Philippe Gagné Guay 4ec5bfbd7b Make denote-rename-file prompts more consistent 2024-01-01 13:31:49 -05:00
Protesilaos Stavrou 5e9b6b3bf0
Add clarification about obsolete denote-user-enforced-denote-directory 2024-01-01 11:07:00 +02:00
Protesilaos Stavrou 3c3359feea
Merge pull request #211 from jeanphilippegg/user-enforced-denote-directory
Remove denote-user-enforced-denote-directory
2024-01-01 11:05:29 +02:00
Protesilaos Stavrou 143f6f65ef
Merge pull request #212 from jeanphilippegg/hidden-directories
Fix issue #209
2024-01-01 11:01:24 +02:00
Protesilaos Stavrou 0a0b63db8d
Acknowledge Wesley Harvey for commit 80c062f
The change is within the ~15 line limit and so Wesley Harvey does not
need to assign copyright to the Free Software Foundation.

That commit was done in pull request 207 on the GitHub mirror:
<https://github.com/protesilaos/denote/pull/207>.
2024-01-01 10:53:15 +02:00
Protesilaos Stavrou 688d075c04
Merge pull request #207 from wlharvey4/main
Fix to signature losing "="s when file is renamed.
2024-01-01 10:51:32 +02:00
Jean-Philippe Gagné Guay 5e348d429a Allow hidden files in parent directories of denote-directory 2023-12-28 16:28:49 -05:00
Jean-Philippe Gagné Guay 49a060817b Remove denote-user-enforced-denote-directory 2023-12-28 16:06:27 -05:00
wlharvey4 80c062f14c Fix to signature losing "="s when file is renamed.
Four file renaming commands may lose spaces (denoted by the "="
in existing filenames) when the user renames the file:

1. denote-rename-file
2. denote-dired-rename-files
3. denote-dired-rename-marked-files-with-keywords
4. denote-rename-file-using-front-matter

This is caused by the function `denote-sluggify-signature`, which
calls (indirectly) `denote--slug-no-punct`, which removes, among
many other characters, all "="s, which represent spaces.  These
spaces are thus lost even if the user does not change the
signature.

To remedy this situation, all "="s are turned into spaces before
being sent to `denote--slug-no-punct`, as spaces are not removed
by this function.  The function `denote--slug-put-equals` turns
these spaces into "="s at the end of the file-renaming operation.
2023-12-22 02:11:43 -08:00
Protesilaos Stavrou 4cf8b34e13
Answer FAQ about double #+title in Doom Emacs 2023-12-22 06:50:14 +02:00
Protesilaos Stavrou 5dfd77770e
Make denote-keywords-prompt accept optional INITIAL-KEYWORDS; let renaming commands use it
This is what we do with the title and signature prompts. Thanks to
babusri for pointing out the inconsistency in issue 204 on the GitHub
mirror: <https://github.com/protesilaos/denote/issues/204>.
2023-12-22 06:30:22 +02:00
Protesilaos Stavrou 7c79e89d1f
Make denote--edit-front-matter-p check if front matter is non-nil
We do not want to try to rewrite front matter if the given file type has
a nil value for its front matter. Furthermore, we do not want to make
the inclusion of front matter mandatory. Front matter is not a
requirement for Denote, as the file name is our point of reference.

Thanks to Glenna D. for reporting an error produced by
'denote-dired-rename-marked-files-with-keywords' in a scenario where
the front matter would be nil. This was done via a private channel
and the information is shared with permission.
2023-12-22 05:56:29 +02:00
Protesilaos Stavrou 2b208c5c88
Add denote-dired-rename-marked-files alias for denote-dired-rename-files 2023-12-21 12:51:02 +02:00
Protesilaos Stavrou 211c850c8a
Document denote-menu-bar-mode 2023-12-21 12:44:13 +02:00
Protesilaos Stavrou fcdac0f778
Acknowledge Glenna D. for commit 8146b43 2023-12-21 08:27:36 +02:00
Glenna D. 8146b436e1
Document how to add custom convenience commands to 'denote-command-prompt' 2023-12-21 08:26:20 +02:00
Protesilaos Stavrou ee58ae014d
Merge pull request #199 from jeanphilippegg/refactor
Refactor
2023-12-20 10:23:52 +02:00
Protesilaos Stavrou f770346729
Merge branch 'main' of git.sr.ht:~protesilaos/denote 2023-12-20 10:14:55 +02:00
Joseph Turner aa7bf58234
Enable Denote menu bar by default
This change means that merely loading denote.el causes :filter,
:visible, :active, :label, :suffix, and :selected forms (or their
aliases) in `denote--menu-contents' to be evaluated.

Currently, `denote--menu-contents' only contains expressions which
call `bound-and-true-p' and `derived-mode-p', so it's unlikely that
enabling the Denote menu bar by default will cause breakages.

If `denote--menu-contents' becomes complex, I suggest reverting this
commit, and then suggesting that users add the following to init.el:

(denote-menu-bar-mode +1)
2023-12-20 10:13:41 +02:00
Protesilaos Stavrou f1730b7798
Acknowledge Ashton Wiersdorf for commit e2ba6c1
The change is small. As such, Ashton does not need to assign copyright
to the Free Software Foundation.
2023-12-20 10:12:24 +02:00
Ashton Wiersdorf e2ba6c144d
Guard sorting keywords when given an empty string
I've been using Denote with Transient. However, when `denote' is
invoked non-interactively (as through a transient prefix) and no
keywords are specified, the empty string gets passed to `sort', which
is an error.

I've made a file that can be used with the `elpaca-test' macro from
the excellent Elpaca package manager to reproduce the bug. I've added
it as a paste here:

    https://paste.sr.ht/~ashton314/66e2fe76478542c745368e82a8eb5c14af38e448
2023-12-20 10:11:36 +02:00
Jean-Philippe Gagné Guay 667c1370ba Remove unwind-protect from denote--command-with-default-title 2023-12-16 16:14:04 -05:00
Protesilaos Stavrou 195f0c3b7f
Acknowledge Joseph Turner for commits 4261d19, f0910d3
Joseph has assigned copyright to the Free Software Foundation.
2023-12-16 11:38:04 +02:00
Joseph Turner f0910d3146
Add denote-menu-bar-mode, making the Denote menu bar optional
This reduces the effect that merely loading denote.el has on Emacs.
2023-12-16 11:35:13 +02:00
Joseph Turner 4261d19a88
Put Denote menu bar after "Tools" 2023-12-16 11:32:24 +02:00
Jean-Philippe Gagné Guay 2b627aaafd Add denote-org-capture-with-prompts 2023-12-15 20:40:22 -05:00
Jean-Philippe Gagné Guay 6acb25c7ec Create aliases for denote-retrieve-front-matter-* functions 2023-12-15 19:22:06 -05:00
Jean-Philippe Gagné Guay 4899ca5c78 Remove separator for the last file in denote-org-dblock-add-files 2023-12-15 18:38:52 -05:00
Jean-Philippe Gagné Guay f26d8d7799 Handle nil case in denote-sort--define-lessp 2023-12-15 18:38:52 -05:00
Jean-Philippe Gagné Guay 7ca08f2a66 Refactor denote-org-capture and remove denote-org-capture-with-prompts 2023-12-15 18:38:52 -05:00
Jean-Philippe Gagné Guay 3d4891b5dd Rename denote-retrieve-title-* and denote-retrieve-keywords-* functions 2023-12-15 18:38:52 -05:00
Jean-Philippe Gagné Guay e6b7ba74e6 Make denote-retrieve-filename-identifier consistent with other functions 2023-12-15 18:38:52 -05:00
Jean-Philippe Gagné Guay 6d71d3e1d3 Refactor denote-retrieve-filename-* functions 2023-12-15 18:38:52 -05:00
Jean-Philippe Gagné Guay faaf5f94ab Use denote-rename-max-mini-window-height in denote-change-file-type-and-front-matter 2023-12-15 18:38:52 -05:00
Jean-Philippe Gagné Guay b996b7e6f0 Refactor denote-add-front-matter 2023-12-15 18:38:52 -05:00
Jean-Philippe Gagné Guay 6e5ddc2623 Refactor denote-file-has-identifier-p and use it in various functions 2023-12-15 18:38:52 -05:00
Protesilaos Stavrou d47ef97062
Make denote-update-dired-buffers also revert current Dired
This means that we revert the current Dired buffer even if it is not
part of the 'denote-directory'. We do so because the "rename" commands
we provide can be used everywhere on the filesystem.

Thanks to babusri for bringing this matter to my attention. This was
done in issue 203 on the GitHub mirror:
<https://github.com/protesilaos/denote/issues/203>.
2023-12-15 07:24:50 +02:00
Protesilaos Stavrou a4557ea8d0
Simplify denote-title-prompt check for denote-title-prompt-current-default 2023-12-13 11:53:32 +02:00
Protesilaos Stavrou f2ccc4cb6d
Simplify "open or create" retrieval of default value; fix regressions
I recently refactored the denote-title-prompt to use 'completing-read'
and missed the part of setting the 'denote-title-prompt-current-default'.
This is now restored.

I am also simplifying how we are working with the minibuffer histories
to (i) not pollute the denote--file-history with unrelated strings
and (ii) to not have to deal with 'let' bound values in places where I
would rather not have them.

I delved into this in response to the message sent by Aleksandr
Vityazev on the mailing list:
<https://lists.sr.ht/~protesilaos/denote/%3C87a5qevq8i.fsf%40gmail.com%3E>.
2023-12-13 11:27:07 +02:00
Protesilaos Stavrou 8acd82b12a
Fix 'provide' form of denote-rename-buffer
Thanks to Jousimies for spotting this typo in issue 201 on the GitHub
mirror: <https://github.com/protesilaos/denote/issues/201>.
2023-12-12 09:01:12 +02:00
Protesilaos Stavrou 3dce4a7b5d
Bump version to trigger GNU ELPA package rebuild
This is to include the bug fix to 'denote-sort-dired' in commits
96e5161, bc2ddc4.
2023-12-11 09:27:14 +02:00
Protesilaos Stavrou bb1599b21c
Omit backups from 'denote-directory-files'
Thanks to babusri for bringing this matter to my attention in issue
200 on the GitHub mirror: <https://github.com/protesilaos/denote/issues/200>.
2023-12-11 09:26:55 +02:00
Protesilaos Stavrou a7e3b78730
Add two missing names in the acknowledgements 2023-12-11 09:25:15 +02:00
Protesilaos Stavrou bc2ddc4dcb
Tweak error checking of denote-sort-dired
This is the same principle as commit 96e5161 by Vedang Manerikar.
Thanks to Vedang for the patch for that commit:
<https://lists.sr.ht/~protesilaos/denote/patches/47625>.
2023-12-11 08:42:48 +02:00
Vedang Manerikar 96e5161051
Fix: Handle no-matching-files in denote-sort-dired
Where there are no files matching the input regex,
`denote-sort-get-directory-files` returns nil. Passing this to `dired`
throws an error:
```
(file-missing "Reading directory" "No such file or directory" ".../denote/Testing Dired")
```

This commit handles the empty case by returning an appropriate error
message.
2023-12-11 08:39:08 +02:00
Protesilaos Stavrou dec04ce383
Update to Denote version 2.2.0 2023-12-10 08:52:54 +02:00
Protesilaos Stavrou 5afc7de949
Update the CHANGELOG.org front matter and add a table of contents 2023-12-10 06:44:14 +02:00
Protesilaos Stavrou 3ac1b83b80
Include the current time in the name of the denote-sort-dired buffer 2023-12-09 11:54:49 +02:00
Protesilaos Stavrou ff9752cd75
Expand the FAQ on how to sort Dired 2023-12-09 11:34:56 +02:00
Protesilaos Stavrou a44b129601
Update doc string of 'denote-org-dblock-insert-backlinks' 2023-12-05 08:41:23 +02:00
Protesilaos Stavrou 9d6b50b0c1
Add single prompt function for all "files matching regexp" type of prompts 2023-12-05 08:41:09 +02:00
Protesilaos Stavrou 9c24528b3d
Define revert-buffer-function for denote-sort-dired 2023-12-05 06:50:22 +02:00
Protesilaos Stavrou 349b1ef898
Use correct indentation in denote-sort-files 2023-12-05 06:50:08 +02:00
Protesilaos Stavrou 860c5cca22
Show relative current file name in rename commands 2023-12-05 06:49:45 +02:00
Protesilaos Stavrou 0fe7122f70
Store denote-link-with-signature format in a private variable 2023-12-05 04:20:23 +02:00
Protesilaos Stavrou c4b3187039
Make 'denote-files' Org dynamic block file separator opt-in
This means that we do not introduce a separator by default. The 'nil'
value now means what it should.
2023-12-05 04:13:26 +02:00
Protesilaos Stavrou 2add39ecd7
Support signature links in denote-org-dblock--get-file-contents 2023-12-05 04:06:39 +02:00
Protesilaos Stavrou 9f0ecc8d65
Add missing REVERSE argument in denote-org-dblock--files 2023-12-05 04:06:20 +02:00
Protesilaos Stavrou 378873e83a
Make denote--keywords-add-to-history work only on a list 2023-12-05 04:00:03 +02:00
Protesilaos Stavrou f1a942f2e7
Add NOTE and TODO about possible future sort algorithms in denote-sort.el 2023-12-04 06:40:50 +02:00
Protesilaos Stavrou 6b617cae81
Remove superfluous space in denote-sort--define-lessp 2023-12-04 06:39:07 +02:00
Protesilaos Stavrou 40e0d30c56
Remove note from denote-sort.el Commentary section 2023-12-04 06:35:41 +02:00
Protesilaos Stavrou c61539f5b3
Print message after denote-sort-dired to work around Dired bug (per 7ed957b) 2023-12-04 06:34:24 +02:00
Protesilaos Stavrou 7ed957be96
Add note about bug in dired in denote-sort-dired 2023-12-04 06:29:46 +02:00
Protesilaos Stavrou 0df2021e86
Remove completed task from denote-sort--prepare-dired; tweak the function 2023-12-04 06:29:25 +02:00
Protesilaos Stavrou 6d59a16d63
Clarify that 'denote-dired-rename-marked-files-with-keywords' can remove keywords 2023-12-03 07:52:35 +02:00
Protesilaos Stavrou 356b1b8e76
Rewrite the documentation of 'denote-rename-file' to be up-to-date 2023-12-03 07:50:56 +02:00
Protesilaos Stavrou 9e3cf08443
Use "keywords" not "keyword" in 'denote--keywords-delete-prompt' 2023-12-03 07:29:22 +02:00
Protesilaos Stavrou 8e5f360456
Make all rename commands remove keywords if prompt is empty
This is now consistent with the title and signature prompts. We now
give users the power to add/remove components as they see fit. Whereas
before we were insisting on adding back some default value, which made
it impossible to remove some value that was no longer relevant.
2023-12-03 07:20:54 +02:00
Protesilaos Stavrou b9620e4e6f
Expand the doc string and error tests of denote-format-file-name 2023-12-03 07:09:53 +02:00
Protesilaos Stavrou 5e88b0d3fe
Use "keywords" instead of "keyword" in denote--keywords-crm 2023-12-03 06:21:56 +02:00
Protesilaos Stavrou 8ae30d4db9
Add faces for the files shown in various rename prompts 2023-12-02 10:56:51 +02:00
Protesilaos Stavrou 981410d347
Add missing reference to denote-faces-signature 2023-12-02 10:53:14 +02:00
Protesilaos Stavrou c686a9e16a
Make title prompt accept empty string; renaming now ignores/removes title if empty
This is consistent with how we handle signatures. I plan to make the
same happen for keywords.
2023-12-02 10:01:29 +02:00
Protesilaos Stavrou 474c680e32
Reword a comment in the manual 2023-12-02 10:01:17 +02:00
Protesilaos Stavrou 89ddd46996
Add TODOs for denote-org-capture-with-prompts 2023-12-02 09:47:20 +02:00
Protesilaos Stavrou 1f3d3b05d6
Remove reference to obsolete denote-dired-rename-marked-files 2023-12-02 09:27:41 +02:00
Protesilaos Stavrou e6a4bac215
Reinstate macro in denote-sort.el
All 'denote-retrieve-filename-*' functions now do the same thing,
while the sorting algorithm is refined to account for empty strings.
See commits a44600b, b13d899.
2023-12-02 08:46:43 +02:00
Protesilaos Stavrou 8e8cecde65
Clarify what 'denote-retrieve-filename-signature' fallback return value is 2023-12-02 08:45:35 +02:00
Protesilaos Stavrou a44600b4fa
Refactor denote-retrieve-filename-title
We now return an empty string if no title is present. This makes the
behaviour consistent with 'denote-retrieve-filename-keywords' and
'denote-retrieve-filename-signature'.

The use of 'file-name-base' is now subject to a non-nil optional
argument. This makes it easier for the caller to handle cases as they
see fit.
2023-12-02 08:44:05 +02:00
Protesilaos Stavrou b13d899c01
Fix sorting algorithm of denote-sort-signature-lessp 2023-12-02 07:25:13 +02:00
Protesilaos Stavrou 938a761ae8
Remove trailing space from denote-sort-component-prompt text 2023-12-02 06:59:00 +02:00
Protesilaos Stavrou 199609b3f3
Consolidate font-lock keywords into a single variable
This means that we cover all our fontification needs with this one
point of entry. It also works for 'denote-sort-dired', which can
include files with their subdirectory component in the same flat
listing (a wonderful feature, made better by the right fontification).
2023-12-02 06:46:38 +02:00
Protesilaos Stavrou 57eb0b4d54
Declare 'denote-find-link' and 'denote-find-backlink' as interactive only 2023-12-02 06:44:26 +02:00
Protesilaos Stavrou 13674e8f76
Expand the interactive spec of Org dynamic blocks to cover org-mode
This means that M-X will only show these commands in Org buffers.
2023-12-02 06:34:14 +02:00
Protesilaos Stavrou 5f6501a40c
Make denote-link--prepare-links account for files with signature
This affects the command 'denote-add-links' as well as the
'denote-links', 'denote-backlinks', 'denote-files' Org dynamic blocks.
The latter three can be inserted at point with these commands:

- 'denote-org-dblock-insert-links'
- 'denote-org-dblock-insert-backlinks'
- 'denote-org-dblock-insert-files'
2023-12-02 06:28:05 +02:00
Protesilaos Stavrou fe870655a3
Add comment about denote--link-get-description-with-signature link format 2023-12-02 06:26:33 +02:00
Protesilaos Stavrou e0480c7953
Always omit current file from Org dynamic blocks 2023-12-02 06:19:42 +02:00
Protesilaos Stavrou ad644c88e8
Add 'omit-current' parameter to denote-sort-get-directory-files 2023-12-02 06:18:53 +02:00
Protesilaos Stavrou df82fcf176
Fix nil title error in denote-change-file-type-and-front-matter 2023-12-02 06:07:16 +02:00
Protesilaos Stavrou 529de46e1a
Make denote-backlinks Org dynamic block accept sorting; all blocks do it now 2023-12-01 17:17:01 +02:00
Protesilaos Stavrou 341bd586a6
Add no-sort parameter to denote-link--prepare-links, denote-link--insert-links 2023-12-01 14:24:57 +02:00
Protesilaos Stavrou 62bb9e3188
Add work-in-progress sort capability of 'denote-links' Org dynamic block 2023-12-01 14:14:40 +02:00
Protesilaos Stavrou 2f5b4ee97d
Abstract let bound code into its own function in denote-org-dblock.el 2023-12-01 14:14:09 +02:00
Protesilaos Stavrou 414b6d51d0
Add denote-sort-get-files
This is like denote-add-links but with the sorting feature on top.
2023-12-01 14:13:04 +02:00
Protesilaos Stavrou c5c0132f4c
Add denote-link--insert-links helper function 2023-12-01 14:12:48 +02:00
Protesilaos Stavrou 6c6ffb3d8a
Make signature prompt accept empty string; remove empty signature while renaming 2023-12-01 10:28:56 +02:00
Protesilaos Stavrou beaa46dd29
Revise commit d94f41e; DO NOT sluggify at denote-signature-prompt
We only want the commands to sluggify what they process. The prompt
should return what it got from the user.
2023-12-01 10:09:28 +02:00
Protesilaos Stavrou d94f41eda0
Fix bug with doubly sluggification of signature while renaming 2023-12-01 10:04:17 +02:00
Protesilaos Stavrou 59ccadd7a4
Harden the conditionality of denote--valid-file-type 2023-12-01 09:58:15 +02:00
Protesilaos Stavrou 2fadb5e7ea
Make denote-org-dblock-add-files use new denote-directory-files 2023-11-30 10:24:49 +02:00
Protesilaos Stavrou 02647460cd
Merge branch 'new-denote-directory-files' 2023-11-30 10:22:22 +02:00
Protesilaos Stavrou f0711a2bc3
Tweak 'denote-directory-files' doc string 2023-11-30 10:15:20 +02:00
Protesilaos Stavrou 6f23a09804
Add commentary to the 'make-obsolete' of the 'denote-directory-files' variants 2023-11-30 10:15:01 +02:00
Protesilaos Stavrou 47bda788b0
Ensure double spacing for three docstring sentences 2023-11-30 10:14:39 +02:00
Protesilaos Stavrou b6235ff099
Tweak manual's entry about 'denote-directory-files' 2023-11-30 10:14:20 +02:00
Protesilaos Stavrou b4446f39a9
Use the new 'denote-directory-files' in denote-sort.el 2023-11-30 10:14:03 +02:00
Protesilaos Stavrou f9a97d647b
Merge branch 'denote-directory-files' of https://github.com/jeanphilippegg/denote into jeanphilippegg-denote-directory-files 2023-11-30 09:57:33 +02:00
Protesilaos Stavrou 97f34bdc0c
Document denote-sort.el, with 'denote-sort-dired' in particular 2023-11-30 07:26:53 +02:00
Protesilaos Stavrou 59f2a61caf
Document sorting facilities for 'denote-files' Org dynamic block 2023-11-30 07:05:10 +02:00
Protesilaos Stavrou 4050bf6caf
Fix denote-org-dblock-add-files case of REVERSE without SORT-BY-COMPONENT 2023-11-30 07:03:21 +02:00
Protesilaos Stavrou c98e793eef
Make 'denote-files' Org dynamic block leverage denote-sort 2023-11-30 06:53:26 +02:00
Protesilaos Stavrou 1999217a51
Make sorting work for missing components; remove the macro
I am removing the macro because the title sort is a bit different than
the others. This is due to the 'denote-retrieve-filename-title' which
always returns a non-empty string.
2023-11-30 06:52:49 +02:00
Protesilaos Stavrou 0ed067e5a8
Rename symbols for consistency; make denote-sort-component-prompt public 2023-11-30 06:15:30 +02:00
Protesilaos Stavrou 1318e4175e
Tweak denote-sort-files for clarity 2023-11-30 05:41:39 +02:00
Protesilaos Stavrou cf3c2b8cbe
Change the arity of denote-sort-files to make only REVERSE be optional 2023-11-30 05:41:13 +02:00
Protesilaos Stavrou db31cca8fa
Clarify denote-sort-components docstring 2023-11-30 05:40:52 +02:00
Protesilaos Stavrou 3cd4999d1c
Rename denote-sort-files-keys to denote-sort-components; change to list of symbols 2023-11-30 05:37:43 +02:00
Protesilaos Stavrou edeaaa735e
Show 'denote-sort-dired' files relative to 'denote-directory' 2023-11-29 18:40:58 +02:00
Protesilaos Stavrou 5cfd03e8db
Make denote-sort-dired docstring easier to read 2023-11-29 18:13:29 +02:00
Protesilaos Stavrou d3f18c9fd2
Make denote-sort-get-directory-files docstring easier to read 2023-11-29 18:13:15 +02:00
Protesilaos Stavrou 1c80ff0ac6
Make denote-sort-files docstring easier to read 2023-11-29 18:12:49 +02:00
Protesilaos Stavrou 3dd8995d43
Tweak denote-sort-comparison-function doc string 2023-11-29 18:12:38 +02:00
Protesilaos Stavrou f3de273de8
Add denote-sort.el
I plan to expand on this feature. The prototype I have here shows
great potential.
2023-11-29 15:47:06 +02:00
Protesilaos Stavrou d98d05981b
Add function denote-retrieve-filename-keywords
This is used to extract keywords from the file name alone, without
going into the file contents.
2023-11-29 12:10:07 +02:00
Protesilaos Stavrou 4cc6d241c1
Move denote-retrieve-filename-title closer to related functions in the manual 2023-11-29 12:06:15 +02:00
Protesilaos Stavrou f9eab489a3
Simplify denote-test--denote-format-file-name
We do not need the extra checks here.
2023-11-28 06:05:21 +02:00
Protesilaos Stavrou 4dadd02dc1
Add denote-test--denote-format-file-name 2023-11-28 06:03:32 +02:00
Protesilaos Stavrou 1d24172f96
Improve and expand denote-test--denote--format-front-matter 2023-11-28 05:43:57 +02:00
Protesilaos Stavrou 8f5ff8c5fe
Make denote--slug-no-punct actually work as intended
We need a loop here because the previous 'concat' was simply matching
the first component it would fine, whereas we want to remove all the
matches.
2023-11-28 05:15:33 +02:00
Protesilaos Stavrou 90ff0dec95
Fix denote--slug-no-punct for extra characters 2023-11-27 10:42:23 +02:00
Protesilaos Stavrou 66f60c9bef
Fix denote-test--denote-sluggify-keywords 2023-11-27 10:21:12 +02:00
Protesilaos Stavrou 2133b21012
Fix denote-test--denote-filetype-heuristics 2023-11-27 10:20:44 +02:00
Protesilaos Stavrou 9305befdb9
Comment out needless error in denote--file-with-temp-buffer-subr 2023-11-27 10:20:17 +02:00
Protesilaos Stavrou e3a7572fea
Check for readable file in 'denote-files' Org dynamic block 2023-11-26 14:25:22 +02:00
Protesilaos Stavrou 294dec0962
Fix broken link in the manual 2023-11-26 11:36:10 +02:00
Jean-Philippe Gagné Guay 57c177696e Refactor denote-directory-files and deprecate functions 2023-11-25 09:48:59 -05:00
Protesilaos Stavrou 19a0566e07
Use helper function to prompt for regexp in denote-org-dblock.el 2023-11-25 10:11:03 +02:00
Protesilaos Stavrou 4fbd34b070
Remove empty line in denote-org-dblock.el 2023-11-25 09:44:51 +02:00
Protesilaos Stavrou d938cb14c2
Fix missing parenthesis in denote-org-dblock.el 2023-11-25 09:44:40 +02:00
Protesilaos Stavrou a2b66a2f96
Rewrite the entire section of the manual about Org dynamic blocks 2023-11-25 06:28:06 +02:00
Protesilaos Stavrou df75a7bf7e
Simplify the 'denote-backlinks' Org dynamic block 2023-11-25 06:09:40 +02:00
Protesilaos Stavrou 87f5bb12a4
Make 'denote-backlinks' Org dynamic block accept :id-only parameter 2023-11-25 06:04:47 +02:00
Protesilaos Stavrou 6d26aea464
Remove :reverse parameter from 'denote-backlinks' Org dynamic block
[ Same idea as with commit 0063240. ]

We do not expose this feature to the commands we provide. Adding it
here creates inconsistencies, such as, for example, with the
'denote-files' Org dynamic block. I prefer to remove this option than
to see its proliferation.
2023-11-25 05:51:40 +02:00
Protesilaos Stavrou 00632408ed
Remove :reverse parameter from 'denote-links' Org dynamic block
We do not expose this feature to the commands we provide. Adding it
here creates inconsistencies, such as, for example, with the
'denote-files' Org dynamic block. I prefer to remove this option than
to see its proliferation.
2023-11-25 05:50:43 +02:00
Protesilaos Stavrou 50e392ffbe
Remove trailing empty line from 'denote-files' Org dynamic block 2023-11-25 05:33:59 +02:00
Protesilaos Stavrou 1ac6a22ee3
Simplify the 'denote-links' Org dynamic block; add :id-only parameter 2023-11-25 05:33:59 +02:00
Protesilaos Stavrou e7a176e4e7
DEPRECATE 'denote-add-missing-links'
It does not work reliably on my end and has been the source of
confusion as a result. I don't think we can guarantee the correct
behaviour at all times.
2023-11-25 05:33:59 +02:00
Protesilaos Stavrou 3922e348fb
Tweak the outline of denote-org-dblock.el 2023-11-25 05:16:27 +02:00
Protesilaos Stavrou 46eef8650b
Rewrite the Commentary and one-line description of denote-org-dblock.el 2023-11-25 05:16:27 +02:00
Protesilaos Stavrou b0727b1dfc
Include me as one of the authors of denote-org-dblock.el 2023-11-25 05:16:27 +02:00
Protesilaos Stavrou 0e385916d5
Remove needless commentary from denote-org-dblock.el
We better keep the manual for this, otherwise we will have to maintain
up-to-date documentation in two places. This adds to the development
burden and I prefer to avoid it.
2023-11-25 05:16:27 +02:00
Protesilaos Stavrou e2f72c5f75
Clarify that 'denote-backlinks' Org dynamic block accepts :reverse parameter 2023-11-25 05:16:27 +02:00
Protesilaos Stavrou a4c0207700
Include the :reverse parameter in 'denote-org-dblock-insert-links'
This makes it easier for the user to discover the feature. A nil value
has the same meaning as omitting the parameter altogether.
2023-11-25 05:16:27 +02:00
Protesilaos Stavrou 54b28998aa
Remove needless quote from t in denote-org-dblock.el 2023-11-25 04:52:31 +02:00
Protesilaos Stavrou f29a9c9e7d
Remove needless comment from denote-org-dblock.el 2023-11-25 04:49:00 +02:00
Protesilaos Stavrou 3f23dd1fd0
Include the :reverse parameter in 'denote-org-dblock-insert-backlinks'
This makes it easier for the user to discover the feature. A nil value
has the same meaning as omitting the parameter altogether.
2023-11-25 04:48:02 +02:00
Protesilaos Stavrou 110271dc5a
Register 'denote-files' Org dynamic block
This makes it available as a completion candidate when using the
command 'org-dynamic-block-insert-dblock'.
2023-11-25 04:47:13 +02:00
Protesilaos Stavrou b00a8230cd
Greatly expand the capabilities of the 'denote-files' Org dynamic block
1. The :no-front-matter parameter can now read a number value to
   omit that many lines from the top of the file.

2. A new :add-links parameter formats the inserted files as a
   typographic list and creates a link to each file.
2023-11-25 04:36:22 +02:00
Protesilaos Stavrou d63f2f3eb3
Move denote-org-dblock-file-contents-separator closer to where it is used 2023-11-25 03:19:43 +02:00
Protesilaos Stavrou bf8af068e6
Clarify :no-front-matter Org dynamic block parameter value 2023-11-23 15:13:36 +02:00
Protesilaos Stavrou 2640eb7f38
Refine the 'denote-files' Org dynamic block, including a "no front matter" option 2023-11-23 15:11:54 +02:00
Protesilaos Stavrou 670ea3ba4c
Refer to org-dblock-update command and its key binding 2023-11-23 15:07:51 +02:00
Protesilaos Stavrou 643f52677c
Define 'denote-files' Org dynamic block 2023-11-23 08:26:08 +02:00
Protesilaos Stavrou b5d3ab6e4e
Merge pull request #193 from jeanphilippegg/cleanups
Cleanups
2023-11-23 07:41:11 +02:00
Jean-Philippe Gagné Guay 39847ad78b Refactor denote--link-format 2023-11-19 15:19:57 -05:00
Jean-Philippe Gagné Guay 8e4a8ee69b Refactor denote--link-in-context-regexp 2023-11-19 15:04:03 -05:00
Jean-Philippe Gagné Guay 8255dc380f Simplify denote-trim-whitespace 2023-11-19 09:09:18 -05:00
Jean-Philippe Gagné Guay 180bde5742 Refactor denote--default-directory-is-silo-p 2023-11-18 23:15:00 -05:00
Jean-Philippe Gagné Guay 01ea1c2cc4 Remove unnecessary checks 2023-11-18 23:15:00 -05:00
Jean-Philippe Gagné Guay 3ebc7026d4 signature should always be a string (maybe empty) 2023-11-18 23:15:00 -05:00
Jean-Philippe Gagné Guay b5810569fe Refactor denote--find-first-unused-id 2023-11-18 23:15:00 -05:00
Jean-Philippe Gagné Guay 9742bca7e3 Fix denote-change-file-type-and-front-matter when there is a signature 2023-11-18 23:15:00 -05:00
Jean-Philippe Gagné Guay b936bbdf4e Make signature parameter non optional for some functions 2023-11-18 23:14:48 -05:00
Jean-Philippe Gagné Guay 53d52d9d46 Fix documentation of denote-file-type 2023-11-18 18:56:23 -05:00
Jean-Philippe Gagné Guay 2d6131085c Simplify denote-filetype-heuristics 2023-11-18 18:56:23 -05:00
Jean-Philippe Gagné Guay cf63fd9015 Simplify denote-keywords-add and denote-keywords-remove 2023-11-18 18:56:23 -05:00
Jean-Philippe Gagné Guay 1b24d2ed5a Simplify denote-format-file-name 2023-11-18 18:56:23 -05:00
Jean-Philippe Gagné Guay 95f8c14e48 Simplify denote-link-return-links and denote-link-return-backlinks 2023-11-18 18:56:23 -05:00
Jean-Philippe Gagné Guay 70d07dd122 Fix typo 2023-11-18 18:56:23 -05:00
Jean-Philippe Gagné Guay ba7561688d Remove unnecessary code in denote-trim-* functions and denote-extract-keywords-from-front-matter 2023-11-18 18:56:23 -05:00
Protesilaos Stavrou 5b92f37097
Bump minor version to trigger GNU ELPA package update
This is to include commits dee430a, 6caf875.
2023-11-18 11:00:11 +02:00
Vedang Manerikar 6caf8755eb
Fix: Ensure signature is sluggified correctly when renaming
Based on the bug found in the previous commit, I looked at all the
call-sites for `denote-sluggify-signature` and
`denote-retrieve-filename-signature` and found two other places:

1. `denote-rename-file`: Add check to ensure signature exists when
   trying to sluggify it.

2. `denote-rename-file-using-front-matter`: Sluggify the signature
   before creating the new file-name.
2023-11-18 10:57:12 +02:00
Vedang Manerikar dee430a586
Fix: Handle signature in denote-dired-rename-marked-files-with-keywords
I hit this bug when I called `M-x
denote-dired-rename-marked-files-with-keywords` on the file at point
in a dired buffer. The stack-trace is as follows:

```
Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
  replace-regexp-in-string("[][{}!@#$%^&*()=+'\"?,.|;:~`‘’“”/]*-" "" nil)
  denote--slug-no-punct(nil "-")
  denote-sluggify-signature(nil)
  denote-dired-rename-marked-files-with-keywords()
  ```

`denote-sluggify-signature` gets a `nil` input which it cannot handle.
This happens because the signature is extracted using
`denote-retrieve-filename-signature`, which can return a `nil` value.

The fix is to only call `denote-sluggify-signature` when we have a
signature to handle.
2023-11-18 10:57:12 +02:00
Protesilaos Stavrou 4ad77f92dd
Document inclusion of subdirs for denote-dired-mode; update symbol of user option
This is a follow-up to pull request 190 on the GitHub mirror, which
added the original idea: <https://github.com/protesilaos/denote/pull/191>.
Thanks to leinfink for the contribution!
2023-11-15 13:11:52 +02:00
Protesilaos Stavrou c0438cd2d6
Simplify denote-dired-mode-in-directories (tweak 21f1c98)
Thanks to leinfink for the feedback in the comments of pull request
190 on the GitHub mirror: <https://github.com/protesilaos/denote/pull/191>.
2023-11-15 13:03:55 +02:00
Protesilaos Stavrou d26b50bf58
Acknowledge leinfink for commit 21f1c98
This change is within the ~15 line limit and thus does not require
copyright assignment to the Free Software Foundation.

It was done in pull request 191 on the GitHub mirror:
<https://github.com/protesilaos/denote/pull/191>.
2023-11-15 08:17:56 +02:00
Protesilaos Stavrou 36db77d496
Merge pull request #191 from leinfink/main
Allow checking for subdirs of `denote-dired-directories' (fix #190)
2023-11-15 08:16:06 +02:00
Henrik Hörmann 21f1c98339 allow checking for subdirs of `denote-dired-directories' (fix #190) 2023-11-13 15:04:35 +01:00
Protesilaos Stavrou 75534eea53
Fix typos 2023-11-13 08:36:37 +02:00
Protesilaos Stavrou 5f10fbf019
Update to Denote version 2.1.0 2023-11-12 15:49:06 +02:00
Protesilaos Stavrou 65651adf6a
Fix sample 'require' call of denote-journal-extras 2023-11-12 14:56:49 +02:00
Protesilaos Stavrou 4e1a5b6284
Add missing word from a title in the manual 2023-11-12 14:00:52 +02:00
Protesilaos Stavrou 251878a648
Fix typo in denote-file-name-letter-casing doc string 2023-11-12 14:00:48 +02:00
Vedang Manerikar e42f590f1f
Fix: denote-extract-keywords-from-front-matter should always return a list
I hit this bug when I called `M-x
denote-change-file-type-and-front-matter` on an Org file with empty
filetags, to convert it to Markdown-YAML format.

This is the front-matter of the original file:
```
   #+title:      Great Content is the Heart of Audience Building
   #+filetags:
   #+date:       [2023-03-08 Wed 18:51]
   #+identifier: 20230308T185100
```

The stack-trace is as follows:
```
Debugger entered--Lisp error: (error "‘’ is not a list")
  signal(error ("‘’ is not a list"))
  error("`%s' is not a list" "")
  denote-sluggify-keywords("")
  denote--format-front-matter-keywords("" markdown-yaml)
  denote--format-front-matter("Great Content is the Heart of Audience Building" "2023-03-08T18:51:00+05:30" "" "20230308T185100" markdown-yaml)
  denote--add-front-matter("/.../20230308T18..." "Great Content is the Heart of Audience Building" "" "20230308T185100" markdown-yaml)
  denote-change-file-type-and-front-matter("/.../20230308T18..." markdown-yaml)
```

Following the chain of commands shows that the culprit is the line
```
(denote-retrieve-keywords-value file old-file-type)
```
in `denote-change-file-type-and-front-matter`, which returns an
empty string when the rest of the functions expect a list of strings.

I looked at where `denote-extract-keywords-from-front-matter` is being
used and why the code was originally returning an empty string, and it
looks to me that returning an empty list from it now is the right
thing to do.
2023-11-07 08:42:53 +02:00
Protesilaos Stavrou 50d1bbdf1e
Simplify denote-file-prompt, fixing its two minor bugs
The two bugs:

1. The minibuffer history does not work because the project.el function
   that was being called checks for an abbreviated file path (like
   ~/path) whereas we always use absolute file paths (like /home/prot/path).

2. The prompt would ask for confirmation if the file did not exist.
   This was creating friction for commands such as 'denote-open-or-create',
   'denote-link-or-create', and their variants. I consider this a bug
   because we want to have the equivalent of the NO-CONFIRM behaviour
   that 'completing-read' gives us.

This change undoes part of what Noboru Ota (nobiot) did in commit
6bb6da0882. From the commit message, the
relevant part is this:

    (denote-file-prompt): Refactored

    - To use the same completion function as 'project-find-file' does.

    - The main benefit is that it can let you search notes under all
      sub-directories of 'denote-directory'.  The original 'read-file-name'
      could only search within only single 'denote-directory'

    - Note the impact on commands that use 'denote-file-prompt';
      i.e. 'denote-open-or-create', 'denote-link', 'denote-link-or-create',
      and 'denote-link-ol-complete'

    - One minor annoyance may be that the prompt now requires a confirmation
      if the user enters text that does not match any of the candidate and
      tries to exit

    - 'denote--title-history' is directly updated from the minibuffer
      completion function.  This eliminates the need for
      'denote--push-extracted-title-to-history'.  The original used
      'file-name-history' as the intermediate storage of titles, which are
      not really file names, thus resulted in polluting the history for file
      names

What I am doing with this change is to retain the spirit of Noboru's
change with regard to the flat listing of files. I agree that the old
tree-based prompt (per 'read-file-name') was not suitable for our
needs. The "impact" mentioned in the commit above should now no longer
be relevant, given what I wrote about NO-CONFIRM. The "minor
annoyance" is gone for the same reason. The title history has since
been fixed in other commits and also in this one given what I covered
above about abbreviated file paths in the project.el functions.
2023-11-07 07:01:22 +02:00
Protesilaos Stavrou 8d19849fa5
Note reason for FIXME in 'denote-file-prompt' 2023-11-07 07:01:22 +02:00
Protesilaos Stavrou 9ec4f7bbc6
Merge pull request #187 from jeanphilippegg/small-refactor
Small refactor
2023-11-05 08:03:55 +02:00
Jean-Philippe Gagné Guay 9c410b1e2f Make used-ids parameter non optional in denote-create-file-identifier 2023-11-04 14:01:57 -04:00
Jean-Philippe Gagné Guay 2aa877b247 Refactor denote-rename-file-using-front-matter 2023-11-04 13:59:23 -04:00
Protesilaos Stavrou 538b3ec2e7
Declare the wdired commands to the byte compiler 2023-11-04 15:31:08 +02:00
Protesilaos Stavrou 1f55b206bd
Make 'denote-filetype-heuristics' work in 'org-capture' buffers
This means that we can call 'denote-link' while capturing a new note.

Thanks to Peter Smith for reporting the bug in issue 186 on the GitHub
mirror: <https://github.com/protesilaos/denote/issues/186>.
2023-11-04 08:08:08 +02:00
Protesilaos Stavrou e394dc7922
Return new name in denote-rename-file
This can be used programmatically. Thanks to mentalisttraceur for
reuesting this feature in issue 183 on the GitHub mirror:
<https://github.com/protesilaos/denote/issues/183>.
2023-11-04 07:45:04 +02:00
Protesilaos Stavrou a2d5c4e174
Make denote-dired-rename-files not use the 'denote--rename-file-subr'
Same idea as with commit bd3ddfb. The 'denote--rename-file-subr',
which I am now removing, was not abstract enough and was thus creating
problems. Thanks to Jean-Philippe Gagné Guay for pointing this out in
issue 182 on the GitHub mirror: <https://github.com/protesilaos/denote/pull/182>.
2023-11-04 05:57:44 +02:00
Protesilaos Stavrou 05e55e16c0
Change where signatures are sluggified for consistency
We do not want the prompt to perform this step. All it should do is
get the user's input. This is how we do it with the title as well.
2023-11-04 05:42:08 +02:00
Protesilaos Stavrou 3b1397bd9d
Set denote-dired-rename-marked-files-with-keywords lexical variable directly 2023-11-04 05:25:12 +02:00
Protesilaos Stavrou 0f449dd3a5
Tweak denote-dired-rename-marked-files-with-keywords docstring and prompt 2023-11-04 05:23:14 +02:00
Protesilaos Stavrou 7969bb533a
Revert "Make denote-dired-rename-marked-files-with-keywords use denote--rename-file-subr"
This reverts commit 1eeda41cf7.
2023-11-04 05:18:35 +02:00
Protesilaos Stavrou dc66c56cb1
Add user option 'denote-rename-no-confirm' 2023-11-04 05:16:23 +02:00
Protesilaos Stavrou eba22e8c2b
Remove needless comment 2023-11-04 05:03:49 +02:00
Protesilaos Stavrou bd3ddfbe42
Stop using the 'denote--rename-file-subr' in 'denote-rename-file'
That abstraction was not good enough and thus makes things more
difficult for us. I am reverting to what we had before. We will see
how best to proceed.

Thanks to Jean-Philippe Gagné Guay for telling me about the drawbacks
of the 'denote--rename-file-subr'. This was done on the GitHub mirror.
2023-11-04 05:01:01 +02:00
Protesilaos Stavrou 0d7b81955d
Stop using vc-rename-file to rename files
The reason is that it requires the buffer to be saved, but we do not
want that after modifying the front matter because we want to give the
user a chance to confirm what happened.

Thanks to Frédéric Willem for reporting the problem in issue 185 on
the GitHub mirror: <https://github.com/protesilaos/denote/issues/185>.
2023-11-03 12:29:23 +02:00
Protesilaos Stavrou 0f13f0f17d
Make journal commands accept an optional DATE argument
Thanks to Alan Schmitt for putting forward the idea on the mailing
list: <https://lists.sr.ht/~protesilaos/denote/%3Cm2h6m9ze97.fsf%40m4x.org%3E>.
2023-11-03 06:34:42 +02:00
Vedang Manerikar 7d1bcfb81d
Fix: Trim denote-rename-buffer to avoid "uninteresting buffers"
I hit this bug when I did the following:

1. Modify the default `denote-rename-buffer-format` from "%t" to
   "%s %t" to display signatures
2. Open a Denote file which did not have a signature.
3. Wonder why the buffer did not show up in buffer-listing functions,
   and why undo wouldn't work on it and so on.

The answer is here:
https://www.gnu.org/software/emacs/manual/html_node/elisp/Buffer-Names.html#Buffer-Names

    > Buffers that are ephemeral and generally uninteresting to the
    > user have names starting with a space, so that the list-buffers
    > and buffer-menu commands don't mention them (but if such a
    > buffer visits a file, it is mentioned). A name starting with
    > space also initially disables recording undo information; see
    > Undo.

This commit trims the Buffer Name to ensure that there are no leading
or trailing spaces.
2023-11-02 08:07:39 +02:00
Protesilaos Stavrou 4af8a8faa7
Clarify wording about how multi-word keywords are handled
In short, you have to follow some convention that control the letter
casing of individual words to make them readable, while keeping them
part of the same keyword. Using the new user option we provide:

    (setq denote-file-name-letter-casing
          '((title . downcase)
            (signature . downcase)
            (keywords . verbatim) ; notice the `verbatim' here
            (t . downcase)))

With this in place, typing something like 'camelCase' at the keywords
prompt will insert that as-is and treat as a single keyword.

I am clarifying the documentation here as part of the process of
introducing the new 'denote-file-name-letter-casing' option. I do it
in response to the question raised by Peter Smith in issue 184 on the
GitHub mirror: <https://github.com/protesilaos/denote/issues/184>.
2023-10-31 11:07:47 +02:00
Protesilaos Stavrou d179c692b4
Fix regression in denote--slug-no-punct
We want to omit dashes from signatures, though not from other strings.
2023-10-31 11:01:38 +02:00
Protesilaos Stavrou b71621c739
Make denote-dired-mode work with wdired 2023-10-28 08:35:47 +03:00
Protesilaos Stavrou 9fb2313ebf
Remove spaces from the manual's front matter
I had a bug report about this for my modus-themes: the Info output of
this file would include the spaces as part of the title. Probably it
was fixed in Org, though I won't take any chances. I don't mind the
absence of alignment spaces in the source file.
2023-10-27 08:39:13 +03:00
Protesilaos Stavrou 027ff0a565
Re-enable 'denote-{title,signature}-prompt' history completion
I first implemented this in commit 0d855bb. However, it did not work
with the default minibuffer because the SPC key performs
completion (popping up the Completions buffer). So users could not
easily input an arbitrary string for the title/signature. I thus
reverted that commit in 9f692cb.

Stefan Monnier suggested the use of the 'minibuffer-with-setup-hook',
which lets us disable SPC completion for the purposes of these
functions. This is most welcome as the functionality is nice to have.

Stefan's feedback was provided on the emacs-devel mailing list:
<https://lists.gnu.org/archive/html/emacs-devel/2023-10/msg00631.html>.
2023-10-27 08:32:53 +03:00
Protesilaos Stavrou 1d4f6a475e
Merge pull request #180 from pprevos/main
Added Emacs Writing Studio to publications about Denote
2023-10-26 13:41:14 +03:00
Vedang Manerikar bf84e352b8
Fix: broken if-clause in denote-link-after-creating-with-command 2023-10-26 13:37:49 +03:00
Peter Prevos d5e306938e Added Emacs Writing Studio to publications about Denote 2023-10-26 18:31:59 +11:00
Protesilaos Stavrou 9f692cbbef
Revert "Make 'denote-{title,signature}-prompt' complete from its history"
This reverts commit 0d855bbf12.

The idea to have completion is good, though this way it breaks with
the default minibuffer setup because SPC tries to complete the
inputted text. Thus the user cannot type freely. This does not happen
with packages that enhance the minibuffer User Interface, such as
'vertico'.

Thanks to Suhail Singh for reporting this bug:
<https://lists.sr.ht/~protesilaos/denote/%3C652d82c0.c80a0220.e6282.dc47%40mx.google.com%3E#%3C65392fa6.050a0220.da61c.0ac8@mx.google.com%3E>.
2023-10-25 19:12:37 +03:00
Protesilaos Stavrou e200ff93af
Fix denote--slug-no-punct to replace dashes
Thanks to Suhail Singh for reporting the bug on the mailing list:
<https://lists.sr.ht/~protesilaos/denote/%3C652d82c0.c80a0220.e6282.dc47%40mx.google.com%3E>.
2023-10-25 09:47:29 +03:00
Protesilaos Stavrou 0d855bbf12
Make 'denote-{title,signature}-prompt' complete from its history
I am implementing this in response to feedback provided by Suhail
Singh who asked that signatures should behave more like keywords. What
I am doing here is not exactly that because keywords can be many
whereas a signature is one, like a title.

Completion from its own history may not be what we settle on. I am
open to suggestions on how to make this more user friendly. I just
don't want to introduce new user options before knowing exactly what
the needs are.

Suhail's feedback on the mailing list:
<https://lists.sr.ht/~protesilaos/denote/%3C652d82c0.c80a0220.e6282.dc47%40mx.google.com%3E#%3C65380146.c80a0220.4698b.d8c0@mx.google.com%3E>.
2023-10-25 09:41:35 +03:00
Protesilaos Stavrou 85d34f0fba
Mention 'denote-sluggify-signature' in 'denote-signature-prompt' 2023-10-24 08:38:03 +03:00
Protesilaos Stavrou a4e08bd4f5
Make 'denote-signature-prompt' sluggify the input
Thanks to Suhail Singh for bringing this matter to my attention. It
was done on the mailing list:
<https://lists.sr.ht/~protesilaos/denote/%3C652d82c0.c80a0220.e6282.dc47%40mx.google.com%3E#%3C65361445.c80a0220.92d9c.8641@mx.google.com%3E>.
2023-10-24 08:36:48 +03:00
Protesilaos Stavrou ee517a5c8e
Add FIXME about a desired optimisation 2023-10-24 08:27:12 +03:00
Protesilaos Stavrou 48da159666
Merge pull request #178 from jeanphilippegg/refactor
Refactor denote-link--map-over-notes
2023-10-24 08:23:59 +03:00
Jean-Philippe Gagné Guay 92ffc365e9 Refactor denote-link--map-over-notes 2023-10-22 12:12:37 -04:00
Protesilaos Stavrou c6f4f87796
Make denote-rename-file prompt for a signature
This is part of a long series of changes I have been making to
refactor/expand/refine the renaming commands.

The need to somehow rename with a signature was mentioned by Suhail
Singh on the mailing list:
<https://lists.sr.ht/~protesilaos/denote/%3C652d82c0.c80a0220.e6282.dc47%40mx.google.com%3E>.
2023-10-20 15:12:49 +03:00
Protesilaos Stavrou dca802b720
Clarify that denote-dired-rename-files empty signature is ignored; use default value 2023-10-20 15:10:31 +03:00
Protesilaos Stavrou 1bfc6c157c
Make denote-signature-prompt accept optional DEFAULT-SIGNATURE 2023-10-20 15:05:43 +03:00
Protesilaos Stavrou 620c05a557
Remove needless TODO 2023-10-20 14:58:46 +03:00
Protesilaos Stavrou 1eeda41cf7
Make denote-dired-rename-marked-files-with-keywords use denote--rename-file-subr 2023-10-20 14:55:49 +03:00
Protesilaos Stavrou b6710c590c
Make denote--rename-file-subr derive default value, if needed 2023-10-20 14:55:27 +03:00
Protesilaos Stavrou c3c567ee90
Use better name for subroutines 2023-10-20 14:47:38 +03:00
Protesilaos Stavrou 15411ac1ca
Add denote-dired-rename-files command 2023-10-20 14:41:53 +03:00
Protesilaos Stavrou dc9397a70a
Use 'denote-update-dired-buffers' instead of 'revert-buffer' 2023-10-20 14:40:16 +03:00
Protesilaos Stavrou baaa113bd7
Make denote--rename-file-subr read an IDENTIFIER argument 2023-10-20 14:12:31 +03:00
Protesilaos Stavrou 53ab1d36f6
Add denote--rename-file-subr; refine denote-rename-file
The new subroutine function paves the way for a new command that can
perform 'denote-rename-file' over a list of files.

As for 'denote-rename-file', the prompts now use text that better
described what they do. For example, instead of "File title: " the
user reads something like "Rename '/home/prot/Documents/test.txt' with
title: ". Same idea for the keywords prompt.
2023-10-20 13:50:52 +03:00
Protesilaos Stavrou eadbac8a91
Add WORK-IN-PROGRESS code to rename multiple files 2023-10-20 06:52:44 +03:00
Protesilaos Stavrou 1c772c4430
Make denote-rewrite-front-matter accept optional NO-CONFIRM 2023-10-20 06:52:10 +03:00
Protesilaos Stavrou e57f2413a4
Make denote-title-prompt accept optional PROMPT-TEXT 2023-10-20 06:51:21 +03:00
Protesilaos Stavrou 93147c13c9
REFACTOR denote-dired-rename-marked-files to denote-dired-rename-marked-files-with-keywords
The new command is meant to be simpler to use and more intuitive in
its design. Its name is now describing what it does, which is to only
prompt for KEYWORDS and rename the marked files accordingly.

The prompt for keywords now displays a more informative message in the
minibuffer, which clearly states that the provided keywords are used
to rename the marked files.

I will provide a new command that will perform interactive renaming of
Dired marked files. That one will ask for title, keywords, and
signature.
2023-10-20 06:36:04 +03:00
Protesilaos Stavrou 1c65983248
Move obsoletion notice closer to its referent 2023-10-20 06:02:22 +03:00
Protesilaos Stavrou baf79b494a
Update error message of denote-dired-rename-marked-files-using-front-matter 2023-10-19 07:26:46 +03:00
Protesilaos Stavrou f9fe0c374c
Renaming with front matter no longer requires buffer save
This is possible due to the numerous refinements made to the
underlying mechanism that reads buffer or file contents. Interested
parties can refer to the Lisp macro 'denote--file-with-temp-buffer'
and its helper function 'denote--file-with-temp-buffer-1'.

In short: Denote can now correctly read buffer contents as well as
file contents.
2023-10-19 07:22:55 +03:00
Protesilaos Stavrou c4bbd64e2a
Reposition denote-change-file-type-and-front-matter 2023-10-19 06:52:54 +03:00
Protesilaos Stavrou 36ed254aa0
Clarify the doc string of denote-after-new-note-hook 2023-10-19 06:52:31 +03:00
Protesilaos Stavrou 2a5dfea29b
Rename denote-change-file-type to avoid confusion 2023-10-19 06:51:36 +03:00
Protesilaos Stavrou f7406ef475
Refine conditionality of denote--file-with-temp-buffer-1 2023-10-19 06:35:58 +03:00
Protesilaos Stavrou 382cce8b9f
Write ERT test for denote-journal-extras-daily--title-format 2023-10-17 14:53:15 +03:00
Protesilaos Stavrou 194e43c89e
Simplify denote-journal-extras-daily--title-format 2023-10-17 14:53:02 +03:00
Protesilaos Stavrou 4d75e1e37a
Make sure some tests are done with 'ert-deftest' 2023-10-17 14:52:42 +03:00
Protesilaos Stavrou ffad320332
Make 'denote-all-files' accept optional OMIT-CURRENT
We had this before and it was used to omit the current file from the
'denote-link' prompt (i.e. not give users the option to link the file
to itself). We probably lost that when 'denote-all-files' was
introduced, though I believe it was not by design. I am adding it back
in, as I see no obvious downside with this.
2023-10-17 09:43:33 +03:00
Protesilaos Stavrou 0eacf6673f
Clarify the documentation of 'denote-backlinks-{next,prev}' 2023-10-16 15:08:19 +03:00
Protesilaos Stavrou f71762a2d7
Remove needless &optional from 'denote-backlinks-{next,prev}' 2023-10-16 15:03:44 +03:00
Protesilaos Stavrou c3530e1a5e
Make backlinks motions return user-error outside their buffer 2023-10-16 14:59:55 +03:00
Protesilaos Stavrou b3e500926f
Remove two very old 'make-obsolete-variable'
I trust those affected have long switched to a recent version of Denote.
2023-10-16 14:57:21 +03:00
Protesilaos Stavrou 8b467e7d6e
Remove last asterisk from 'when-let' (same as e1fe14d) 2023-10-16 14:52:04 +03:00
Protesilaos Stavrou e1fe14d447
Remove the needless asterisk from 'if-let' and 'when-let'
Unlike 'let' VS 'let*' those two always have the behaviour of 'let*'.
2023-10-16 14:50:52 +03:00
Protesilaos Stavrou 71051c85f2
Make denote--link-get-description-with-signature work with selected region 2023-10-16 14:45:55 +03:00
Protesilaos Stavrou 5d274c825d
Fix error with denote-journal-extras-title-format=nil
We do accept a nil value, as noted in doc string of
'denote-journal-extras-title-format'.

Thanks to TJ Stankus for bringing this matter to my attention. It was
done in issue 176 on the GitHub mirror:
<https://github.com/protesilaos/denote/issues/176>.
2023-10-16 14:14:04 +03:00
Protesilaos Stavrou 7caf1a62db
Use functions without wrappers for denote-rename-buffer--format
The 'denote-rename-buffer--get-keywords' is superseded by the
'denote-retrieve-keywords-value-as-string', which I introduced in commit
b17980a. Also check df2c7ee, which makes 'denote-keywords-combine' a
public function.
2023-10-16 08:29:17 +03:00
Protesilaos Stavrou df2c7eeb08
Make 'denote-keywords-combine' a public function 2023-10-16 08:28:57 +03:00
Protesilaos Stavrou b17980a1af
Add function denote-retrieve-keywords-value-as-string 2023-10-16 08:24:58 +03:00
Protesilaos Stavrou ef43b21e46
Merge pull request #177 from jeanphilippegg/refactor-denote-rename-buffer
Refactor denote-rename-buffer
2023-10-16 08:06:30 +03:00
Jean-Philippe Gagné Guay 59788dec28 Refactor denote-rename-buffer
Remove denote-rename-buffer--common-check and denote-rename-buffer--with-unique-name
Refactor denote-rename-buffer--format and denote-rename-buffer--fallback.
2023-10-15 21:53:08 -04:00
Protesilaos Stavrou 58b9be3530
Make denote-rename-buffer--with-unique-name not fail on blank string 2023-10-15 18:25:15 +03:00
Protesilaos Stavrou cade15b36a
Reorganise some functions by order of first appearance 2023-10-15 18:11:06 +03:00
Protesilaos Stavrou fc2e3aaefd
Merge pull request #175 from jeanphilippegg/small-fix
Add denote-filename-is-note-p and use it in denote--buffer-file-names
2023-10-15 18:07:28 +03:00
Jean-Philippe Gagné Guay 496187029a Add denote-filename-is-note-p and use it in denote--buffer-file-names 2023-10-15 08:37:37 -04:00
Protesilaos Stavrou 9b8fb2e490
Add FIXME for denote-file-prompt history 2023-10-15 09:34:34 +03:00
Protesilaos Stavrou e4f39ac0ff
Set the denote-rename-buffer--fallback function 2023-10-15 09:30:49 +03:00
Protesilaos Stavrou 5213f50ae0
Merge branch 'main' of github.com:protesilaos/denote 2023-10-15 08:52:32 +03:00
Protesilaos Stavrou 37e8876b43
Merge pull request #174 from jeanphilippegg/small-cleanup
Small cleanup
2023-10-15 08:52:11 +03:00
Protesilaos Stavrou 238086defb
Add missing markup from commit 69142b2 2023-10-15 08:50:11 +03:00
Protesilaos Stavrou 69142b2335
Expand the documentation of denote-rename-buffer-mode and related 2023-10-15 08:49:11 +03:00
Protesilaos Stavrou ec804b2e45
Use only title by default in denote-rename-buffer-format 2023-10-15 08:23:45 +03:00
Protesilaos Stavrou 425558e73c
BREAKING Add denote-rename-buffer-format user option (work-in-progress) 2023-10-15 08:16:56 +03:00
Protesilaos Stavrou a9486b01f6
Abstract buffer rename into denote-rename-buffer--with-unique-name 2023-10-15 06:40:08 +03:00
Protesilaos Stavrou f695776a72
Remove needless asterisks from some when-let forms 2023-10-15 06:39:43 +03:00
Protesilaos Stavrou 63621dc37b
Fix regression caused by commit c0db85d
What we ultimately want is to be able to extract data from a buffer,
though the previous version did not handle all cases gracefully. A
problem with that was how it would get the title of the current file
as the description of a link, even though it would correctly point to
the selected link target.
2023-10-15 06:23:25 +03:00
Jean-Philippe Gagné Guay edbe4e0193 Return non-nil in denote--dir-in-denote-directory-p 2023-10-14 22:26:13 -04:00
Jean-Philippe Gagné Guay f18a9ea8a5 Remove denote--default-dir-has-denote-prefix 2023-10-14 22:18:32 -04:00
Protesilaos Stavrou c0db85dc68
Make 'denote-rename-buffer-mode' work with new/unsaved buffers (per c365501) 2023-10-14 09:07:47 +03:00
Protesilaos Stavrou c36550139c
Improve denote--file-with-temp-buffer macro to also check unsaved buffers
This gives us the opportunity to insert the contents of a Denote
buffer that has not been saved yet, such as those that are generated
right after we invoke the 'denote' command.
2023-10-14 09:06:53 +03:00
Protesilaos Stavrou b954ade554
Fix typo in the manual 2023-10-13 13:43:03 +03:00
Protesilaos Stavrou 8d489a33fe
BREAKING: Deprecate denote-allow-multi-word-keywords; use denote-file-name-letter-casing 2023-10-13 12:54:19 +03:00
Protesilaos Stavrou 2b1e19ad22
Move denote-file-name-letter-casing further up and add :info link 2023-10-13 12:44:38 +03:00
Protesilaos Stavrou 86493c565e
Add :info link to denote-region-after-new-note-functions 2023-10-13 12:43:05 +03:00
Protesilaos Stavrou eba5cd4c35
Make denote-commands-for-new-notes a user option 2023-10-13 12:40:20 +03:00
Protesilaos Stavrou 33afae3d87
Fix version number in two obsolete calls 2023-10-13 12:30:49 +03:00
Protesilaos Stavrou 4026e574eb
REMOVE deprecation notices that were about older Denote versions
These have been around for several months now (or even more than a
year).  I assume that interested parties have already gotten the
warnings and switched to the currently supported methods.
2023-10-13 12:28:54 +03:00
Protesilaos Stavrou a820e94081
Rewrite the manual for all the "... or create" commands 2023-10-13 08:10:39 +03:00
Protesilaos Stavrou 69391aaf93
Expand the menu with the "... or create" commands 2023-10-13 08:10:21 +03:00
Protesilaos Stavrou 9c85f0c766
Add 'denote-open-or-create-with-command' command 2023-10-13 08:10:01 +03:00
Protesilaos Stavrou 97d3f8df73
Make all "... or create" commands reuse last input as default title value 2023-10-13 08:09:40 +03:00
Protesilaos Stavrou 5ce5699ce1
Consolidate 'denote-link-after-creating', 'denote-link-after-creating-with-command' 2023-10-13 06:06:00 +03:00
Protesilaos Stavrou 979dee6597
Remove two needless comments from the manual 2023-10-12 17:22:43 +03:00
Protesilaos Stavrou d48d634d05
Merge branch 'main' of git.sr.ht:~protesilaos/denote 2023-10-12 07:16:50 +03:00
Protesilaos Stavrou 996b71dfd9
Provide 'day' option for denote-journal-extras-title-format 2023-10-12 07:14:44 +03:00
Protesilaos Stavrou fd3470644a
Make denote-journal-extras-title-format options have a :doc
This is displayed in the Custom interface on a line below the current
value.  Showing the 'format-time-string' can help users determine what
sort of style they want if they opt to supply a custom string.
2023-10-12 07:13:04 +03:00
Protesilaos Stavrou 08d77add46
Make denote-journal-extras-directory explicitly accept a nil value
It should have worked before, though it was not documented and not
provided as an option via the Custom interface.
2023-10-12 07:11:57 +03:00
Protesilaos Stavrou fefa5fd99e
Address byte compiler warnings 2023-10-11 18:42:55 +03:00
Protesilaos Stavrou 6fd67f7b04
Sort with string-collate-lessp instead of string-lessp
This allows us to ignore letter casing.  File name components can have
those due to the new user option 'denote-file-name-letter-casing',
introduced in commit 4fa3433.

The relevant announcement:
<https://protesilaos.com/codelog/2023-10-11-denote-letter-casing-option/>.
2023-10-11 15:33:41 +03:00
Protesilaos Stavrou c0315d0363
Include example in denote-file-name-letter-casing documentation 2023-10-11 14:19:36 +03:00
Protesilaos Stavrou 4fa3433402
Add user option denote-file-name-letter-casing 2023-10-11 14:16:30 +03:00
Protesilaos Stavrou ecb5f8501b
Add functions to return file extension reliably (also with encryption)
We used to retrieve the 'file-name-extension' without checking if it
was a composite of the file type extension (e.g. ".org") and an
encryption extension like ".gpg".  Accounting for this scenario allows
us to properly support encrypted note files, whose extension is
something like ".org.gpg".

Check the two new public functions, 'denote-get-file-extension' and
'denote-get-file-extension-sans-encryption', for the implementation
details.

Thanks to Jens Östlund for reporting a bug with 'denote-keywords-add'
on an encrypted file, which prompted me to investigate this further.
This was done in issue 172 on the GitHub mirror:
<https://github.com/protesilaos/denote/issues/172>.

In short, we had a problem with all operations that needed to retrieve
the file extension when that included an encryption component.
2023-10-11 07:52:15 +03:00
Protesilaos Stavrou 9382120b49
Remove TODO from denote-journal-extras.el (per commit 1a04d80) 2023-10-09 20:53:39 +03:00
Protesilaos Stavrou 1a04d808fd
Change functon from commit 2fac6ba into a private one; rename and tweak it
The original was done by Kostas Andreadis as part of pull request 173
on the GitHub mirror: <https://github.com/protesilaos/denote/pull/173>.

The tweaks I am making:

1. Make the function private in case we decide to introduce more
   changes to it.

2. Make the doc string consistent with the style of the Denote
   code base.
2023-10-09 20:49:25 +03:00
Protesilaos Stavrou bb083fd532
Acknowledge Kostas Andreadis for commit 2fac6ba
The change is less than 15 lines and thus Kostas does not need to
assign copyright to the Free Software Foundation.

The commit is part of pull request 173 on the GitHub mirror:
<https://github.com/protesilaos/denote/pull/173>.
2023-10-09 20:46:00 +03:00
Protesilaos Stavrou c9d8e0555f
Merge pull request #173 from kandread/journal-templates
Use templates for creating journal entries
2023-10-09 20:44:30 +03:00
Protesilaos Stavrou 4fb7c11b83
Clarify denote-rename-buffer-with-identifiier purpose
This is already explained in the user option and the manual, but it is
good to have it here as well.
2023-10-08 12:45:07 +03:00
Protesilaos Stavrou 28943674e5
Clarify denote-rename-buffer-with-title purpose
This is already explained in the user option and the manual, but it is
good to have it here as well.
2023-10-08 12:44:33 +03:00
Protesilaos Stavrou e55cad09e8
Add missing indices for two functions 2023-10-08 12:44:17 +03:00
Protesilaos Stavrou 05a18e36fc
Fix typo in denote-link-return-backlinks 2023-10-08 10:32:31 +03:00
Protesilaos Stavrou 1d0eebf7d3
Merge pull request #159 from jeanphilippegg/duplicate-ids
Duplicate ids
2023-10-08 09:52:59 +03:00
Protesilaos Stavrou fe0659b2f0
Mention 'denote-link-with-signature' in 'denote-prompts' documentation 2023-10-08 09:51:14 +03:00
Kostas Andreadis 2fac6ba061 Use templates for creating journal entries 2023-10-01 09:42:41 -04:00
Jean-Philippe Gagné Guay c5e73c2c99 Use non obsolete variables 2023-09-30 09:31:49 -04:00
Protesilaos Stavrou b060dc3548
Make denote-file-prompt not failt at read-file-name-completion-ignore-case=nil
Thanks to Mirko Hernández for pointing this out in issue 169 on the
GitHub mirror: <https://github.com/protesilaos/denote/issues/169#issuecomment-1741684144>.
2023-09-30 08:44:32 +03:00
Jean-Philippe Gagné Guay c9d024ec30 Update README.org with new functions 2023-09-29 21:58:39 -04:00
Jean-Philippe Gagné Guay fd880f15a5 Remove denote--increment-identifier and denote--return-new-identifier-if-duplicate 2023-09-29 21:58:39 -04:00
Jean-Philippe Gagné Guay 03b510f640 Remove function denote-retrieve-or-create-filename-identifier
Use functions denote-retrieve-filename-identifier and
denote-create-unique-file-identifier instead.
2023-09-29 21:58:18 -04:00
Jean-Philippe Gagné Guay a090eb007c Add optional parameter no-error to denote-retrieve-filename-identifier 2023-09-29 21:03:53 -04:00
Jean-Philippe Gagné Guay 8c140344e0 Remove 'denote-barf-duplicate-id' and make 'denote' avoid duplicate ids 2023-09-29 21:03:42 -04:00
Jean-Philippe Gagné Guay c12d4fdb21 Add 'denote--get-all-used-ids' and 'denote--find-first-unused-id' 2023-09-29 21:03:38 -04:00
Jean-Philippe Gagné Guay 89237ceafd Remove files parameter 2023-09-29 21:03:34 -04:00
Alan Schmitt dcacd25064
Insert description if file exists with 'denote-link-or-create' 2023-09-27 16:40:19 +03:00
Protesilaos Stavrou 95a9824ff8
Add denote--file-with-temp-buffer macro to keep code consistent 2023-09-26 19:33:20 +03:00
Protesilaos Stavrou 005143e5c7
Clarify reference to doc string of denote-link 2023-09-26 13:28:38 +03:00
Protesilaos Stavrou c2ef6f6c78
Tweak 'denote-link-with-signature' doc string 2023-09-26 10:23:41 +03:00
Protesilaos Stavrou 4e35d28192
Fix typo in 'denote-link' doc string 2023-09-26 09:53:36 +03:00
Protesilaos Stavrou bc77760960
Fix typo in doc string 2023-09-26 09:50:04 +03:00
Protesilaos Stavrou ccdcbfb7b7
Placate the compiler about double space after dots in docs 2023-09-25 16:56:27 +03:00
Protesilaos Stavrou 34c632c690
Simplify denote-dired-rename-marked-files interactive spec 2023-09-25 16:56:22 +03:00
Protesilaos Stavrou cc83083117
Add FIXME to avoid duplication with "link after creating" commands 2023-09-25 16:38:22 +03:00
Protesilaos Stavrou 86f91ea3fa
Fix regression with how 'denote-link' was called
These were caused by commit 2e444f3.
2023-09-25 16:37:38 +03:00
Protesilaos Stavrou f74c6380d3
Include default value in 'denote-command-prompt' 2023-09-25 16:37:09 +03:00
Protesilaos Stavrou 15bb6fe2f8
Make 'denote-command-prompt' return symbol 2023-09-25 16:36:32 +03:00
Protesilaos Stavrou beb1fc6d98
Fix prompt text in 'denote-command-prompt' 2023-09-25 16:36:20 +03:00
Protesilaos Stavrou 45fe76ca24
Make denote-file-prompt record history
We had a regression when we switched to the project.el prompt whereby
the history was not being updated.  Or, at least, it was not updated
while I was using it today.  We thus populate the history variable
ourselves, though this may not be necessary.  We shall see.
2023-09-25 16:35:00 +03:00
Protesilaos Stavrou 3a9404cd37
Add new denote-link-with-signature command
Thanks to Mark Olson for mentioning this idea.  It was done in issue
167 on the GitHub mirror:
<https://github.com/protesilaos/denote/issues/167>.
2023-09-25 15:52:19 +03:00
Protesilaos Stavrou 2e444f3f22
BREAKING make 'denote-file-prompt' accept optional regexp filter 2023-09-25 15:47:36 +03:00
Protesilaos Stavrou 3ad974396d
Make 'denote-link' more abstract to also call it from Lisp 2023-09-25 15:19:54 +03:00
Protesilaos Stavrou 1d3ced4487
Fix typos in the manual about 'denote-link' 2023-09-25 15:19:34 +03:00
Protesilaos Stavrou 7a02653305
Fix nil file expansion in denote--extract-title-from-file-history
Thanks to ezchi for bringing this matter to my attention.  It was done
in issue 166 on the GitHub mirror:
<https://github.com/protesilaos/denote/issues/166>.
2023-09-24 08:52:04 +03:00
Protesilaos Stavrou 42fcbd39a9
Add command 'denote-link-after-creating-with-command' (also see cd47e8b) 2023-09-20 17:53:47 +03:00
Protesilaos Stavrou cd47e8bf45
Move command prompt into denote.el; rename it; document everything 2023-09-20 17:44:23 +03:00
Protesilaos Stavrou 57b417b6d6
Fix typo in denote-journal-extras-hook 2023-09-20 13:22:26 +03:00
Protesilaos Stavrou 8f1206d10a
Add 'denote-region' command to sample configuration 2023-09-20 13:19:19 +03:00
Protesilaos Stavrou bf59f686ea
Add 'denote-region' command and accompanying abnormal hook 2023-09-20 13:15:45 +03:00
Protesilaos Stavrou a1d681ff10
Add missing reference to denote-journal-extras-new-or-existing-entry 2023-09-19 14:01:22 +03:00
Protesilaos Stavrou a8cb0bae10
Make denote-after-new-note-hook a defcustom for better discoverability 2023-09-18 14:12:52 +03:00
Protesilaos Stavrou 10f8195352
Revise all journal-related documentation; expand denote-journal-extras
This is a follow-up to the discussion on the mailing list with the
participation of Vedang Manerikar:
<https://lists.sr.ht/~protesilaos/denote/patches/43255#%3C20230803170935.60833-2-ved.manerikar@gmail.com%3E>.
2023-09-18 14:11:13 +03:00
Vedang Manerikar 68da3dd052
Create denote-journal-extra for daily journaling convenience functions
Move journaling functions from the Denote manual into the
`denote-journal-extra.el` file.

We introduce the following:

Variables:
* `denote-journal-extra-directory`: The directory where all your
  journal entries will be written.
* `denote-journal-extra-templates`: Some templates to help you get
  started with journaling.

Functions:
* `denote-journal-extra--make-journal-directory`: Create the
  denote-journal-extra-directory if it does not exist.
* `denote-extras-new-stand-alone-journal-entry`: Create a new journal
  entry (as a stand-alone file)
2023-09-18 08:35:52 +03:00
Protesilaos Stavrou 3061a7387f
Rename 'denote-silo-extras.el', document and refine everything
This is discussed on the mailing list with the participation of Vedang
Manerikar: <https://lists.sr.ht/~protesilaos/denote/patches/43255>.
2023-09-16 13:24:37 +03:00
Vedang Manerikar 4e3c0306dc
Create denote-silo-extra for convenience functions in multiple silos
Move the functions of the Denote manual related to creating, opening
or running commands _after specifying a silo_ to this new file.

This commit introduces the following:

Variables:
* `denote-silo-extra-directories`: List of directories which are silos
* `denote-silo-extra-commands-for-silos`: List of common commands we
  may want to run in a silo

Functions:
* `denote-silo-extra-pick-silo-then-command`
* `denote-silo-extra-create`
* `denote-silo-extra-open-or-create`
2023-09-16 12:48:15 +03:00
Noboru Ota dff73d46c5
Move "Denote" menu on menu-bar to the end after "Tools"
Hi Prot and all in the list.

I'm happy to see that Prot has got his off-grid electricity cabin up.
Hope everything is working as you expect it to, Prot.

Here is a patch. I have got this method from Charles Choi's blog article, "Using
Bookmarks in Emacs like you do in Web Browsers" [1].

[1]:http://yummymelon.com/devnull/using-bookmarks-in-emacs-like-you-do-in-web-browsers.html

– nobiot

>From ec217494621d6d70f28c9c3a1eb1b0539e6e92b7 Mon Sep 17 00:00:00 2001
From: Noboru Ota <me@nobiot.com>
Date: Fri, 15 Sep 2023 09:18:08 +0200
Subject: [PATCH] Move "Denote" menu on menu-bar to the end of global-map after
 Tools
2023-09-15 11:55:16 +03:00
Protesilaos Stavrou 08c0deaa71
Make denote-rename-buffer-mode work with buffers, not just files 2023-09-14 17:47:50 +03:00
Protesilaos Stavrou 39f8ac2787
Define 'denote-after-new-note-hook' to run after 'denote' 2023-09-14 15:48:56 +03:00
Protesilaos Stavrou 5a9645ba85
Acknowledge Ivan Sokolov for commit 7062f3f
This was done in pull request 162 on the GitHub mirror:
<https://github.com/protesilaos/denote/pull/162>.

The change is small and does not require copyright assignment to the
Free Software Foundation.
2023-08-25 07:44:38 +03:00
Protesilaos Stavrou 7f57028c63
Merge pull request #162 from sirikid/double-negations
Get rid of negated predicates
2023-08-25 07:42:12 +03:00
Ivan Sokolov 7062f3fd5b Get rid of negated predicates 2023-08-11 21:36:19 +03:00
Protesilaos Stavrou 1a2bc831be
Acknowledge Jean-Charles Bagneris for commit 99c5db0
The discussion took place on the mailing list:
<https://lists.sr.ht/~protesilaos/denote/patches/43072>.

The change is small and does not require copyright assignment to the
Free Software Foundation.
2023-08-01 07:50:22 +03:00
Jean-Charles Bagneris 99c5db01e3
Treat "T" of identifier as a delimiter in Denote file fontification
The idea was to make things as simple and unobtrusive as possible,
thus I simply treated the "T" separator in the timestamp as a
delimiter.  The effect is noticed in 'denote-dired-mode' and the
default backlinks buffer.

The introduction of a new face, 'denote-faces-time-delimiter', makes
it possible for users to revert to the previous style where the "T"
looks the same as the rest of the identifier.  Evaluate this:

(set-face-attribute 'denote-faces-time-delimiter nil :inherit 'denote-faces-date)
2023-08-01 07:49:41 +03:00
Protesilaos Stavrou 7702d37efd
Fix typo in the changelog 2023-07-21 15:28:38 +03:00
Protesilaos Stavrou df3aedacdd
Update to Denote version 2.0.0 2023-07-21 15:21:29 +03:00
Protesilaos Stavrou 4e2c795257
Fix regression in 'denote-rename-file'
This was caused by commit bbdf360.  The idea is to not create
duplicate identifiers while renaming files.  Though we want existing
identifiers to be retained.

Thanks to Ashton Wiersdorf for reporting the issue on the mailing
list: <https://lists.sr.ht/~protesilaos/denote/%3Cm2lefbbzl1.fsf%40wiersdorfmail.net%3E>.
2023-07-19 20:58:11 +03:00
Protesilaos Stavrou b523f6b99d
Change double prefix meaning in denote-dired-rename-marked-files
The command will now check for duplicate identifiers by default,
unless the corresponding optional argument is supplied.

Thanks to Vedang Manerikar and Jean-Charles Bagneris for commenting on
this feature on the mailing list:
<https://lists.sr.ht/~protesilaos/denote/%3C87v8emeus0.fsf%40protesilaos.com%3E>.
2023-07-19 10:27:45 +03:00
Protesilaos Stavrou 4715b45425
Simplify the value of denote-dired-directories 2023-07-19 10:24:27 +03:00
Protesilaos Stavrou bde73341f8
Remove needless check for duplicate IDs from denote-add-front-matter
That command is not meant to consider other files, but only to add
missing front matter to an existing file.
2023-07-19 10:23:58 +03:00
Protesilaos Stavrou 9a57c98d6e
Mention check for duplicate IDs in denote-rename-file docs 2023-07-19 10:21:02 +03:00
Protesilaos Stavrou 74d1a02034
Acknowledge Adam Růžička for commit 363b1c0
The change was discussed in pull request 158 on the GitHub mirror,
with my suggestion to not use 'seq-filter' as it affected the return
value: <https://github.com/protesilaos/denote/pull/158>.

The change is below the 15 line limit, meaning that Adam does have to
assign copyright to the Free Software Foundation.
2023-07-17 13:02:11 +03:00
Protesilaos Stavrou 6339df8b82
Merge pull request #158 from adamruzicka/seq-filter
Replace seq-keep with version-agnostic variant
2023-07-17 13:00:48 +03:00
Adam Ruzicka 363b1c0080 Replace seq-keep with version-agnostic variant 2023-07-17 11:27:07 +02:00
Protesilaos Stavrou f0b9604099
Acknowledge Bruno Boal for commit 69a7067
The patch was sent via a private channel.  The change is small and
thus does not require copyright assignment to the Free Software
Foundation.
2023-07-14 12:12:55 +03:00
Bruno Boal 69a70674a6
Simplify processing of prefix arg in denote-dired-rename-marked-files 2023-07-14 12:11:54 +03:00
Protesilaos Stavrou bbdf36036b
Make rename operations avoid duplicate identifiers
Before, it was possible for Denote to create duplicate identifiers
while renaming non-Denote files that had the same modification date.
Files can have the same modification date when they are processed by a
program, such as with Git or the 'touch' command.

What Denote now does is check for the presence of the given identifier
and produce a new one that is unique.  Depending on the command, the
check is done against the 'denote-directory' or the set of marked
Dired files.

The command 'denote-dired-rename-marked-files' gains a new optional
parameter, which is interactively passed by the double prefix
argument ('C-u C-u' with default key bindings).  I am not sure this is
the best interface, as we may prefer to always run the check for
duplicate identifiers.  The reason I am doing it this way with the
prefix argument is to avoid an unconditional potentially expensive
operation while renaming a large set of files.
2023-07-14 11:01:12 +03:00
Protesilaos Stavrou f02cc51e2d
Reformat denote--id-exists-p 2023-07-14 04:35:47 +03:00
Protesilaos Stavrou c7851f6130
Refactor denote--buffer-file-names 2023-07-14 04:35:30 +03:00
Vedang Manerikar b44ff6946c
Replace obsolete functions in denote-org-dblock
Use the new versions of these functions instead
2023-07-13 18:09:00 +03:00
Protesilaos Stavrou 1f8d30d470
Remove needless 'progn' from denote-dired-rename-marked-files 2023-07-10 20:29:39 +03:00
Protesilaos Stavrou 1b73189d71
Add documentation to rename files together with dired-preview 2023-07-10 20:19:57 +03:00
Protesilaos Stavrou fa26bd17b2
Reorder A-Z a name in the manual's acknowledgements 2023-07-09 07:24:23 +03:00
Protesilaos Stavrou d34af36ef1
Add denote-dired-rename-marked-files optional arg to skip front matter prompt
Thanks to Jay Rajput for asking the question that inspired me to
implement this.  It was done in issue 155 on the GitHub mirror:
<https://github.com/protesilaos/denote/issues/155>.
2023-07-09 07:21:35 +03:00
Protesilaos Stavrou d33afd4347
Rename lots of "link" commands for simplicity 2023-07-04 17:03:18 +03:00
Protesilaos Stavrou 7927a9c8b1
Use "alias for" instead of "alias of" 2023-07-04 16:46:33 +03:00
Protesilaos Stavrou 58835d479b
Make minor edits to the description 2023-07-04 16:46:11 +03:00
Protesilaos Stavrou 5298547b7a
denote-test: add a WIP test 2023-06-30 16:18:56 +03:00
Protesilaos Stavrou 9150f6c08c
Remove XDG from denote-directory
I learnt that it does not work on the Mac.  Maybe it doesn't work on
Windows either.
2023-06-30 16:16:54 +03:00
Protesilaos Stavrou 8c2124c0dc
Simplify denote-dired-rename-marked-files yes-or-no wording 2023-06-26 16:40:30 +03:00
Protesilaos Stavrou 242b532bde
denote-rename-buffer.el: check if file exists before renaming its buffer 2023-06-26 16:36:40 +03:00
Protesilaos Stavrou f00e12f52a
Fix symbol of denote-rename-buffer group 2023-06-26 16:31:51 +03:00
Protesilaos Stavrou 5fd96522cc
Document variable denote-user-enforced-denote-directory
This was introduced by Vedang Manerikar in 977c757, with further
changes by me in 20ddc97.

Vedang's contribution was made on the mailing list:
<https://lists.sr.ht/~protesilaos/denote/patches/41776>.

Vedang has assigned copyright to the Free Software Foundation.
2023-06-11 19:03:03 +03:00
Protesilaos Stavrou 20ddc97aad
Make stylistic changes to commit 977c757 2023-06-11 18:54:44 +03:00
Vedang Manerikar 977c757f83
Introduce variable user-enforced-denote-directory
The full context is captured on the mailing list[^1]. In brief, the
problem and proposed solution:

Problem  : Function `denote-directory` gives global preference to
           `.dir-locals.el` in all contexts, with no way to override
           it.

Solution : Allow an override so that users can create appropriate
           wrapper functions which work properly in all contexts.

This commit adds a new variable `user-enforced-denote-directory`,
which the end-user can use in their wrapper functions to reliably
control which silo their function should execute in.

This commit also updates the README and modifies the following
functions to demonstrate the use of the variable:

- `my-denote-pick-silo-then-command` (this is the base-case)
- `my-denote-org-extract-subtree` (to cut notes from org files)

The section `Use custom commands to select a silo` contains a small
explanation of the new variable.

[^1]:
https://lists.sr.ht/~protesilaos/denote/%3CCABzEscY9f12VDk64nE9OXDJAZMjsLUT2vrw-es%3D4yO%3Dh6ZJ5wQ%40mail.gmail.com%3E#%3CCABzEscY9f12VDk64nE9OXDJAZMjsLUT2vrw-es=4yO=h6ZJ5wQ@mail.gmail.com%3E
2023-06-11 18:44:21 +03:00
Protesilaos Stavrou 2c54461a9d
Tweak the regexp of denote-faces-file-name-keywords
Thanks to Niall Dooley for reporting a fontification issue when using
denote-dired-mode in tandem with nerd-icons-dired-mode:
<https://lists.sr.ht/~protesilaos/denote/%3CCADS3Lq4KBnf4BPr5Zv_VmMPHMo0OCVsyhyNxMMSLMB7s%3DpMKVw%40mail.gmail.com%3E>.
2023-06-11 18:43:50 +03:00
Protesilaos Stavrou 90a7f826a4
denote-test: define test for denote--format-front-matter 2023-06-05 10:31:17 +03:00
Protesilaos Stavrou 99153fd064
Correct denote--format-front-matter doc string 2023-06-05 10:30:26 +03:00
Protesilaos Stavrou 286351b6c8
denote-test: define some more unit tests 2023-06-05 10:11:29 +03:00
Protesilaos Stavrou a1ce8115fa
Add link to Denote homepage in the 'defgroup'
This link appears in the Custom UI pages (e.g. with M-x customize)
when the Denote group is shown.
2023-06-01 21:22:51 +03:00
Protesilaos Stavrou 4dda46835e
Re-indent section in the manual 2023-06-01 21:22:42 +03:00
Protesilaos Stavrou 99b63d7bf2
Acknowledge Vedang Manerikar for commit f58efb7
The change pertains to sample code in the manual and is within the 15
line limit for contributions without copyright assignment to the Free
Software Foundation.
2023-06-01 21:21:10 +03:00
Vedang Manerikar f58efb7000
Fix my-denote-org-extract-subtree section of the README
The provided function did not work correctly. This commit fixes the
following issues:

1. Fix: Extract tags before deleting the region from the source file.
2. Fix: Use `org-end-of-subtree` to calculate the point we should
   delete upto. `org-entry-end-position` ends at the first sub-heading
   under the tree, which is not what we want. Instead, we want to cut
   the whole subtree.
3. Enhance: Retain the date information available in the subtree. We
   look for three common places for this information -- The CREATED or
   DATE properties in the PROPERTIES drawer, and the CLOSED cookie at
   the element level itself.
2023-06-01 21:04:53 +03:00
Protesilaos Stavrou 90d7b26142
Clarify difference between renaming buffers and files 2023-05-29 10:24:38 +03:00
Protesilaos Stavrou 341e63e796
Fix typo 2023-05-29 10:12:27 +03:00
Protesilaos Stavrou 3e84d6121f
Refer to denote-rename-buffer-mode from file renaming section 2023-05-29 10:07:04 +03:00
Protesilaos Stavrou 9825e3885e
Document the denote-rename-buffer-mode 2023-05-29 10:03:59 +03:00
Protesilaos Stavrou 65e22ff27d
Expand denote-rename-buffer-mode doc string 2023-05-29 10:03:05 +03:00
Protesilaos Stavrou 1b73466e93
Define denote-rename-buffer-function and refine the minor mode setup 2023-05-29 09:50:56 +03:00
Protesilaos Stavrou 4de8c209e8
Add missing autoload cookie for denote-rename-buffer-mode 2023-05-28 08:59:09 +03:00
Protesilaos Stavrou 51bd02b95c
Add initial version of 'denote-rename-buffer' extension
This is related to the discussion I had on the GitHub mirror issue 151
with Morgan Davidson about the name of a Denote buffer:
<https://github.com/protesilaos/denote/issues/151>.
2023-05-28 08:55:37 +03:00
Protesilaos Stavrou 416f2546ec
Make code for file type extensions public
This is meant for developers who need to reuse parts of the Denote
code for their extensions.
2023-05-26 06:46:21 +03:00
Protesilaos Stavrou 06437c276e
Update the sample configuration for my-denote-journal
We already have this example in the manual, though it is helpful to
also show it in the sample configuration section.
2023-05-26 06:36:16 +03:00
Protesilaos Stavrou cb5c20aa05
Fix typo in the manual 2023-05-23 12:39:25 +03:00
Protesilaos Stavrou 3579b2e9b5
denote-test: clarify doc string 2023-05-23 10:11:35 +03:00
Protesilaos Stavrou f3fe2e1e2a
denote-test: refine tests for identifier/signature 2023-05-23 10:11:19 +03:00
Protesilaos Stavrou dc33ea380f
denote-test: use correct name in file header 2023-05-23 10:08:27 +03:00
Protesilaos Stavrou 8358f0c1e2
Make obsolete unused 'denote-file-directory-p' 2023-05-23 06:26:12 +03:00
Protesilaos Stavrou 3a35d3f6cf
denote-test: fix denote-test--denote-file-is-note-p 2023-05-23 06:14:01 +03:00
Protesilaos Stavrou 73dfc1f1bc
Write some unit tests (WORK-IN-PROGRESS)
I wrote those during a live stream (which is recorded for posterity):
<https://protesilaos.com/codelog/2023-05-22-live-stream-emacs-denote-ert-tests/>
2023-05-22 22:32:34 +03:00
Protesilaos Stavrou af2f2c0831
Clarify doc string of 'denote-desluggify'; add TODO for more 2023-05-22 22:32:12 +03:00
Protesilaos Stavrou 6f99ba8ab5
Revise docs of two deprecations to mention current development release version 2023-05-22 22:31:05 +03:00
Protesilaos Stavrou 5dc40e40e4
Fix typo in doc string 2023-05-22 22:30:56 +03:00
Protesilaos Stavrou 583e567f65
Throw an error if denote-sluggify-keywords does not get a list of strings 2023-05-22 22:30:25 +03:00
Protesilaos Stavrou 2c377d4af8
Clarify 'denote--slug-no-punct' doc string 2023-05-22 22:30:05 +03:00
Protesilaos Stavrou b054600d84
BREAKING: change default value of 'denote-allow-multi-word-keywords' 2023-05-22 22:28:49 +03:00
Protesilaos Stavrou 6837f8df06
Make the creation of 'denote-directory' its own function 2023-05-22 14:42:15 +03:00
Protesilaos Stavrou 4b3ba57386
Add missing underscore from examples in exporting section
Thanks to Peter Prevos for bringing this matter to my attention:
<https://lists.sr.ht/~protesilaos/denote/%3C87fs8b85tq.fsf%40prevos.net%3E#%3C87lehiuxfo.fsf@protesilaos.com%3E>.
2023-05-21 09:24:49 +03:00
Protesilaos Stavrou 5babb4ab4b
Document how to rename image-dired files with custom code 2023-05-21 07:17:42 +03:00
Protesilaos Stavrou cb1be4f214
Add missing link from commit f557436 2023-05-21 07:11:15 +03:00
Protesilaos Stavrou f55743609e
Add documentation about exporting notes
Based on what Peter Prevos shared on the mailing list:
https://lists.sr.ht/~protesilaos/denote/%3C87fs8b85tq.fsf%40prevos.net%3E#%3C39fadb7c889472315697fb22e4ee235f@prevos.net%3E

The most significant change I made was to rewrite the code for the
':around' advice.  I also omitted the option of using a prompt, as it
involved another advice: I fear people will copy-paste those without
realising they can break things.  Better keep it relatively simple.
2023-05-21 07:10:14 +03:00
Protesilaos Stavrou ab6c5eca09
Make small tweaks to three headings 2023-05-21 05:54:16 +03:00
Protesilaos Stavrou f89a0533f8
Adjust indentation of denote--directory-all-files-recursively 2023-05-16 19:56:54 +03:00
Protesilaos Stavrou 51eb26999b
Acknowledge relict007 for commit 7dc8f4b
This was done on the mailing list:
<https://lists.sr.ht/~protesilaos/denote/%3C87r0riffdx.fsf%40kotlak.com%3E>

The change is small and thus does not require copyright assignment to
the Free Software Foundation.
2023-05-16 19:50:54 +03:00
relict007 7dc8f4bf7b
don't try to find forward links in non-text files
If a file extension is not in 'denote-file-types', we have no way of
parsing or finding outgoing links in it. This change checks for the
file extension early on in 'when-let*' block and avoids opening the
file which is a relatively costly operation (and would fail finding
links anyway).
2023-05-16 19:50:23 +03:00
Protesilaos Stavrou 5b395c2d98
Do not produce user-error in denote-link-return-{links,backlinks}
The errors should be reserved for the interactive functions.  The
others are for developers.

Thanks to Elias Storms for bringing this matter to my attention:
<694c1517be (commitcomment-112677876)>.
2023-05-13 07:30:04 +03:00
Protesilaos Stavrou 2d9197da16
Tweak sample Journal code from commit cbd39ad 2023-05-11 18:10:39 +03:00
Protesilaos Stavrou cbd39ada72
Document journal entry with check for existing daily note 2023-05-11 17:58:21 +03:00
Protesilaos Stavrou 8f6acf01ca
Delete negative space 2023-05-11 17:57:21 +03:00
Protesilaos Stavrou f0c4a69f93
Make the journal+tmr code sample its own section in the manual 2023-05-11 17:44:24 +03:00
Protesilaos Stavrou 694c1517be
Expose public functions for returning links or backlinks
We are doing the work in standalone functions that can be called from
Lisp, instead of limiting it to interactive functions.  The code is
more composable as a result.

This is in response to the mailing list thread started by relict007:
<https://lists.sr.ht/~protesilaos/denote/%3C87a5ygk6yi.fsf@kotlak.com%3E>

relict007 is the developer of the 'denote-cache' package (in
progress): <https://git.sr.ht/~relict007/denote-cache>.
2023-05-08 18:20:41 +03:00
Protesilaos Stavrou 09548075cf
Tweak formatting of denote--retrieve-files-in-xrefs 2023-05-08 17:52:30 +03:00
Protesilaos Stavrou d0e7c844ce
Document Summer Emacs' essay about usage of Emacs, Denote, etc. 2023-05-08 10:49:27 +03:00
Protesilaos Stavrou c23b37c23a
Update acknowledgements for commit a919202
Thanks to Kai von Fintel for that one-line patch.  The change was
discussed on the mailing list:
<https://lists.sr.ht/~protesilaos/denote/%3CD6A0BE2F-A56E-470B-892D-567B3D136924%40mit.edu%3E>
2023-04-25 07:34:29 +03:00
Kai von Fintel a91920274d
Add signature delimiter to regex for denote-faces
Now that = is accepted as a delimiter inside signatures, the regex for
denote-faces needed to be updated accordingly (see d1275c3).
2023-04-25 07:32:51 +03:00
Protesilaos Stavrou 647cbe03b4
Fix regression for M-p in "do or create" commands
Read the doc string of the commands 'denote-open-or-create' or
'denote-link-or-create' for how this is supposed to work.

In short:

- Invoke the "do or create" command.
- Type something that does not match a file.
- In the following title prompt, hit M-p to bring back the last input.

I realised there was a regression here when I read issue 152 on the
GitHub mirror, which was created by user "ustcpxy":
<https://github.com/protesilaos/denote/issues/152>.  The issue is
about skipping the file title prompt.
2023-04-21 13:12:09 +03:00
Protesilaos Stavrou 7e6bdfb3e2
Update acknowledgements in the manual
Wade Mealing reported the issue about the performance of
'directory-files-recursively' in large, nested directories.  Graham
Marlow proposed a patch that we discussed and eventually installed.
This took place on the mailing list:
<https://lists.sr.ht/~protesilaos/denote/patches/40384>.
2023-04-19 13:39:01 +03:00
Protesilaos Stavrou 84b495663e
Ensure sentence in doc string has double spacing after dot 2023-04-19 13:35:16 +03:00
mgmarlow 871db8c161
Implement predicate on directory-files-recursively for faster searching
Great suggestions! I'm wondering whether we can completely normalize the
use of directory-files-recursively between the two functions. Is there a
reason for them to be different? In my head, I'd imagine the file search
itself is identical--all that needs to change is the use of seq-remove
depending on whether we want to return files or subdirectories.

I brought in your proposed changes and hoisted the predicate function
so it can be shared among both denote-directory-files and
denote-directory-subdirectories.
2023-04-19 13:28:11 +03:00
Noboru Ota 1c771bd012
fix: 9ce9a24, which has error in determining the file ext
Follow-up patch for GitHub issue #135 and this thread on "Issue with
linking non-text files"
<https://lists.sr.ht/~protesilaos/denote/%3C871qm9vagf.fsf%40protesilaos.com%3E#%3C86lejapfp5.fsf@nobiot.com%3E>

This patch addresses two issues:

1) The previous related commit 9ce9a24 does not correctly determine the
   file extension for the case when 'denote-file-type' is explicitly defined.

   When 'denote-file-type' is not org such as markdown-yaml, its extension
   is ".md", not the same as denote-file-type (markdown-yaml)

2) 9ce9a24 does not address the case where you (rather edge one)
   (a) do not explicitly define 'denote-file-type' (thus org is
       assumed)
   (b) you create a denote file other than org
   (c) you create a non-denote file(s) with the same ID as (b).

In the patch "or" expression is used so that we can prioritize
'denote-file-type' and org file types, and then as a secondary priority
look at 'denote--extensions'.  The sequence within this list is not
explicitly define (I would assume it's the alphabetical order).
2023-04-15 07:35:05 +03:00
Protesilaos Stavrou d1275c32f8
Implement sluggify scheme for signatures
Following the Denote file-naming scheme, we use the equals sign to
separate individual words in the SIGNATURE field.  Signatures are
anchored by the "==" field separator.  For context:

- Titles which are anchroned by the "--" field separator use hyphens.
- Keywords which are anchroned by the "__" field separator use underscores.

Thanks to Alfredo Borrás and Jeremy Friesen for discussiing this issue
on the mailing list:
<https://lists.sr.ht/~protesilaos/denote/%3C2A597B4E-5F18-4D97-9457-B3C859DAA020%40zoho.eu%3E>.

Thanks to Kai von Fintel for doing the same on the GitHub mirror in
issue 147: <https://github.com/protesilaos/denote/issues/147>.
2023-04-10 06:53:52 +03:00
Protesilaos Stavrou 7fd0238470
Replace reference to obsolete variable in the manual 2023-04-10 06:45:03 +03:00
Protesilaos Stavrou 38f6e7bd1b
Remove some obsolete aliases from the manual 2023-04-10 06:40:21 +03:00
Noboru Ota c6af333f6e
fix: #142 'denote-link-find-file' to file non-denote file
Refer to the GitHub issue #142 at https://github.com/protesilaos/denote/issues/142.

With this patch, if you select a non-denote file type from the
completion when a single ID points to multiple files,
'denote-link-find-file' correctly finds the one you selected from the
completion.
2023-04-07 09:58:29 +03:00
Protesilaos Stavrou ebb1b5c776
Add entry in the manual on how to troubleshoot Denote 2023-04-01 14:47:17 +03:00
Protesilaos Stavrou 85ae51cee0
Add missing metadata to the manual's heading about the menu 2023-04-01 14:46:51 +03:00
Protesilaos Stavrou d487161751
Untabify and reindent 2023-03-31 21:15:07 +03:00
Protesilaos Stavrou b755832873
Add links to video demo of Denote 2023-03-31 19:56:10 +03:00
Protesilaos Stavrou ecccc046be
Document integration with context-menu-mode (also see 2a1d5eb) 2023-03-31 19:50:31 +03:00
Protesilaos Stavrou 2a1d5eb8f6
Add code to integrate menu with context-menu-mode
Enable it with:

	(add-hook 'context-menu-functions #'denote-context-menu)

Read what I published about the menu:
<https://protesilaos.com/codelog/2023-03-31-emacs-denote-menu/>.
2023-03-31 19:43:24 +03:00
Protesilaos Stavrou a4c06fcede
Fix symbol name in denote-link-or-create docstring 2023-03-31 19:08:03 +03:00
Protesilaos Stavrou 64bc2823d2
Fix symbol name in denote-open-or-create docstring 2023-03-31 19:05:14 +03:00
Protesilaos Stavrou bd4ac5d806
Ensure that 'denote-file-prompt' uses its own history
It used to pollute the 'denote--title-history' with file paths,
whereas that one should only hold strings of file titles.

Thanks to Jonathan Sahar for bringing this matter to my attention.
This was done in issue 144 on the GitHub mirror:
<https://github.com/protesilaos/denote/issues/144>.
2023-03-31 19:05:09 +03:00
Protesilaos Stavrou d76bebd71e
Make more tweaks to the description of menu items 2023-03-31 12:14:34 +03:00
Protesilaos Stavrou e5157183f2
Reorganise the menu; tweak its help text 2023-03-31 12:12:46 +03:00
Protesilaos Stavrou 8dbfe7cb52
Remove superfluous 'derived-mode-p' from the menu 2023-03-31 12:09:24 +03:00
Protesilaos Stavrou 818c6ae08b
Define menu with all Denote commands 2023-03-31 08:32:37 +03:00
Protesilaos Stavrou 1448a7a0ad
Acknowledge Tomasz Hołubowicz for the link fix in 6b5b62e
This was done in pull request 145 on the GitHub mirror:
<https://github.com/protesilaos/denote/pull/145>.
2023-03-25 18:01:36 +02:00
Protesilaos Stavrou 625bf14692
Merge pull request #145 from alternateved/update-link-to-jao-blog
Fix broken link to jao's blog
2023-03-25 17:57:28 +02:00
Tomasz Hołubowicz 6b5b62ebaa Fix broken link to jao's blog 2023-03-24 20:33:38 +01:00
Protesilaos Stavrou e5ec2095b7
Acknowledge Eduardo Grajeda for commit ffbe225
This is within the ~15 line limit and does not require copyright
assignment to the Free Software Foundation.

The patch was sent on the mailing list:
<https://lists.sr.ht/~protesilaos/denote/patches/39896>.
2023-03-23 06:51:05 +02:00
Eduardo Grajeda ffbe225e7a
Fix denote-rename-file-using-front-matter failing when no keywords
Keywords are optional, and the filename is computed properly when
they are nil.
2023-03-23 06:50:15 +02:00
Protesilaos Stavrou 2021999f82
Fix case where denote-rename-file-using-front-matter finds no signature
The idea is that we want the command to behave the way it always did
when the file has no signature and to preserve the signature when it
is present.

Thanks to relict for reporting the issue on the mailing list:
<https://lists.sr.ht/~protesilaos/denote/%3C87zg86lru9.fsf%40kotlak.com%3E>.
2023-03-21 07:16:11 +02:00
Protesilaos Stavrou 62c6853480
MAJOR UPDATE towards version 2.0.0: Merge branch 'signature'
Signatures are an optional extension to Denote's file-naming scheme.
They are arbitrary strings of alphanumerical characters that can be
used to establish sequential relations between files at the level of
their file name (e.g. 1, 1a, 1b, 1b1, 1b2, ...).

Files that have the signature follow this scheme (though read the
documentation of 'denote-prompts' for possible permutations):

    DATE==SIGNATURE--TITLE__KEYWORDS.EXTENSION

As a reminder, Denote's default file-naming scheme is:

    DATE--TITLE__KEYWORDS.EXTENSION

[ Denote can be used to rename any file, not just to create notes.  As
  such, the file-naming scheme is a powerful, yet low-tech invention to
  facilitate searching and filtering. ]

For the time being, signatures are not added to a file's front matter
and are not shown anywhere else beside the file name.  This is done on
purpose to simplify the implementation and make sure we define clear
use-cases for this feature (it is easier to add new functionality than
refactor/break existing one).

Users can create files with signatures either by (i) modifying the
'denote-prompts' user option to affect the standard 'denote' command,
or (ii) by generating such files on demand with the command
'denote-signature' (alias 'denote-create-note-using-signature').

Signatures are treated as quasi-identifiers when renaming files that
include them.  This means that they are not touched by Denote.  The
user must manually update the signature which, in theory, should not
be done if notes already have a predefined sequence.

Signatures are backward-compatible, meaning that existing users are
not impacted by their inclusion.

The signature extension was discussed at length on the GitHub mirror
in issue 115: <https://github.com/protesilaos/denote/issues/115>.
Thanks to Stefan Thesing, Mirko Hernandez, Noboru Ota (nobiot),
Xiaoxing Hu, nbehrnd, Elias Storms, and 101scholar for helping me
reason about this feature, understand its scope, and prototype its
implementation.

The inclusion of the 'signature' branch into 'main' does not mean that
we are done with the development of this feature.  We are simply
making it available to more users while preparing for the release of
version 2.0.0 of Denote.

Watch the video series "Denote as a Zettelkasten" produced by Stefan
Thesing, which makes use of these signatures:
<https://www.thesing-online.de/blog/denote-as-a-zettelkasten>.
2023-03-20 11:23:24 +02:00
Protesilaos Stavrou d7dc32cb42
Rename development-version to 2.0.0 2023-03-20 11:21:34 +02:00
Protesilaos Stavrou ccdee2e549
Document all SIGNATURE symbols in section for developers 2023-03-20 11:21:34 +02:00
Protesilaos Stavrou d02915aaf2
Clarify 'denote-retrieve-filename-signature' doc string 2023-03-20 11:21:34 +02:00
Protesilaos Stavrou c77b0f9ad3
Include 'denote-signature' command in sample configuration 2023-03-20 11:21:34 +02:00
Protesilaos Stavrou 9f3047be4a
Update file-naming scheme features to cover optional signatures 2023-03-20 11:21:34 +02:00
Protesilaos Stavrou f6aa81a961
Update file-naming scheme docs to cover optional signatures 2023-03-20 11:21:34 +02:00
Protesilaos Stavrou 33a59e0c8b
Document 'denote-signature' helper command 2023-03-20 11:21:34 +02:00
Protesilaos Stavrou bb8af7362c
Document 'denote-prompts' signature in the manual 2023-03-20 11:21:34 +02:00
Protesilaos Stavrou 4acd394fba
Mention ~denote-signature~ as part of development-version 2023-03-20 11:21:33 +02:00
Protesilaos Stavrou 0ea65a07c6
Refine denote-faces--file-name-regexp for fontification 2023-03-20 11:21:33 +02:00
Protesilaos Stavrou 84425fc328
Notify users that 'denote-faces-signature' was added in development version 2023-03-20 11:21:33 +02:00
Protesilaos Stavrou 6cd886cc52
Relocate denote-retrieve-filename-signature 2023-03-20 11:21:33 +02:00
Protesilaos Stavrou eb2edfdb04
Reposition alias inside the file 2023-03-20 11:21:33 +02:00
Protesilaos Stavrou bbcbd66a26
Do not produce an error in denote-retrieve-filename-signature 2023-03-20 11:21:33 +02:00
Protesilaos Stavrou 94cae5173e
Notify users that 'denote-prompts' changed in development version 2023-03-20 11:21:33 +02:00
Protesilaos Stavrou d73b0429c7
Add signature to 'denote-prompts' :type 2023-03-20 11:21:33 +02:00
Protesilaos Stavrou 0aff328769
Mention 'denote-signature' command in 'denote-prompts' 2023-03-20 11:21:33 +02:00
Protesilaos Stavrou 5dba1a94da
Document permutations of 'denote-prompts' file naming 2023-03-20 11:21:33 +02:00
Protesilaos Stavrou 7d3da024cc
Document for 'denote-prompts' signature value does 2023-03-20 11:21:33 +02:00
Protesilaos Stavrou 833fa1a210
Make denote--path use signature only if present
Thanks to Mirko Hernandez for informing me about this in issue 115 on
the GitHub mirror: <https://github.com/protesilaos/denote/issues/115>.
2023-03-20 11:21:17 +02:00
Protesilaos Stavrou d102506de4
Add initial support for file name SIGNATURE component
Thanks to Stefan Thesing and Mirko Hernández for explaining how this
additional file name component can be used for zettelkasten purposes.
This is discussed in issue 115 on the GitHub mirror:
<https://github.com/protesilaos/denote/issues/115>.  The design is a
work-in-progress, as we still need to implement the signature at the
level of the front matter.
2023-03-20 11:18:40 +02:00
Protesilaos Stavrou 94a3ffd442
Make formatting change to denote-get-path-by-id
Makes it a bit easier for me to read it.
2023-03-07 14:09:33 +02:00
Noboru Ota 9ce9a245cc
fix(denote-get-path-by-id): #135
Reference: https://github.com/protesilaos/denote/issues/135

This patch change function 'denote-get-path-by-id' to allow for the following:

- A single ID points to multiple files with different extensions
- Denote needs to find a single file out of the multiple files
- This is not necessarily a user error (export an Org file to an HTML)
- Denote should let user decide their "primary" file extension

The case the patch is intended to fix goes something like this:

- You have 20230216__mynotes--tag.org.
- You export it to 20230216__mynotes--tag.html.
- Both files are in denote-directory
- This means you have two files with the same ID with different
  extensions denote-link-find-file, denote-link-find-backlink, and xref
  integration might find the html file INSTEAD OF the .org file

This is because html is earlier in the alphabetical order than
org. Because the function uses seq-find, it will find the .html file
first and returns it.
2023-03-07 14:04:53 +02:00
Protesilaos Stavrou 29680f9583
Merge pull request #140 from sthesing/main
Add link to Video series 'Denote as a Zettelkasten' to README.org
2023-03-03 08:21:37 +02:00
Stefan Thesing 572e3956a6 Fix trailing slash in URL 2023-03-03 07:07:09 +01:00
Stefan Thesing 967124a0d1 Add link to Video series 'Denote as a Zettelkasten' 2023-03-02 22:37:10 +01:00
Protesilaos Stavrou 962835f7de
Fix outdated reference in denote-file-types doc string
Thanks to user doolio for spotting the error and reporting it in issue
139 on the GitHub mirror:
<https://github.com/protesilaos/denote/issues/139>.
2023-03-02 16:12:53 +02:00
Protesilaos Stavrou 65dd92e971
Clarify that last two public functions are part of devel version 2023-02-23 11:35:19 +02:00
Protesilaos Stavrou 87d55b59e7
Make denote-rewrite-keywords function public
Thanks to Alan Schmitt for requesting this change:
<https://lists.sr.ht/~protesilaos/denote/%3Cm2ttzgn2wu.fsf%40m4x.org%3E>.

Making the function public give users confidence that (i) we commit to
its current behaviour, (ii) consider it stable, and (iii) will
document any changes to it.
2023-02-23 11:32:43 +02:00
Protesilaos Stavrou c497ec68a2
Make denote-rewrite-front-matter function public 2023-02-23 11:31:47 +02:00
Protesilaos Stavrou 246806f593
Remove 'compat' dependency
I added it prematurely.  We are not ready for it yet.
2023-02-23 11:22:59 +02:00
Protesilaos Stavrou 23e8e2202f
Simplify check for silo directory
Older versions of this prototype were searching in the PATH argument
but this is no longer the case since commits 3d2e1d5, d5cf35e.

Thanks to Hilde Rhyne for pointing this out on the mailing list:
<https://lists.sr.ht/~protesilaos/denote/%3CB124A5AF-9968-4F7E-9F4B-2BC763E0BFCF@disroot.org%3E#%3Cm0sff0nnhb.fsf@disroot.org%3E>.
2023-02-21 06:40:29 +02:00
Protesilaos Stavrou 0b153464ce
Document new denote-change-file-type command
Thanks to Jean-Philippe Gagné Guay for contributing it in pull request
137 on the GitHub mirror: <https://github.com/protesilaos/denote/pull/137>.
2023-02-20 08:38:51 +02:00
Protesilaos Stavrou d5cf35ec2e
REMOVE recursive search for silo root; keep simpler check
This was never a good idea but I wanted to see what the implications
are.  We do not need this anymore due to commit 3d2e1d5 which
simplifies 'denote--silo-p'.

Thanks to relict007, Hilde Rhyne, Mirko Hernández, Noboru
Ota (nobiot), Alan Schmitt, and hapst3r for their participation in the
relevant discussions:

- https://lists.sr.ht/~protesilaos/denote/%3C87fsb72nge.fsf%40protesilaos.com%3E
- https://lists.sr.ht/~protesilaos/denote/%3C80CBB671-D812-4EA8-8C80-85F9F4144051%40disroot.org%3E
- https://lists.sr.ht/~protesilaos/denote/%3C87pma6t59i.fsf%40kotlak.com%3E
- https://github.com/protesilaos/denote/issues/129 (GitHub mirror)
2023-02-20 08:11:58 +02:00
Protesilaos Stavrou 3d2e1d5aab
Simplify denote--silo-p with dir-locals-find-file 2023-02-20 08:01:11 +02:00
Damien Cassou 0c64ba9853
Simplify 2 functions by extracting `denote-all-files' 2023-02-20 00:13:31 +02:00
Damien Cassou 2a21f845c4
Fix two typos in manual 2023-02-20 00:13:31 +02:00
Protesilaos Stavrou c0839b2a56
Merge pull request #137 from jeanphilippegg/denote-change-file-type
Add function denote-change-file-type
2023-02-19 18:15:49 +02:00
Jean-Philippe Gagné Guay c586ed6832 Add function denote-change-file-type 2023-02-18 13:02:26 -05:00
Protesilaos Stavrou 5010e0946d
Require the 'compat' library
This is for backward compatibility with previous Emacs versions.

I was already planning to incorporate 'compat' as I want to make
Denote available for Emacs 27.1.  Though now we need this
compatibility layer for commit 9d048ba.  Supporting older Emacs
versions requires some more work, but 'compat' gives us what we need
to make it happen.

Thanks to Alan Schmitt for informing me that
'file-name-parent-directory' is for Emacs 29.1:
<https://lists.sr.ht/~protesilaos/denote/%3C87fsb72nge.fsf%40protesilaos.com%3E#%3Cm2cz68ekng.fsf@eduroam-085c.sophia.inria.fr%3E>
2023-02-17 11:35:29 +02:00
Protesilaos Stavrou e86ab9a04e
Make denote-get-path-by-id accept any file with an identifier
This is its intended purpose.  The user was already able to, say,
create 'denote:' links to jpg files but 'denote-get-path-by-id' was
refusing to resolve the path.

Thanks to user relict007 for reporting the problem and discussing it
with me in issue 135 on the GitHub mirror:
<https://github.com/protesilaos/denote/issues/135>.
2023-02-16 06:58:44 +02:00
Protesilaos Stavrou 9d048ba449
Fix commit fa8c3e6 (I pushed the draft code...) 2023-02-15 13:58:07 +02:00
Protesilaos Stavrou fa8c3e6600
Make silos work as directory trees; add denote-silo-nesting-depth option
This expands on commit 828af23 to address some potential issues
related to the problem reported by hapst3r in issue 129 on the GitHub
mirror: <https://github.com/protesilaos/denote/issues/129>.
2023-02-15 13:00:14 +02:00
Protesilaos Stavrou de4da02d1d
Expand overview to remark Denote's use beside "notes" 2023-02-15 07:52:20 +02:00
Protesilaos Stavrou 828af23060
Make sure backlinks get correct 'denote-directory' path
The backlinks buffer will now get the correct path when it is
generated inside a silo.  This is related to issue 129 reported by
hapst3r on the GitHub mirror:
<https://github.com/protesilaos/denote/issues/129>.

This change is necessary because .dir-locals do not work for buffers,
so we must get the value from the file that calls 'denote-link-backlinks'.
2023-02-12 09:22:29 +02:00
Protesilaos Stavrou 0c79c1a699
Add missing properties to a heading in the manual 2023-02-11 07:29:28 +02:00
Protesilaos Stavrou f5c451a978
Make it possible to pass arguments to Denote+org-capture
Thanks to Aditya Yadav for asking about this in issue 132 on the
GitHub mirror: <https://github.com/protesilaos/denote/issues/132>.
2023-02-11 07:25:58 +02:00
Elias Storms ae80fb5971
Fix Org dynamic block backlinks
The commit to include a `:reverse` option introduced a bug: the code
in the `when-let` wasn't executed if reverse was nil. This is fixed by
moving the `plist-get` out of the `when-let` into a separate `let`.
2023-02-03 16:55:13 +02:00
Protesilaos Stavrou 4c8c8d1552
Harden conditionality when 'denote-file-prompt' returns nil
This is related to commit 80d0afd about issue 131 on the GitHub
mirror.[1]  If the 'denote-directory' is empty, the file prompt will
now return nil instead of throwing an exception.  With this change we
make sure to do the right thing in that scenario.

[1]  https://github.com/protesilaos/denote/issues/131
2023-01-25 08:48:02 +02:00
Protesilaos Stavrou 3189fbf498
Make denote-open-or-create work with empty denote-directory
The 'denote-file-prompt' would throw an error before.  The correct
behaviour is to proceed to the "Create" phase if the denote-directory
is empty.

Thanks to user drcxd for reporting the bug in issue 131 on the GitHub
mirror and for testing my sample code:
<https://github.com/protesilaos/denote/issues/131>.
2023-01-25 08:48:02 +02:00
Protesilaos Stavrou f247d902f6
Simplify denote-file-has-supported-extension-p to use 196e68c 2023-01-24 21:21:51 +02:00
Protesilaos Stavrou 196e68c30b
Add denote--extensions-with-encryption helper function 2023-01-24 21:21:14 +02:00
Protesilaos Stavrou 823b3b8ba5
Merge pull request #130 from EFLS/main
Minor updates for dblock
2023-01-23 06:11:35 +02:00
Elias Storms 491f81b68b Add reverse option to dblock denote-baclinks 2023-01-22 15:30:53 +01:00
Elias Storms ad4b9a380a Add documentation on rx options for insert links dblock 2023-01-22 15:29:49 +01:00
Protesilaos Stavrou 34b4a31f39
Add missing custom_id to heading 2023-01-16 07:25:32 +02:00
Protesilaos Stavrou 701aa2fb6a
Write documentation about denote-menu package 2023-01-16 07:21:24 +02:00
Protesilaos Stavrou e9c2e8d73c
Add documentation to select silo interactively
I am providing this in response to a request from GitHub user
rbenit68.  The discussion took place in issue 127 on the GitHub
mirror, with the participation of Mirko Hernandez:
<https://github.com/protesilaos/denote/issues/127>.

The custom code I provide is the expanded version of an idea put forth
by Mirko, to whom I am thankful.
2023-01-16 07:01:35 +02:00
Protesilaos Stavrou f2a6fed82b
Document how to use tree-based file prompt on demand
This is my solution to a request made by Mirko Hernandez on the
possible use of the old Denote file prompt.  It is better not to
introduce a user option for this case, nor to keep multiple variants
of the 'denote-file-prompt' in denote.el, as we want to avoid
confusing the users.

Mirko's feedback was provided in issue 121 on the GitHub mirror:
<https://github.com/protesilaos/denote/issues/121>.
2023-01-05 15:28:20 +02:00
Protesilaos Stavrou 9da32a566b
Make dynamic block accept 'rx' notation for regexp
Thanks to Mirko Hernandez for proposing this feature and discussing it
with me in issue 122 on the GitHub mirror:
<https://github.com/protesilaos/denote/issues/122>.
2023-01-04 14:43:23 +02:00
Protesilaos Stavrou 63e00a3e05
Acknowledge Norwid Behrnd for commit 993f466
The change pertains to the manual and is within the ~15 limit: it does
not require copyright assignment to the Free Software Foundation.
2023-01-03 03:03:10 +02:00
Protesilaos Stavrou 405e0670aa
Merge pull request #123 from nbehrnd/further_reading
add crosslink to Karl Voit's work
2023-01-03 03:01:54 +02:00
Norwid Behrnd 993f466a34 add crosslink to Karl Voit's work
Denote started with management of thoughts/ideas in Emacs org-mode
and extends to files.  Some of the tools initiated by Karl Voit do
offer the addition of time stamps, key words from a controlled
vocabulary, etc on files (e.g., date2name) which may be processed
further (memacs).  It is worth to hint to them, as introduced by
this commit, in appreciation of an earlier invite.[1]

[1] https://github.com/protesilaos/denote/issues/117#issuecomment-1354372589
2023-01-02 13:45:41 +01:00
Protesilaos Stavrou ee2ad59bee
Update copyright years 2023-01-01 17:29:47 +02:00
Protesilaos Stavrou 0f7248b891
Update the manual's Acknowledgements
This is for commit 7597329, which fixes a typo in the manual.  It was
done in pull request 118 on the GitHub mirror:
<https://github.com/protesilaos/denote/pull/118>.
2022-12-21 18:21:36 +02:00
Protesilaos Stavrou 5f02c05118
Merge pull request #118 from sthesing/main
Fix minor typo in README.org
2022-12-21 18:20:06 +02:00
Stefan Thesing 7597329a62 Fix minor typo in README.org 2022-12-21 16:05:23 +01:00
Protesilaos Stavrou 06b0a00819
Remove some needless punctuation from the manual 2022-12-21 12:11:15 +02:00
Protesilaos Stavrou 5db79829b5
Cite publication by Mohamed Suliman in the manual
This was discussed on the mailing list:
<https://lists.sr.ht/~protesilaos/denote/%3C87cz8de3bc.fsf%40protesilaos.com%3E>.
2022-12-21 12:10:01 +02:00
Protesilaos Stavrou 532eafcd29
Update entry for consult-notes package
Thanks to Sven Seebeck for informing me about the need to update the
reference to the 'consult-notes' and for explaining how the current
setup works.
2022-12-21 09:39:36 +02:00
Protesilaos Stavrou 695fc066ba
Make minor tweaks to formatting of code in the manual 2022-12-21 09:39:17 +02:00
Protesilaos Stavrou 6eff85880d
Refine how command aliases are declared
This helps avoid confusion when searching through the available Denote
commands by clearly marking aliases for what they are.
2022-12-21 08:11:08 +02:00
Protesilaos Stavrou 66771bbd2c
Acknowledge Matthew Lemon for commit 743748b
The change Matthew made is within the ~15 line limit.  It does not
require assigning copyright to the Free Software Foundation.  Matthew
will likely need to do so for any future patches.
2022-12-20 04:32:35 +02:00
Matthew Lemon 743748b7bc
added paragraph explaining how to maintain links in silos
This update offers the user a means of maintaining the ability to
create denote links in files within sub-directories of a silo, by
suggesting replacing default-directory with an absolute path.
2022-12-20 04:31:09 +02:00
7 changed files with 16470 additions and 3700 deletions

File diff suppressed because it is too large Load diff

View file

@ -632,7 +632,7 @@ state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 2021 Protesilaos Stavrou
Copyright (C) 2021 Protesilaos
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) 2021 Protesilaos Stavrou
<program> Copyright (C) 2021 Protesilaos
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.

View file

@ -1,5 +1,10 @@
# denote: Simple notes with an efficient file-naming scheme
New to Denote? Start reading this from the manual:
<https://protesilaos.com/emacs/denote#h:c54bedb4-5377-4dbd-853c-5870ace6eb33>.
* * *
Denote is a simple note-taking tool for Emacs. It is based on the idea
that notes should follow a predictable and descriptive file-naming
scheme. The file name must offer a clear indication of what the note is
@ -7,17 +12,18 @@ about, without reference to any other metadata. Denote basically
streamlines the creation of such files while providing facilities to
link between them.
[Watch the video demo that was produced before version 0.1.0 of the
package](https://protesilaos.com/codelog/2022-06-18-denote-demo/).
Denote's file-naming scheme is not limited to "notes". It can be used
for all types of file, including those that are not editable in Emacs,
such as videos. Naming files in a consistent way makes their
filtering and retrieval considerably easier. Denote provides relevant
facilities to rename files, regardless of file type.
+ Package name (GNU ELPA): `denote`
+ Official manual: <https://protesilaos.com/emacs/denote> (the manual is
installed with the package---evaluate `(info "(denote) Top")`)
+ Official manual: <https://protesilaos.com/emacs/denote>
+ Change log: <https://protesilaos.com/emacs/denote-changelog>
+ Git repo on SourceHut: <https://git.sr.ht/~protesilaos/denote>
- Mirrors:
+ GitHub: <https://github.com/protesilaos/denote>
+ GitLab: <https://gitlab.com/protesilaos/denote>
+ Mailing list: <https://lists.sr.ht/~protesilaos/denote>
+ Git repositories:
+ GitHub: <https://github.com/protesilaos/denote>
+ GitLab: <https://gitlab.com/protesilaos/denote>
+ Video demo: <https://protesilaos.com/codelog/2022-06-18-denote-demo/>
+ Backronyms: Denote Everything Neatly; Omit The Excesses. Don't Ever
Note Only The Epiphenomenal.

6314
README.org

File diff suppressed because it is too large Load diff

View file

@ -1,148 +0,0 @@
;;; denote-org-dblock.el --- Org Dynamic blocks for denote.el -*- lexical-binding: t -*-
;; Copyright (C) 2022 Free Software Foundation, Inc.
;; Author: Elias Storms <elias.storms@gmail.com>
;; Maintainer: Denote Development <~protesilaos/denote@lists.sr.ht>
;; URL: https://git.sr.ht/~protesilaos/denote
;; Mailing-List: https://lists.sr.ht/~protesilaos/denote
;; This file is NOT part of GNU Emacs.
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;;
;; This file provides a specialized Org-mode extension to Denote: it
;; introduces Org Dynamic blocks that collect links to Denote notes
;; based on a provided regexp. In short, this automates
;; 'denote-link-add-links'.
;;
;; For more information, read the commented code below or refer to the
;; Denote manual
;;; Code:
(require 'denote)
(require 'org)
;;; Org-mode Dynamic blocks
;;;; Dynamic block to search links
;; Org-mode has Dynamic blocks the content of which can be computed
;; dynamically based on their header. This functionality can be
;; leveraged to create automated lists of links to specific notes
;; (similar to 'denote-link-add-links', but with the added benefit
;; that the list can be updated easily).
;;
;; A dynamic block of the 'denote-links' type looks like this:
;;
;; #+BEGIN: denote-links :regexp "denote"
;;
;; #+END:
;;
;; With point at the #+BEGIN: line, pressing 'C-c C-c' will replace the
;; contents of the block with links to notes matching the search
;; ':regexp'. See also the denote manual on 'denote-link-add-links'.
;;
;; Inserting a block can be done via the Org-mode entry point
;; 'org-dynamic-block-insert-dblock' and selecting 'denote-links' from
;; the list, or directly by calling 'denote-org-dblock-insert-links'.
;;
;;
;; Org Dynamic blocks of the denote-links type can have the follwoing
;; arguments (in any order):
;; 1. :regexp "string" -- the search input (required)
;; 2. :missing-only t -- to only include missing links
;; 3. :reverse t -- reverse sort order (or don't, when nil)
;; 4. :block-name "n" -- to include a name for later processing
;;
;; By default ':missing-only t' is included as a parameter in the
;; block's header, so that only "missing links" are included (i.e.,
;; links to notes that the current buffer doesn't already link to).
;; Remove this parameter or set to 'nil' to include all matching
;; notes.
;;
;; With ':reverse' the value of 'denote-link-add-links-sort' can be
;; let-bound specifically for this list of links. For more
;; information, see the documentation of this variable.
;;
;; With ':block-name "string"' include a '#+NAME: string' line in the
;; Dynamic block. This allows use of the Dynamic block output as input
;; for further computation, e.g. in Org source blocks.
;;;###autoload
(defun denote-org-dblock-insert-links (regexp)
"Create Org dynamic block to insert Denote links matching REGEXP."
(interactive
(list
(read-regexp "Search for notes matching REGEX: " nil 'denote-link--add-links-history)))
(org-create-dblock (list :name "denote-links"
:regexp regexp
:missing-only 't))
(org-update-dblock))
(org-dynamic-block-define "denote-links" 'denote-org-dblock-insert-links)
;; By using the `org-dblock-write:' format, Org-mode knows how to
;; compute the dynamic block. Inner workings of this function copied
;; from `denote-link-add-links'.
(defun org-dblock-write:denote-links (params)
"Function to update `denote-links' Org Dynamic blocks.
Used by `org-dblock-update' with PARAMS provided by the dynamic block."
(let ((regexp (plist-get params :regexp))
(missing-only (plist-get params :missing-only))
(block-name (plist-get params :block-name))
(denote-link-add-links-sort (plist-get params :reverse))
(current-file (buffer-file-name)))
(when block-name
(insert "#+name: " block-name "\n"))
(if missing-only
(progn
(denote-link-add-missing-links regexp)
(join-line)) ;; remove trailing empty line left by denote-link--prepare-links
(when-let ((files (delete current-file
(denote-directory-files-matching-regexp regexp))))
(insert (denote-link--prepare-links files current-file nil))
(join-line))))) ;; remove trailing empty line
;;;; Dynamic block for backlinks
;; Similarly, we can create a 'denote-backlinks' block that inserts
;; links to notes that link to the current note.
;; Note that this block type doesn't take any additional parameters
;; (such as ':missing-only').
;;;###autoload
(defun denote-org-dblock-insert-backlinks ()
"Insert new Org dynamic block to include backlinks."
(interactive)
(org-create-dblock (list :name "denote-backlinks"))
(org-update-dblock))
(org-dynamic-block-define "denote-backlinks" 'denote-org-dblock-insert-backlinks)
(defun org-dblock-write:denote-backlinks (_params)
"Function to update `denote-backlinks' Org Dynamic blocks.
Used by `org-dblock-update' with PARAMS provided by the dynamic block."
(when-let* ((file (buffer-file-name))
(id (denote-retrieve-filename-identifier file))
(files (delete file (denote--retrieve-files-in-xrefs id))))
(insert (denote-link--prepare-links files file nil))
(join-line))) ;; remove trailing empty line
(provide 'denote-org-dblock)
;;; denote-org-dblock.el ends here

8375
denote.el

File diff suppressed because it is too large Load diff

483
tests/denote-test.el Normal file
View file

@ -0,0 +1,483 @@
;;; denote-test.el --- Unit tests for Denote -*- lexical-binding: t -*-
;; Copyright (C) 2023-2026 Free Software Foundation, Inc.
;; Author: Protesilaos <info@protesilaos.com>
;; Maintainer: Protesilaos <info@protesilaos.com>
;; URL: https://github.com/protesilaos/denote
;; This file is NOT part of GNU Emacs.
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;; Tests for Denote. Note that we are using Shorthands in this file,
;; so the "dt-" prefix really is "denote-test-". Evaluate the
;; following to learn more:
;;
;; (info "(elisp) Shorthands")
;;; Code:
(require 'ert)
;;;; Tests for denote.el
(require 'denote)
(ert-deftest dt-denote-directories--get-paths ()
"Test that `denote-directories--get-paths' returns a list of paths."
(let ((path "~/Documents/notes"))
(should (equal
(denote-directories--get-paths path)
(list (file-name-as-directory (expand-file-name path))))))
(let ((paths (list "~/Documents/notes" "~/Documents/books")))
(should (equal
(denote-directories--get-paths paths)
(mapcar
(lambda (path)
(file-name-as-directory (expand-file-name path)))
paths)))
(should (seq-every-p
(lambda (path)
(string-suffix-p "/" path))
(denote-directories--get-paths paths)))
(should-not (null (denote-directories--get-paths paths))))
(should-error (denote-directories--get-paths 'hello))
(should-error (denote-directories--get-paths '(hello)))
(should-error (denote-directories--get-paths '(1 2 3))))
(ert-deftest dt-denote--make-denote-directory ()
"Test that `denote--make-denote-directory' creates the directory."
(let* ((names (list "denote-test-made-directory-1" "denote-test-made-directory-2"))
(directories (mapcar
(lambda (directory)
(file-name-as-directory (expand-file-name directory temporary-file-directory)))
names)))
(should-not (denote-directories--make-paths directories))
(should (seq-every-p #'file-name-directory directories))
(dolist (directory directories)
(delete-directory directory))))
(ert-deftest dt-denote-directories ()
"Test that `denote-directories' returns list of directories.
It does so by expanding the value of the user option `denote-directory'.
Also see `denote-test--denote--make-denote-directory',
`denote-test---denote-directories--get-paths'."
(let ((denote-directory "/tmp/denote-test-notes"))
(should
(equal
(denote-directories)
(list (file-name-as-directory (expand-file-name denote-directory)))))
(should (and (file-directory-p denote-directory)
(file-name-absolute-p denote-directory))))
(let ((denote-directory (list "/tmp/denote-test-notes-1" "/tmp/denote-test-notes-2")))
(should
(equal
(denote-directories)
(mapcar
(lambda (directory)
(file-name-as-directory (expand-file-name directory)))
denote-directory)))
(should (and (seq-every-p #'file-directory-p denote-directory)
(seq-every-p #'file-name-absolute-p denote-directory)))))
(ert-deftest dt-denote-sluggify-title ()
"Test that `denote-sluggify-title' removes punctuation from the string.
Concretely, remove anything specified in `denote-sluggify-title'."
(should (equal (denote-sluggify-title "this-is-!@#test") "this-is-test")))
(ert-deftest dt-denote-slug-keep-only-ascii ()
"Test that `denote-slug-keep-only-ascii' removes non-ASCII characters."
(should (equal
(denote-slug-keep-only-ascii "There are no-ASCII characters here 😀")
"There are no-ASCII characters here ")))
(ert-deftest dt-denote-slug-hyphenate ()
"Test that `denote-slug-hyphenate' hyphenates the string.
Also replace multiple hyphens with a single one and remove any
leading and trailing hyphen."
(should (equal (denote-slug-hyphenate "__ This is a test __ ") "This-is-a-test")))
(ert-deftest dt-denote-sluggify ()
"Test that `denote-sluggify' sluggifies the string.
To sluggify is to (i) downcase, (ii) hyphenate, (iii) de-punctuate, and (iv) remove spaces from the string."
(should (equal (denote-sluggify 'title " ___ !~!!$%^ This iS a tEsT ++ ?? ") "this-is-a-test")))
(ert-deftest Ddenote--slug-put-equals ()
"Test that `denote-slug-put-equals' replaces spaces/underscores with =.
Otherwise do the same as what is described in
`denote-test--denote-slug-hyphenate'.
The use of the equals sign is for the SIGNATURE field of the
Denote file name."
(should (equal (denote-slug-put-equals "__ This is a test __ ") "This=is=a=test")))
(ert-deftest dt-denote-sluggify-signature ()
"Test that `denote-sluggify-signature' sluggifies the string for file signatures.
This is like `denote-test--denote-sluggify', except that it also
accounts for what we describe in `denote-test--denote-slug-put-equals'."
(should (equal (denote-sluggify-signature "--- ___ !~!!$%^ This -iS- a tEsT ++ ?? ") "this=is=a=test")))
(ert-deftest dt-denote-sluggify-keyword ()
"Test that `denote-sluggify-keyword' sluggifies the string while joining words.
In this context, to join words is to elimitate any space or
delimiter between them.
Otherwise, this is like `denote-test--denote-sluggify'."
(should (equal (denote-sluggify-keyword "--- ___ !~!!$%^ This iS a - tEsT ++ ?? ") "thisisatest")))
(ert-deftest dt-denote-sluggify-keywords ()
"Test that `denote-sluggify-keywords' sluggifies a list of strings.
The function also account for the value of the user option
`denote-allow-multi-word-keywords'."
(should (equal (denote-sluggify-keywords '("one !@# --- one" " two" "__ three __")) '("oneone" "two" "three"))))
(ert-deftest dt-denote-slug-remove-accents ()
"Test that `denote-slug-remove-accents' removed diacretics."
(should (string= (denote-slug-remove-accents "ê") "e"))
(should (string= (denote-slug-remove-accents "ñ") "n")))
(ert-deftest dt-denote--file-empty-p ()
"Test that `denote--file-empty-p' returns non-nil on empty file."
(let ((file (make-temp-file "denote-test")))
(should (denote--file-empty-p file))
(with-current-buffer (find-file-noselect file)
(insert "Hello world, this is not empty anymore!")
(save-buffer))
(should-not (denote--file-empty-p file))
(delete-file file)))
(ert-deftest dt-denote-file-has-denoted-filename-p ()
"Test that `denote-file-has-denoted-filename-p' validates a Denote file name."
(should (denote-file-has-denoted-filename-p "20230522T154900--test__keyword.txt"))
(should-not (denote-file-has-denoted-filename-p "hello")))
(ert-deftest dt-denote-file-has-identifier-p ()
"Test that `denote-file-has-identifier-p' checks for a Denote identifier."
(should (denote-file-has-identifier-p "20230522T154900--test__keyword.txt"))
(should-not (denote-file-has-identifier-p "T154900--test__keyword.txt")))
(ert-deftest dt-denote-file-has-signature-p ()
"Test that `denote-file-has-signature-p' checks for a Denote signature."
(should (denote-file-has-signature-p "20230522T154900==sig--test__keyword.txt"))
(should-not (denote-file-has-signature-p "20230522T154900--test__keyword.txt")))
(ert-deftest dt-denote-file-has-supported-extension-p ()
"Test that `denote-file-has-supported-extension-p' matches a supported extension."
(let ((extensions (denote-file-type-extensions-with-encryption)))
(should
(member
(file-name-extension "20230522T154900==sig--test__keyword.txt" :period)
extensions))
(should-not
(member
(file-name-extension "20230522T154900==sig--test__keyword" :period)
extensions))))
(ert-deftest dt-denote-file-type-extensions ()
"Test that `denote-file-type-extensions' returns file extensions.
We check for the common file type extensions, though the user can set
`denote-file-types' to nil and handle things on their own or, anyhow,
modify that variable."
(let ((extensions (denote-file-type-extensions)))
(should (or (member ".md" extensions)
(member ".org" extensions)
(member ".txt" extensions)))))
(ert-deftest dt-denote-file-type-extensions-with-encryption ()
"Test that `denote-file-type-extensions-with-encryption' covers encryption.
Extend what we do in `denote-test--denote-file-type-extensions'."
(let ((extensions (denote-file-type-extensions-with-encryption)))
(should (or (member ".md" extensions)
(member ".org" extensions)
(member ".txt" extensions)
(member ".md.gpg" extensions)
(member ".org.gpg" extensions)
(member ".txt.gpg" extensions)
(member ".md.age" extensions)
(member ".org.age" extensions)
(member ".txt.age" extensions)))))
(ert-deftest dt-denote--format-front-matter ()
"Test that `denote--format-front-matter' formats front matter correctly.
To make the test reproducible, set `denote-date-format' to a value that
does not involve the time zone."
(let ((denote-date-format "%Y-%m-%d")
(denote-front-matter-components-present-even-if-empty-value '(title keywords signature date identifier)))
(should (equal (denote--format-front-matter "" (date-to-time "20240101T120000") '("") "" "" 'text)
(string-join
'("title: "
"date: 2024-01-01"
"tags: "
"identifier: "
"signature: "
"---------------------------\n\n")
"\n")))
(should (equal (denote--format-front-matter "Some test" (date-to-time "2023-06-05") '("one" "two") "20230605T102234" "sig" 'text)
(string-join
'("title: Some test"
"date: 2023-06-05"
"tags: one two"
"identifier: 20230605T102234"
"signature: sig"
"---------------------------\n\n")
"\n")))
(should (equal (denote--format-front-matter "" (date-to-time "20240101T120000") nil "" "" 'org)
(string-join
'("#+title: "
"#+date: 2024-01-01"
"#+filetags: "
"#+identifier: "
"#+signature: "
"\n")
"\n")))
(should (equal
(denote--format-front-matter
"Some test" (date-to-time "2023-06-05") '("one" "two")
"20230605T102234" "sig" 'org)
(string-join
'("#+title: Some test"
"#+date: 2023-06-05"
"#+filetags: :one:two:"
"#+identifier: 20230605T102234"
"#+signature: sig"
"\n")
"\n")))
(should (equal (denote--format-front-matter "" (date-to-time "20240101T120000") nil "" "" 'markdown-yaml)
(string-join
'("---"
"title: \"\""
"date: 2024-01-01"
"tags: []"
"identifier: \"\""
"signature: \"\""
"---"
"\n")
"\n")))
(should (equal (denote--format-front-matter "Some test" (date-to-time "2023-06-05") '("one" "two") "20230605T102234" "sig" 'markdown-yaml)
(string-join
'("---"
"title: \"Some test\""
"date: 2023-06-05"
"tags: [\"one\", \"two\"]"
"identifier: \"20230605T102234\""
"signature: \"sig\""
"---"
"\n")
"\n")))
(should (equal (denote--format-front-matter "" (date-to-time "20240101T120000") nil "" "" 'markdown-toml)
(string-join
'("+++"
"title = \"\""
"date = 2024-01-01"
"tags = []"
"identifier = \"\""
"signature = \"\""
"+++"
"\n")
"\n")))
(should (equal (denote--format-front-matter "Some test" (date-to-time "2023-06-05") '("one" "two") "20230605T102234" "sig" 'markdown-toml)
(string-join
'("+++"
"title = \"Some test\""
"date = 2023-06-05"
"tags = [\"one\", \"two\"]"
"identifier = \"20230605T102234\""
"signature = \"sig\""
"+++"
"\n")
"\n")))))
(ert-deftest dt-denote-format-file-name ()
"Test that `denote-format-file-name' returns all expected paths."
(let* ((title "Some test")
(id (format-time-string denote-date-identifier-format (denote-valid-date-p "2023-11-28 05:53:11")))
(denote-directory "/tmp/test-denote")
(dir (car (denote-directories)))
(ext (denote--file-extension 'org))
(kws '("one" "two")))
(should-error (denote-format-file-name nil id kws title ext ""))
(should-error (denote-format-file-name "" id kws title ext ""))
;; NOTE that `denote-directory' is the `let' bound value without the suffix
(should-error (denote-format-file-name denote-directory id kws title ext ""))
(should-error (denote-format-file-name dir "" nil "" ext ""))
(should (equal (denote-format-file-name dir nil kws title ext "") "/tmp/test-denote/--some-test__one_two.org"))
(should (equal (denote-format-file-name dir "" kws title ext "") "/tmp/test-denote/--some-test__one_two.org"))
(should (equal (denote-format-file-name dir "0123456" kws title ext "") "/tmp/test-denote/@@0123456--some-test__one_two.org"))
(should (equal (denote-format-file-name dir id kws title ext "") "/tmp/test-denote/20231128T055311--some-test__one_two.org"))
(should (equal (denote-format-file-name dir id nil "" ext "") "/tmp/test-denote/20231128T055311.org"))
(should (equal (denote-format-file-name dir id nil nil ext nil) "/tmp/test-denote/20231128T055311.org"))
(should (equal (denote-format-file-name dir id kws title ext "sig") "/tmp/test-denote/20231128T055311==sig--some-test__one_two.org"))))
(ert-deftest dt-denote-get-file-extension ()
"Test that `denote-get-file-extension' gets the correct file extension."
(should (equal (denote-get-file-extension "20231010T105034--some-test-file__denote_testing") ""))
(should (equal (denote-get-file-extension "20231010T105034--some-test-file__denote_testing.org") ".org"))
(should (equal (denote-get-file-extension "20231010T105034--some-test-file__denote_testing.org.gpg") ".org.gpg"))
(should (equal (denote-get-file-extension "20231010T105034--some-test-file__denote_testing.org.age") ".org.age")))
(ert-deftest dt-denote-get-file-extension-sans-encryption ()
"Test that `denote-get-file-extension-sans-encryption' gets the file extension without encryption."
(should (equal (denote-get-file-extension-sans-encryption "20231010T105034--some-test-file__denote_testing") ""))
(should (equal (denote-get-file-extension-sans-encryption "20231010T105034--some-test-file__denote_testing.org") ".org"))
(should (equal (denote-get-file-extension-sans-encryption "20231010T105034--some-test-file__denote_testing.org.gpg") ".org"))
(should (equal (denote-get-file-extension-sans-encryption "20231010T105034--some-test-file__denote_testing.org.age") ".org")))
;; TODO 2026-04-06: For the `denote-file-type'.
(ert-deftest dt-denote-filetype-heuristics ()
"Test that `denote-filetype-heuristics' gets the correct file type."
(should-not (denote-filetype-heuristics "20231010T105034--some-test-file__denote_testing"))
(should (eq (denote-filetype-heuristics "20231010T105034--some-test-file__denote_testing.org") 'org))
(should (eq (denote-filetype-heuristics "20231010T105034--some-test-file__denote_testing.org.gpg") 'org))
(should (eq (denote-filetype-heuristics "20231010T105034--some-test-file__denote_testing.org.age") 'org))
(should (eq (denote-filetype-heuristics "20231010T105034--some-test-file__denote_testing.txt") 'text))
(should (eq (denote-filetype-heuristics "20231010T105034--some-test-file__denote_testing.txt.gpg") 'text))
(should (eq (denote-filetype-heuristics "20231010T105034--some-test-file__denote_testing.txt.age") 'text))
(should (eq (denote-filetype-heuristics "20231010T105034--some-test-file__denote_testing.md")
(caar (denote--file-types-with-extension ".md"))))
(should (eq (denote-filetype-heuristics "20231010T105034--some-test-file__denote_testing.md.gpg")
(caar (denote--file-types-with-extension ".md"))))
(should (eq (denote-filetype-heuristics "20231010T105034--some-test-file__denote_testing.md.age")
(caar (denote--file-types-with-extension ".md")))))
(ert-deftest dt-denote-retrieve-filename-identifier ()
"Test that `denote-retrieve-filename-identifier' returns only the identifier."
(should (null (denote-retrieve-filename-identifier "/path/to/testing/--this-is-a-test-reordered__denote_testing.org")))
(should (equal (denote-retrieve-filename-identifier "/path/to/testing/20240610T194654--this-is-a-test-reordered__denote_testing.org") "20240610T194654"))
(should (equal (denote-retrieve-filename-identifier "/path/to/testing/20240610T194654==signature--this-is-a-test-reordered__denote_testing.org") "20240610T194654"))
(should (equal (denote-retrieve-filename-identifier "/path/to/testing/--this-is-a-test-reordered__denote_testing@@20240610T194654.org") "20240610T194654"))
(should (equal (denote-retrieve-filename-identifier "/path/to/testing/__denote_testing--this-is-a-test-reordered@@20240610T194654.org") "20240610T194654"))
(should (equal (denote-retrieve-filename-identifier "/path/to/testing/__denote_testing@@20240610T194654--this-is-a-test-reordered.org") "20240610T194654"))
(should (equal (denote-retrieve-filename-identifier "/path/to/testing/==signature__denote_testing@@20240610T194654--this-is-a-test-reordered.org") "20240610T194654")))
(ert-deftest dt-denote-retrieve-filename-title ()
"Test that `denote-retrieve-filename-title' returns only the title."
(should (null (denote-retrieve-filename-title "/path/to/testing/20240610T194654__denote_testing.org")))
(should (equal (denote-retrieve-filename-title "/path/to/testing/20240610T194654--this-is-a-test-reordered__denote_testing.org") "this-is-a-test-reordered"))
(should (equal (denote-retrieve-filename-title "/path/to/testing/20240610T194654==signature--this-is-a-test-reordered__denote_testing.org") "this-is-a-test-reordered"))
(should (equal (denote-retrieve-filename-title "/path/to/testing/--this-is-a-test-reordered__denote_testing@@20240610T194654.org") "this-is-a-test-reordered"))
(should (equal (denote-retrieve-filename-title "/path/to/testing/__denote_testing--this-is-a-test-reordered@@20240610T194654.org") "this-is-a-test-reordered"))
(should (equal (denote-retrieve-filename-title "/path/to/testing/__denote_testing@@20240610T194654--this-is-a-test-reordered.org") "this-is-a-test-reordered"))
(should (equal (denote-retrieve-filename-title "/path/to/testing/==signature__denote_testing@@20240610T194654--this-is-a-test-reordered.org") "this-is-a-test-reordered")))
(ert-deftest dt-denote-retrieve-filename-keywords ()
"Test that `denote-retrieve-filename-keywords' returns only the keywords."
(should (null (denote-retrieve-filename-keywords "/path/to/testing/20240610T194654--this-is-a-test-reordered.org")))
(should (equal (denote-retrieve-filename-keywords "/path/to/testing/20240610T194654--this-is-a-test-reordered__denote_testing.org") "denote_testing"))
(should (equal (denote-retrieve-filename-keywords "/path/to/testing/20240610T194654==signature--this-is-a-test-reordered__denote_testing.org") "denote_testing"))
(should (equal (denote-retrieve-filename-keywords "/path/to/testing/--this-is-a-test-reordered__denote_testing@@20240610T194654.org") "denote_testing"))
(should (equal (denote-retrieve-filename-keywords "/path/to/testing/__denote_testing--this-is-a-test-reordered@@20240610T194654.org") "denote_testing"))
(should (equal (denote-retrieve-filename-keywords "/path/to/testing/__denote_testing@@20240610T194654--this-is-a-test-reordered.org") "denote_testing"))
(should (equal (denote-retrieve-filename-keywords "/path/to/testing/==signature__denote_testing@@20240610T194654--this-is-a-test-reordered.org") "denote_testing")))
(ert-deftest dt-denote-retrieve-filename-signature ()
"Test that `denote-retrieve-filename-signature' returns only the signature."
(should (null (denote-retrieve-filename-signature "/path/to/testing/20240610T194654--this-is-a-test-reordered__denote_testing.org")))
(should (equal (denote-retrieve-filename-signature "/path/to/testing/20240610T194654==signature--this-is-a-test-reordered__denote_testing.org") "signature"))
(should (equal (denote-retrieve-filename-signature "/path/to/testing/--this-is-a-test-reordered==signature__denote_testing@@20240610T194654.org") "signature"))
(should (equal (denote-retrieve-filename-signature "/path/to/testing/__denote_testing--this-is-a-test-reordered==signature@@20240610T194654.org") "signature"))
(should (equal (denote-retrieve-filename-signature "/path/to/testing/__denote_testing@@20240610T194654--this-is-a-test-reordered==signature.org") "signature"))
(should (equal (denote-retrieve-filename-signature "/path/to/testing/==signature__denote_testing@@20240610T194654--this-is-a-test-reordered.org") "signature")))
(ert-deftest dt-denote-date-identifier-p ()
"Test that `denote-date-identifier-p' works for Denote identifiers."
(should (denote-date-identifier-p "20240901T090910"))
(should-not (denote-date-identifier-p "20240901T090910-not-identifier-format")))
(ert-deftest dt-denote-id-to-date ()
"Test that `denote-id-to-date' returns the date from an identifier."
(should (equal (denote-id-to-date "20240901T090910") "2024-09-01"))
(should-error (denote-id-to-date "20240901T090910-not-identifier-format")))
(ert-deftest dt-denote--date-convert ()
"Test that `denote--date-convert' works with dates."
(should (equal (denote--date-convert '(26454 45206 461174 657000) :list) '(26454 45206 461174 657000)))
(should (equal (denote--date-convert '(26454 45206 461174 657000) :string) "2024-12-09 10:55:50"))
(should (equal (denote--date-convert nil :string) ""))
(should (equal (denote--date-convert nil :list) nil))
(should-error (denote--date-convert '(26454 45206 461174 657000) :not-valid-type))
(should-error (denote--date-convert nil :not-valid-type)))
;; TODO 2026-02-23: Add support for Windows paths. But I need somebody who has a Windows machine...
(ert-deftest dt-denote--get-common-root-directory ()
"Test that `denote--get-common-root-directory' returns the right path."
(should (string=
(denote--get-common-root-directory
'("/home/prot/Documents/notes/"
"/home/prot/Documents/notes/attachments"))
"/home/prot/Documents/notes/"))
(should (string=
(denote--get-common-root-directory
'("/home/prot/Documents/"
"/home/prot/Documents/notes/attachments"))
"/home/prot/Documents/"))
(should (string=
(denote--get-common-root-directory
'("/home/prot/Books/"
"/home/prot/Documents/notes/"))
"/home/prot/"))
(should (string=
(denote--get-common-root-directory
'("/tmp/notes/"
"/home/prot/Documents/notes/"))
"/"))
(should (string=
(denote--get-common-root-directory
'("/home/prot/Documents/notes/"))
"/home/prot/Documents/notes/"))
(should-error (denote--get-common-root-directory '("~/Documents/notes/"))))
(ert-deftest dt-denote-query--keywords-as-regexp ()
"Test that `denote-query--keywords-as-regexp' works as intended."
(should (string= (denote-query--keywords-as-regexp '("one" "two")) "_\\(?:one\\|two\\)"))
(should-error (denote-query--keywords-as-regexp "one"))
(should-error (denote-query--keywords-as-regexp '("one" 1))))
(ert-deftest dt-denote-file-type ()
"Test that function `denote-file-type' does what it is meant to."
(let* ((create-file-fn (lambda (name extension)
(expand-file-name
(format "denote-test-file-type-%s.%s" name extension)
(temporary-file-directory))))
(modify-file-fn (lambda (file contents)
(with-current-buffer (find-file-noselect file)
(erase-buffer)
(insert contents)
(save-buffer))))
(yaml-file (funcall create-file-fn "yaml" "md"))
(toml-file (funcall create-file-fn "toml" "md"))
(org-file (funcall create-file-fn "org" "org")))
(progn
(funcall modify-file-fn yaml-file denote-yaml-front-matter)
(should (eq (denote-file-type yaml-file) 'markdown-yaml)))
(progn
(funcall modify-file-fn toml-file denote-toml-front-matter)
(should (eq (denote-file-type toml-file) 'markdown-toml)))
(progn
(funcall modify-file-fn org-file denote-org-front-matter)
(should (eq (denote-file-type org-file) 'org)))
(should-not (denote-file-type "test"))
(let ((denote-file-types nil))
(should-not (denote-file-type "test.md")))))
(provide 'denote-test)
;;; denote-test.el ends here
;; Local Variables:
;; read-symbol-shorthands: (("dt" . "denote-test-"))
;; End: