Compare commits

...

2850 commits
0.3.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
Protesilaos Stavrou 7c425a2d09
Update to Denote version 1.2.0
The release notes: <https://protesilaos.com/codelog/2022-12-16-denote-1-2-0/>.
2022-12-16 10:11:56 +02:00
Protesilaos Stavrou 909f9f0e74
Use the tilde were appropriate in the manual 2022-12-16 09:26:08 +02:00
Protesilaos Stavrou 03bebf58fe
Mention citar-denote in the manual
Thanks to Peter Prevos for developing this package and for mentioning
it on the Denote mailing list:
<https://lists.sr.ht/~protesilaos/denote/%3C877cz0e96r.fsf%40prevos.net%3E>.
2022-12-16 09:22:47 +02:00
Protesilaos Stavrou e8ec8b8eb4
Make minor format tweaks to 'denote-modules' 2022-12-16 09:08:17 +02:00
Protesilaos Stavrou 9b91ddf735
Add user option denote-excluded-keywords-regexp
Thanks to Stefan Thesing for proposing this idea in issue 115 on the
GitHub mirror: <https://github.com/protesilaos/denote/issues/115>.

[ Other people participate in that thread and there will be something
  more coming out of it. ]
2022-12-11 05:31:00 +02:00
Protesilaos Stavrou c956a84294
Clarify denote-excluded-directories-regexp doc 2022-12-11 05:26:30 +02:00
Protesilaos Stavrou b7365ee540
Acknowledge Thibaut Benjamin for commit 9c94871
It was done in pull request 116 on the GitHub mirror:
<https://github.com/protesilaos/denote/pull/116>.

The change concerns a single line and thus Thibaut requires no
copyright assignment to the Free Software Foundation.
2022-12-10 16:35:05 +02:00
Protesilaos Stavrou f00f3eafdb
Merge pull request #116 from thibautbenjamin/main
Fix broken link during exportation
2022-12-10 16:30:43 +02:00
Thibaut Benjamin 9c94871114 fix broken link when exporting and linking from outside directory 2022-12-10 13:40:15 +01:00
Protesilaos Stavrou df6b0a5e44
Add Jack Baty's article to list of publications
Relevant discussion on the Denote mailing list:
<https://lists.sr.ht/~protesilaos/denote/%3C874ju7jlce.fsf%40protesilaos.com%3E>.
2022-12-09 03:57:25 +02:00
Protesilaos Stavrou 2e681cf6da
Use 'make-obsolete-variable' for variables
The 'make-obsolete' is for functions: I forgot about that.
2022-12-07 06:54:18 +02:00
Protesilaos Stavrou 8fa2cc5e86
Tweak outline level for modules' section 2022-11-30 09:14:57 +02:00
Protesilaos Stavrou a8f22eaac3
Make some minor spacing adjustments 2022-11-30 08:42:57 +02:00
Noboru Ota dc7486a0df
refactor: denote-modules are now a list of module names
Before this patch, 'denote-modules' needed to be set like this below:

         (setq denote-modules
               '((project-find-functions . denote-project-find)
                 (xref-backend-functions . denote--xref-backend)
                 (denote-module-ffap-enable . denote-module-ffap-disable)))

It's cumbersome for users.  With this patch, the same user option can be set as a list of module names like this:

         (setq denote-modules '(project xref ffap))

Default value of 'denote-modules' is currently nil.
2022-11-30 08:19:45 +02:00
Noboru Ota c2419d93f9
fix: correct ffap functions in 'denote-modules' 2022-11-30 08:19:45 +02:00
Noboru Ota 2f47d31b71
feat: denote-modules & new module for ffap integration
As discussed in Mailing list:

https://lists.sr.ht/~protesilaos/denote/%3C86a64ooxyi.fsf%40nobiot.com%3E

A new module concept is now implemented together with global/minor mode.
Briefly, they work this way:

1. Set 'denote-modules' by selecting the modules you wish to use
2. Activate the minor mode globally or locally
3. This then disables the modules previously enabled, and enable the
   ones newly set -- if it is the first time after Emacs launch, it will
   just enable the modules.

The integration previously available with package and xref are now added
as separate modules.  A new one with ffap (find-file-at-point) is also
now added.

* denote.el

(denote-get-relative-path-by-id):
A new function to return relative filename by identifier.  Currently used
by the ffap module.

(ffap-next-regexp)(ffap-alist):
'defvar' to placate compilers

(denote-module-ffap-last-enabled)
(denote-module-ffap-disable)
(denote-module-ffap-enable):
Module for ffap, find-file-at-point, and a helper-var

(denote-modules-last-enabled)
(denote-modules-disable)
(denote-modules-enable):
Function pair to enable/disable modules and helper-var selected with
'denote-modules'

(denote-modules-mode):
local minor mode to enable/disable 'denote-modules'

(denote-modules-global-mode):
global minor to enable/disable 'denote-modules'

(denote-modules-set):
Setter function for 'denote-modules'

(denote-modules):
The modules selection to be enabled/disabled
2022-11-30 08:19:45 +02:00
Noboru Ota 0c4185b30c
docs: correct typo 2022-11-30 08:19:45 +02:00
Protesilaos Stavrou 643794cb89
Document :reverse parameter for Org dynamic blocks
It was added in commit 2d1d543 by Elias Storms:
<https://lists.sr.ht/~protesilaos/denote/%3Cm2k03ig552.fsf%40MBA21.fritz.box%3E>.
2022-11-27 05:41:58 +02:00
Elias Storms 2d1d543f3d
org-denote-dblock: Add :reverse for denote-links block
Add ':reverse' as a possible argument for the denote-links Dynamic
block. Via this argument the value of denote-link-add-links-sort can
be set for the block.
2022-11-27 05:39:43 +02:00
Protesilaos Stavrou 7df400431e
denote-org-dblock: remove outdated comment 2022-11-25 05:41:08 +02:00
Protesilaos Stavrou b8863cccb8
Remove link target attribute from HTML export
This attribute tells the browser to open the link in a new tab.  I had
this simply because it was present in parts of the Org code base,
though being opinionated in this regard was not intentional.

Thanks to Johan Bolmsjö for bringing this matter to my attention:
<https://lists.sr.ht/~protesilaos/denote/%3C530c49a3-0f2f-4491-afc9-5db5b0cc2b2b%40app.fastmail.com%3E>.
2022-11-25 05:28:03 +02:00
Protesilaos Stavrou 2414839a15
denote-org-dblock: fix imbalanced parentheses
Thanks to Jack Baty for reporting the problem in issue 113 on the
GitHub mirror: <https://github.com/protesilaos/denote/issues/113>.
2022-11-24 16:04:35 +02:00
Noboru Ota ce8e661325
fix: cl-defgeneric -> cl-defmethod
We are implementing a denote-specific implementation of the method.  Do
not override the generic one.
2022-11-22 09:16:35 +02:00
Protesilaos Stavrou 0665a1e367
Merge branch 'xref-refinement-project-integration' 2022-11-22 05:19:20 +02:00
Elias Storms 22829d8541
Remove reference to non-existing function
There is no function denote-link-add-backlinks. Remove references to
it.
2022-11-22 05:13:19 +02:00
Noboru Ota 0a94f3e3c3
feat: xref-backend facility to enable xref integration
Add xref-backend facility for Denote.

To enable this feature, `xref-backend-functions' like this.

    (add-hook 'xref-backend-functions #'denote--xref-backend)

This lets users use the standard Xref commands such as
'xref-find-definitions' ("M-." by default) 'xref-find-references' ("M-?"
by default) on an identifier in the body of text.  To use this, in a
note in a directory, move your point to an identifier like this and
simply invoke one of these commands.  'find-definition' should take you
to the note that identifier points to.  'find-references' by default
should open up a completion in minibuffer with a list of identifiers and
the one at point should already be selected as the default.  Simply
press RET to open a Xref buffer with all references of the identifier.

You can tell xref-references not to prompt by adding the following:

    (add-to-list 'xref-prompt-for-identifier #'xref-find-references
    :append)

Note that you do not need (1) to use any markup to explicitly indicate
the text string at point is a link or (2) to select a range of text.
2022-11-21 05:32:55 +02:00
Noboru Ota 93971de099
fix: denote-get-path-by-id to send only denote notes file
Currently this function returns any file that starts with the identifier
passed into it.  There are cases where contain derivative files that
have the same name sans extetion as the note (e.g. exported HTML file
for the note, etc.).  Now the patch changes the function to check
against these cases and returns only denote notes file.
2022-11-21 05:32:55 +02:00
Noboru Ota 3e074afb4b
feat: follow-symlinks
Currently, the "do-or-create" functions do not show files under a
subdirectory that is symlinked to another directory outside
'denote-directory'.  This patch enable Denote to recognize files in
symlinked directories and thus lets users more flexible directory
arrangements.
2022-11-21 05:32:55 +02:00
Protesilaos Stavrou 69824125b9
Use consistent style for references to publications 2022-11-21 05:30:38 +02:00
Protesilaos Stavrou 5af62d948b
Add link to new publication by Jeremy Friesen
Read the discussion on the mailing list:
<https://lists.sr.ht/~protesilaos/denote/%3C0b2de28e-7d14-4c85-871a-a838ff1a577a%40app.fastmail.com%3E>.
2022-11-21 05:30:02 +02:00
Noboru Ota 6bb6da0882
feat: project.el integration & backlinks refactoring with xref
The main intent of the patch is as follows:

- To simplify the implementations of functions related to backlinks that
  rely on the Xref library

- To add minimal implementations to integrate Denote with project.el

  This is necessary for simplification of Xref/backlinks mentioned
  above.

  It has given an opportunity to refactor 'denote-file-prompt' to let
  you search notes under all sub-directories of 'denote-directory'.  The
  original 'read-file-name' could only search within only single
  'denote-directory'.

  This enhances the following commands: 'denote-open-or-create',
  'denote-link', 'denote-link-or-create', and 'denote-link-ol-complete'.

  The project.el integration also lets users set something like this
  below in their configuration.  This way, they can generically use
  project.el facilities for Denote such as 'project-find-file' and
  'project-find-regexp' without a version management tool (e.g. Git)

      (add-hook 'project-find-functions #'denote-project-find)

Following is more detail of changes for each function:

* denote.el

(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

(denote--retrieve-xrefs): Removed

- No longer used. It was only used by 'denote--retrieve-process-grep',
  which has now been removed.

(denote--retrieve-files-in-xrefs): Refactored

- To take IDENTIFIER as the argument.  No change to the returned
  values. This is for this function to be compatible with the removal of
  'denote--retrieve-xrefs'.  Retrieving files do not need to use the
  intermediate xref-alist, which is a duplicate of work.  This change
  lets this function directly retrieve file name (group) from xrefs (not
  xref-alist) with using Xref public methods

(denote--retrieve-process-grep): Removed

- No longer used. It was only used by 'denote-link--prepare-backlinks'
  to retrieve xref-alist for the purpose of creating the backlinks
  buffer.  Creation of the backlinks buffer has now been refactored to
  get closer to the built-in Xref.  See 'denote-link-find-backlink' and
  'denote-link--prepare-backlinks'

(denote--push-extracted-title-to-history): Removed

- No longer used. See commit message fro 'denote-file-prompt' above

(denote-open-or-create): Refactored

- To not use 'denote--push-extracted-title-to-history', which has been
  removed

(denote-link-find-backlink): Refactored

- To not use 'denote--retrieve-xrefs', which has been removed

(denote-link-or-create): Refactored

- To not use 'denote--push-extracted-title-to-history', which has been
  removed

(denote-backlinks-mode): Refactored

- To locally set 'denote-project-find'. This is be compatible with the
  new project.el integration.  The change is necessary for the backlinks
  buffer to correctly revert by identifying the denote project root

(denote-link--prepare-backlinks): Refactored

- To set the correct revert function with using the new way

(denote-link-backlinks): Refactored

- To use 'xref--show-xrefs' to create and show backlinks buffer.  The
  double-hyphen in the name 'xref--show-xrefs' suggests it is a private
  function; however, in the current development branch of Xref, there is
  a new public function 'xref-show-xrefs'.  It is a wrapper function
  with the same arguments used in this patch, thus we are further
  aligning Denote with the direction of Xref development

(project-root): (project-files): (denote-project-find): Added

- These are Denote specific implementations of generic functions defined
  in project.el and a function for a hook to let Denote use them.  This
  patch contains many built-in Xref functions, which rely on project.el
  to identify the "root" of the project.  Denote explicitly defines its
  root with 'denote-directory'. These newly created methods and function
  connect Denote and project.el generic.  This way, users without a
  version management tool (e.g. Git) for their notes can benefit from
  project.el.  See one of such major benefits with 'denote-file-prompt'
  and the related Denote commands above.

- This change also let users set something like this below in their
  configuration to generically use project.el facilities such as
  'project-find-file'.

   (add-hook 'project-find-functions #'denote-project-find)

* denote-org-dblock.el

(org-dblock-write:denote-backlinks): Refactored

-  To align with the change in 'denote--retrieve-files-in-xrefs' as
  above
2022-11-20 12:01:10 +02:00
Elias Storms e20511b0fe
Update manual on Org Dynamic blocks 2022-11-20 05:31:35 +02:00
Protesilaos Stavrou 9fb0ecba41
Document use of Denote with Org dynamic blocks
Thanks to Elias Storms for authoring the denote-org-dblock.el.  Read
the discussion on the mailing list:
<https://lists.sr.ht/~protesilaos/denote/%3Cm2sfisexx7.fsf%40MBA21.fritz.box%3E>.
2022-11-19 17:54:17 +02:00
Protesilaos Stavrou dbf02bed94
denote-org-dblock: fix typo 2022-11-19 17:52:21 +02:00
Protesilaos Stavrou d46aee3bf6
Placate the compiler for unused argument
Thanks to Elias Storms for testing my suggestion and confirming that
it works:
<https://lists.sr.ht/~protesilaos/denote/%3Cm2sfisexx7.fsf%40MBA21.fritz.box%3E#%3Cm2edu5o01m.fsf@MBA21.fritz.box%3E>.
2022-11-16 18:50:07 +02:00
Protesilaos Stavrou 09f8e3deee
denote-org-dblock: add correct 'provide' form 2022-11-13 06:22:35 +02:00
Protesilaos Stavrou 5c4263aeec
denote-org-dblock: tweak comments to placate the compiler 2022-11-13 06:21:53 +02:00
Elias Storms 282b3a9810
denote-org-dblock: update documentation on use
Rephrased the comments explaining how to use the Org Dynamic blocks
feature.
2022-11-13 06:18:35 +02:00
Elias Storms ab626b36b9
denote-org-dblock: use read-regexp
Replace read-string with read-regexp and use the same history as
'denote-link--add-links-history'.
2022-11-13 06:18:25 +02:00
Elias Storms 6a57086f01
denote-org-dblock: rename write functions
Rename the functions so that they use the 'org-dblock-write:' naming
scheme so that org-dblock-update finds them.

Include a docstring.
2022-11-13 06:18:11 +02:00
Elias Storms 24ab18b705
Transform denote-org.el into denote-org-dblock.el
We narrow the scope of the additional code: it only introduces the Org
Dynamic block functionalities (rather than broader Org-mode
integration).

The file is renamed to denote-org-dblock.el and the commentary
updated. denote-org-extract-subtree is removed.
2022-11-13 06:17:43 +02:00
Protesilaos Stavrou b89b566dff
Tweak docs about splitting an Org subtree 2022-11-11 05:47:03 +02:00
Protesilaos Stavrou 53a343709b
denote-org: add task for review 2022-11-10 21:16:06 +02:00
Protesilaos Stavrou 5540af8ccf
Remote unnecessary (?) autoload cookie
I am not sure from where this function will be called.  Is there a
chance that is is used without a 'require' call to denote-org.el?
2022-11-10 21:15:16 +02:00
Protesilaos Stavrou 0f09c1bc85
denote-org: tweak symbols for consistency 2022-11-10 21:13:52 +02:00
Protesilaos Stavrou a46e581ef4
denote-org: annotate helper for writing dblock links 2022-11-10 21:13:03 +02:00
Protesilaos Stavrou 88f86081e1
denote-org: tweak doc of denote-org-dblock-insert-denote-links
Also updating its name to match the prefix of the file (otherwise the
compiler complains).

Added a TODO as well, though it is not a major issue.
2022-11-10 21:02:50 +02:00
Protesilaos Stavrou f075c49769
denote-org: add autoload cookie to command 2022-11-10 20:57:14 +02:00
Protesilaos Stavrou c18300469f
denote-org: reword Commentary
There are some Org-specific features in denote.el, like the 'denote:'
hyperlink type, which are useful for all Org users.  Whereas what we
have in denote-org.el is meant to be explicitly requested with a
'require' call and, thus, is more specialised in its
scope/functionality.

This does not make it any less important.  It just makes it easier for
us to organise our code.
2022-11-10 20:56:33 +02:00
Protesilaos Stavrou 1f0633e3be
denote-org: add denote-org-extract-subtree error handling 2022-11-10 20:49:18 +02:00
Protesilaos Stavrou f04f43c6f7
denote-org: add missing Code outline heading 2022-11-10 20:48:46 +02:00
Protesilaos Stavrou bc30770e31
denote-org: use same version as denote.el
We do this to avoid conflicts between the two files.  As part of the
current development cycle, denote.el depends on Emacs 28, so this
extension cannot be used with Emacs 27 (at least in principle).
2022-11-10 20:47:08 +02:00
Protesilaos Stavrou 9fbbdcaee5
denote-org: add 'require' calls 2022-11-10 20:44:30 +02:00
Elias Storms d7c52c6845
Add denote-org.el 2022-11-10 20:43:48 +02:00
Protesilaos Stavrou 342330d984
Re-indent a few lines 2022-11-09 18:29:22 +02:00
Elias Storms c9fa42074d
Fix denote-link-add-links and -add-missing-links
Both -add-links functions also include the note from which they are
called. This is fixed when assoc-delete-all is replaced with a simple
delete.
2022-11-09 18:27:49 +02:00
Protesilaos Stavrou 37997e69ef
Fix denote-directory-files filter predicate
The previous one was omitting all files in subdirectories when the
test would return nil (such as with the default value of the new
denote-excluded-directories-regexp).

Thanks to Elias Storms for reporting the regression on the GitHub
mirror: <https://github.com/protesilaos/denote/pull/112#issuecomment-1304568517>.
2022-11-05 18:28:22 +02:00
Protesilaos Stavrou 1a166df581
Generalise denote-excluded-directories-regexp
This builds on the initial idea of Graham Marlow in commit 39a20a7,
further refined in 95cd9f8.

Graham contributed in pull request 112 on the GitHub mirror:
<https://github.com/protesilaos/denote/pull/112>.
2022-11-05 10:06:15 +02:00
Protesilaos Stavrou aced22dbac
Make attempt to simplify keyword sorting
This is being discussed with Florian on the mailing list:
<https://lists.sr.ht/~protesilaos/denote/%3C166689879712.8.6808878344988686135.71824507%40aboulafia.org%3E#%3C87o7tojqdw.fsf@protesilaos.com%3E>.
2022-11-05 08:54:22 +02:00
Protesilaos Stavrou e9517323fb
Update Acknowledgements for commit 39a20a7
Thanks to Graham Marlow for the contribution which was done in pull
request 112 on the GitHub mirror:
<https://github.com/protesilaos/denote/pull/112>.

The contribution, with the tweaks made in 95cd9f8, is within the
eligible line count: it does not require copyright assignment to the
Free Software Foundation.  Though Graham would need to do the
paperwork for any future patch.
2022-11-04 19:48:20 +02:00
Protesilaos Stavrou 95cd9f88bf
Make stylistic tweaks to 39a20a7
This is to make it look consistent consistent with the rest of the
code.
2022-11-04 19:46:17 +02:00
Protesilaos Stavrou f9cfde272e
Merge pull request #112 from mgmarlow/feat/directory-name-exclusions
feat: Add denote-directory-exclusions
2022-11-04 19:31:54 +02:00
Graham Marlow 39a20a7355 feat: Add denote-directory-exclusions
Add a regular expression to exclude certain directories from
denote-file-prompt. Useful for excluding temporary files when
using a cloud-sync service.
2022-11-04 09:26:49 -07:00
Protesilaos Stavrou e89833d453
Make denote-keywords-add always sort keywords
This is a continuation of commits bbd0b79, 877e205.

The regression was caused by a59a711, 392ddc0.
2022-11-02 16:18:59 +02:00
Protesilaos Stavrou bbd0b79162
Sort keywords where relevant
A continuation of commit 877e205 by Florian:
<https://lists.sr.ht/~protesilaos/denote/%3C166689879712.8.6808878344988686135.71824507%40aboulafia.org%3E#%3C166738607395.7.4984032286065984949.73057415@aboulafia.org%3E>.

Florian's contributions are still within the ~15 line limit and thus
do not require copyright assignment to the Free Software Foundation.
2022-11-02 13:19:48 +02:00
Florian 877e205317
Fix: sort keywords when using denote-rename-file 2022-11-02 13:19:33 +02:00
Protesilaos Stavrou 136e9065ce
Use "silo" in heading for easier discovery 2022-11-01 05:43:17 +02:00
Protesilaos Stavrou 8cea6af04c
Expand node for directory silos
Thanks to Viktor Haag for asking a question on the mailing list that
inspired me to produce this entry:
<https://lists.sr.ht/~protesilaos/denote/%3CCANnkwC6NLd0VneUEqFrjh7TCUBLBgEtLCcPwM37JDvJXJCShVQ%40mail.gmail.com%3E>.
2022-11-01 05:42:35 +02:00
Protesilaos Stavrou d26851f1cc
Make minor correction to documentation 2022-10-30 12:06:07 +02:00
Protesilaos Stavrou 89d04288e1
Clarify denote-file-types documentation 2022-10-30 11:04:35 +02:00
Protesilaos Stavrou fbbc403dee
Clarify that some entries are part of development 2022-10-30 08:36:11 +02:00
Protesilaos Stavrou 570d9ac0bd
Make all links contingent on denote-file-types
This consolidates all link formatting and link extraction/recognition
in the variable 'denote-file-types'.  We now have the ability to
control centrally how file types will behave for all linking commands
and their ancillary functions.

With this and other changes from earlier today (see excerpt of Git log
further below), the 'denote-file-types' provides the means to extend
Denote to support ANY FILE TYPE: how it produces its front matter, the
way to retrieve front matter values, the pattern to format keywords,
link format+extraction/ecognition, et cetera.  The doc string of
'denote-file-types' covers all the technicalities.

This is an advanced feature of Denote.  It is only intended for
experienced users.

A relevant request for such a feature can be found in issue 86 on the
GitHub mirror: <https://github.com/protesilaos/denote/issues/86>.

I believe I have tested everything, though we have plenty of time
ahead of us to test things before the release of version 1.2.0 of
Denote (tentative target is the end of November).

* * *

Relevant commits:

*  2afd07d 2022-10-30 07:03:58 +0200 Protesilaos Stavrou: Make public all variables for link in context
*  a553003 2022-10-30 06:50:27 +0200 Protesilaos Stavrou: Make link format variables public
*  9957eaa 2022-10-30 06:39:04 +0200 Protesilaos Stavrou: Clarify denote-link--format-markdown doc string
*  4c7bfe2 2022-10-30 06:34:53 +0200 Protesilaos Stavrou: Make date format functions public
*  dec6367 2022-10-30 06:20:38 +0200 Protesilaos Stavrou: Make denote-file-types read a :date-function
*  a93d9f2 2022-10-30 06:22:30 +0200 Protesilaos Stavrou: Clarify denote-file-type doc string
*  14f6919 2022-10-30 05:46:23 +0200 Protesilaos Stavrou: Refine denote-file-types documentation
*  a214901 2022-10-30 05:44:23 +0200 Protesilaos Stavrou: Refine how denote-file-type-prompt gets candidates
2022-10-30 08:12:20 +02:00
Protesilaos Stavrou 516f6dfd5d
Tweak markup of property in the manual 2022-10-30 07:11:20 +02:00
Protesilaos Stavrou 2afd07d3dc
Make public all variables for link in context
Also see a553003.
2022-10-30 07:03:58 +02:00
Protesilaos Stavrou a553003322
Make link format variables public 2022-10-30 06:50:27 +02:00
Protesilaos Stavrou 9957eaa4a4
Clarify denote-link--format-markdown doc string 2022-10-30 06:39:04 +02:00
Protesilaos Stavrou 4c7bfe26bc
Make date format functions public
Also see commit dec6367.

Relevant thread on the GitHub mirror issue 86:
<https://github.com/protesilaos/denote/issues/86>.
2022-10-30 06:34:53 +02:00
Protesilaos Stavrou dec6367e64
Make denote-file-types read a :date-function
The end goal is to make this variable the single point of entry to all
file-type-aware operations.  This way, expert users can add support
for any file type they want.  Depending on how it goes, we may even
make it a user option.

Relevant thread on the GitHub mirror issue 86:
<https://github.com/protesilaos/denote/issues/86>.
2022-10-30 06:22:48 +02:00
Protesilaos Stavrou a93d9f2c60
Clarify denote-file-type doc string 2022-10-30 06:22:48 +02:00
Protesilaos Stavrou c07185b002
Use correct symbol in two private doc strings 2022-10-30 05:54:56 +02:00
Protesilaos Stavrou 14f691939a
Refine denote-file-types documentation 2022-10-30 05:46:23 +02:00
Protesilaos Stavrou a214901fd4
Refine how denote-file-type-prompt gets candidates 2022-10-30 05:44:23 +02:00
Protesilaos Stavrou 804ba6d600
Clarify denote-directory-files documentation 2022-10-30 05:38:59 +02:00
Protesilaos Stavrou e8d20a99ba
Document section "publications about Denote"
I am inspired to include this by Jeremy Friesen's post on the mailing
list about his Denote configuration:
<https://lists.sr.ht/~protesilaos/denote/%3Cf2e75ca4-4846-46c4-b78f-69c6ff436d5f%40app.fastmail.com%3E>.

Thanks to Jeremy for his feedback on this topic!
2022-10-29 18:43:26 +03:00
Protesilaos Stavrou b1581170c6
Make minor tweaks to placate the compiler
This is a follow-up to commits 6605e08, 55c092d by Noboru Ota.  Those
were shared on the mailing list as patches:
<https://lists.sr.ht/~protesilaos/denote/%3C86r0yvzm12.fsf%40nobiot.com%3E#%3C86ilk47yyz.fsf@nobiot.com%3E>.

They are part of the ongoing work to refactor the backlink-related
code to (i) refine its implementation, (ii) support the optional
display of context.
2022-10-28 19:09:09 +03:00
Noboru Ota 55c092d728
Refactor backlink xref functions
The main intent of this change is to remove 'denote-xref--insert-xrefs',
which was meant to be a slight modification to the built-in function
'xref--insert-xrefs'.  This way, it is intended that future maintenance
work for Denote will be lighter and more in line with the changes to the
built-in Xref library.

Additionally, refactoring is done for 'denote--retrieve-xrefs'. The
intent was to fulfill requirements (A) (B) and (1) (2) described below
in a way that avoids duplication of work -- an attempt to follow the DRY
(Don't Repeat Yourself) principle.

The function name 'denote--retrieve-xrefs' indicates that it should be
generic that should return all the xrefs as retrieved by the Xref
function (A); however, the current usage is only to retrieve backlinks
for a specific file, by excluding a relevant element from the xref-alist
(B). This is used by two different commands: (1) 'denote-link-backlinks'
and (2) 'denote-link-find-backlink'; they have different requirements
for the output format: (1) requires relative file names and (2) requires
an absolute file names.

There can be possibly further refactoring.  That is now left to future iteration.

More detail of change to each altered function follows.

* denote.el

(denote--retrieve-xrefs): Add an optional argument FILE. It is meant to
cater to the different requirements of (A) and (B) above.

(denote--retrieve-process-grep): This function is now used only by
'denote-link-backlinks' and refactored to transform GROUP from absolute
file name to relative one for `denote-directory`. This is requirement
(1) above for display purposes of the backlinks' buffer As the doc
string of 'xref--insert-xrefs' notes that GROUP in xref-alist is for
"decoration purposes" and it is also processed in the same way in
'xref--analyze', this should not be a problem.

(denote-link-find-backlink): Refactor to avoid function
'(denote--retrieve-process-grep)' to retrieve xref-alist for requirement
(2) above.

(denote-link--prepare-backlinks): Refactor to use 'xref--insert-xrefs'
directly. As GROUP in xref-alist (GROUP is its key) now carries relative
file name for display purposes, the original logic to insert a list of
file names is also refactored to remove the duplicate work of function
'denote-get-file-name-relative-to-denote-directory'.  It is now done
centrally in 'denote--retrieve-process-grep' for the purpose of
backlinks' buffer (with or without the context).

(denote-xref--insert-xrefs): Remove this function completely.
2022-10-28 19:01:57 +03:00
Noboru Ota 6605e08c17
Add "no backlink" user-error 'denote-link-find-backlink'
'denote-link-find-backlink' emits a user-error when no backlink is found
for the note.  The same should be done for 'denote-link-find-backlink'.
2022-10-28 18:58:54 +03:00
Protesilaos Stavrou 392ddc085f
Fix denote-keywords-sort symbol in denote command
Thanks to Florian for pointing it out on the mailing list:
<https://lists.sr.ht/~protesilaos/denote/%3C166689879712.8.6808878344988686135.71824507%40aboulafia.org%3E#%3C166693939100.7.2697299917666868782.71911200@aboulafia.org%3E>.
2022-10-28 09:46:27 +03:00
Protesilaos Stavrou a59a711f17
Add denote-keywords-sort function
The intent is to abstract the task of sorting the keywords.  Before,
it was handled by the 'denote-keywords-prompt', which meant that
keywords were not sorted when the 'denote' function was called from
Lisp.

Thanks to Florian for bringing this matter to my attention:
<https://lists.sr.ht/~protesilaos/denote/%3C166689879712.8.6808878344988686135.71824507%40aboulafia.org%3E>.
2022-10-28 05:26:59 +03:00
Protesilaos Stavrou 68d8ea7d03
Remove superfluous 'funcall'
Thanks to Noboru Ota for pointing it out:
<https://lists.sr.ht/~protesilaos/denote/%3C86r0yvzm12.fsf%40nobiot.com%3E#%3C86h6zpmhpd.fsf@nobiot.com%3E>.
2022-10-27 18:16:28 +03:00
Noboru Ota 20e5870af9
Update xrefs-alist -> xref-alist
No functional change. 'xref-alist' is the convention that Xref follows.
2022-10-27 18:08:35 +03:00
Protesilaos Stavrou ee69daee74
Update sample configuration, per b313dfc 2022-10-27 06:28:19 +03:00
Protesilaos Stavrou 7c22231457
Update minimum required Emacs version to 28.1
Emacs 27 lacks certain Xref facilities that we need for the
backlinking facility.  It also adds to the maintenance burden.

With the help of Noboru Ota, we realised that Denote was broken on
Emacs 27 for quite a while.[1] The fact that we received no feedback
about it suggests that this change is the best course of action going
forward.

[1] <https://lists.sr.ht/~protesilaos/denote/%3C86r0yvzm12.fsf%40nobiot.com%3E#%3C86sfja78ik.fsf@nobiot.com%3E>
2022-10-27 06:26:39 +03:00
Protesilaos Stavrou b313dfccaa
Update backlinks' buffer documentation in the manual
This consolidates all the recent changes.

Read the discussion on the mailing list about the refactoring of the
backlinks' buffer, with the participation of Noboru Ota:
<https://lists.sr.ht/~protesilaos/denote/%3C86r0yvzm12.fsf%40nobiot.com%3E>.

Also check the recent commit log for the relevant changes, including
patches from Noboru.
2022-10-27 06:23:12 +03:00
Protesilaos Stavrou 9b6cf70026
Add wrapper motions for backlinks' buffer
With the denote-backlinks-show-context, we now have two types of
backlinks' buffer: (1) a generic one that uses buttons that we create
and (2) the familiar Xref buffer.  These commands are meant to
accommodate both types.

Read the discussion on the mailing list about the refactoring of the
backlinks' buffer, with the participation of Noboru Ota:
<https://lists.sr.ht/~protesilaos/denote/%3C86r0yvzm12.fsf%40nobiot.com%3E>.

Also check the recent commit log for the relevant changes, including
patches from Noboru.
2022-10-27 06:16:01 +03:00
Protesilaos Stavrou f90f79f788
Make denote-link-fontify-backlinks obsolete
It will confuse users now that we have another option for displaying
the context of links.  It is better to just handle this internally.

Furthermore, our fontification does not look nice when the context is
shown.  In that case, the standard Xref style looks better because
it (i) clearly distinguishes file names from the context, (2) line
numbers from the context, and (3) highlights the matching identifier
on the given line.

Read the discussion on the mailing list about the refactoring of the
backlinks' buffer, with the participation of Noboru Ota:
<https://lists.sr.ht/~protesilaos/denote/%3C86r0yvzm12.fsf%40nobiot.com%3E>.

Also check the recent commit log for the relevant changes, including
patches from Noboru.
2022-10-27 05:13:42 +03:00
Protesilaos Stavrou 3da08eac52
Reword denote-backlilnks-show-context docstring 2022-10-27 05:13:12 +03:00
Protesilaos Stavrou d304d79593
Reword denote--retrieve-files-in-xrefs doc string 2022-10-27 05:11:27 +03:00
Noboru Ota bdc94d3369
Add user option to use original backlinks buffer or with context
* denote.el

(denote-backlilnks-show-context): Add an user option to toggle the
context.

(denote-link--prepare-backlinks): Add the original insertion logic back
in with refactoring for the xrefs-alist instead of a list of files.
2022-10-27 04:58:32 +03:00
Noboru Ota bbdcc498a2
Fix 'denote-link-find-backlink'
Commit fcefc1d broke 'denote-link-find-backlink' as
'denote--retrieve-process-grep' was refactored to retrieve xrefs-alist.
This change fixes that.

* denote.el

(denote--retrieve-files-in-xrefs): Revert commit 3b9bc00
(denote-link-find-backlink): Refactor to work as expected as before
fcefc1d
2022-10-27 04:47:16 +03:00
Protesilaos Stavrou 3b9bc00659
Remove unused denote--retrieve-files-in-xrefs
It was rendered irrelevant by commit fcefc1d which refactored how the
backlinks' buffer is created.
2022-10-26 11:02:32 +03:00
Protesilaos Stavrou 7036efa53d
Remove empty space 2022-10-26 10:11:44 +03:00
Protesilaos Stavrou db14ff0724
Tweak how denote-backlinks-mode is fontified
We do it at the definition of the major mode, not in the helper
function that prepares the buffer.
2022-10-26 10:10:16 +03:00
Protesilaos Stavrou 857b6a2419
Update documentation about the backlinks' buffer
Covers the changes implemented by Noboru Ota (nobiot) in commit
fcefc1d.  That change is discussed on the mailing list:
<https://lists.sr.ht/~protesilaos/denote/%3C86r0yvzm12.fsf%40nobiot.com%3E>.
2022-10-26 06:47:42 +03:00
Protesilaos Stavrou 76c91f8b13
Reword doc string of denote-link-backlinks 2022-10-26 06:33:25 +03:00
Noboru Ota (nobiot) fcefc1db9e
Display context of identifier in backlinks buffer with xref
The intention of the changes below is to display context of identifier
in the files in the backlinks buffer.  Currently Denote's backlinks
buffer display a list of filenames.  Denote currently retrieves
xref-items (xrefs-alist) and then strips off the context information and
utilizes only the file name (group) for backlinks buffer.  We can utilize
the xref-items as retrieved and make use of the xref's built-in facility
to display the context each identifier is in.  This also lets the
backlinks buffer display multiple occurrences of the same identifier in a
single file (as treated by Xref).

* denote.el

(denote--retrieve-files-in-xrefs): Currently unused;
commented out.  If sorting of the xref-groups (filenames) is critical,
we will need to first look into xrefs-alist and check if it is not
already done as desired by Xref.  If not, will need to consider a
different way to sort xrefs-alist.

(denote--retrieve-process-grep): Changed to return xrefs-alist as
retrieved by 'denote--retrieve-xrefs'.  The file name of the current
buffer where 'denote-link-backlinks' is called from is deleted so that
only backlinks appear.

(denote-backlinks-mode-map): Buttons no longer used.  Navigation is done
in the same way as Xref.  Key "g" is redefined to call 'revert-buffer'
instead of 'xref-revert-buffer'.

(denote-backlinks-mode): The major mode is now derived from
'xref--xref-buffer-mode', which itself is derived from 'special-mode'.

(denote-link--prepare-backlinks): Instead of importing files, this function now works off xrefs-alist.  The alist
includes the filename and other information, including "summary" -- the line the identifier is included.  Summary may
be available only Emacs 28.1 and onward (refer to function 'xref-item-summary').  As Denote currently supports 27.2,
this may require some way to work around it. 27.2 has not been tested.

(denote-xref--insert-xrefs): This function is a slightly modified
version of the built-in function 'xref--insert-xrefs'.  The only change
is the use of function
'denote-get-file-name-relative-to-denote-directory' for the file name
(group in xref).

(denote-link-backlinks): Replace "files" with "xrefs-alist" to make
explicit the data type that is meant to be used in line with all the
other changes above.  In addition, 'xref--push-markers' is called so that
'xref-quit-and-pop-marker-stack' (bound to "M-," by default) will work.
This can display the note's buffer where 'denote-link-backlinks' was
called from.
2022-10-26 05:47:15 +03:00
Protesilaos Stavrou bc035823bf
Fix typo error in one statement 2022-10-25 11:44:09 +03:00
Protesilaos Stavrou a42019aba8
Make denote-open-or-create benefit from 17dc71f 2022-10-24 08:41:32 +03:00
Protesilaos Stavrou 17dc71f7b5
Allow denote-link-or-create to leverage last input
I am implementing this functionality in response to a request made by
Guo Yong: <https://lists.sr.ht/~protesilaos/denote/%3CNF6pFBq--3-9%40tutanota.com%3E>.

The idea is to enhance the "link or create+link" functionality so that
when the user searches for a file that does not exit, they can re-use
the search terms they used initially.

As I explained on the mailing list:

    A non-intrusive way of addressing this issue is to leverage the
    minibuffer histories.  This allows us to type 'M-p' (the command is
    'previous-history-element') at Denote's title prompt and get the last
    input.  The diff further below makes this possible, but I am also
    copying the code for your convenience.

    Some notes before you check the code:

    1. We should not hardcode prompts, such as for file and keywords because
       that will contradict the user option 'denote-prompts'.  Concretely, a
       user may want to create+link to a note that has a specific date, is
       in a given subdirectory, and starts with a certain template.

    2. The input we provide at the standard file prompt should not be taken
       literally.  The reason is that it is common for a user to rely on the
       completion style to narrow the list of candidates.  They are not
       necessarily typing the exact title they would like.  For example, I
       use the 'orderless' package (among built-in options) and will often
       type searches out-of-order like "_journal test this" which would
       match a file that is "20221024T062254--this-is-a-test__journal.txt".

       By adding the last search to the minibuffer history, we let the user
       edit the title before they submit it.

Thanks to Guo Yong for testing my prototype and confirming it does
what we need.
2022-10-24 08:38:17 +03:00
Protesilaos Stavrou dd08ea3496
Add missing backronyms to the README.md
Not important, I know...  But it is fun.
2022-10-20 13:42:22 +03:00
Protesilaos Stavrou d9a1b0c0b8
Update to version 1.1.0 2022-10-20 13:40:01 +03:00
Protesilaos Stavrou 7b39592605
Add missing backronyms to the manual 2022-10-20 13:38:42 +03:00
Protesilaos Stavrou 21e194a5bd
Refine file renaming under version control
This expands the conditionality introduced by Florian in commit
234520b.  Read the mailing list for the relevant discussion:
<https://lists.sr.ht/~protesilaos/denote/%3C166547153518.8.941129310186454444.68125516@aboulafia.org%3E>.
2022-10-18 15:55:07 +03:00
Protesilaos Stavrou 7f0370baed
Acknowledge Florian for commit 234520b
It is below the ~15 line limit and thus does not require copyright
assignment to the Free Software Foundation.

The patch was discussed on the mailing list:
<https://lists.sr.ht/~protesilaos/denote/%3C166547153518.8.941129310186454444.68125516@aboulafia.org%3E>.
2022-10-18 15:47:24 +03:00
Florian 234520b9d7
Fix file renaming when using version control
If dired-vc-rename-file is set to t, renaming a file under version
control with Denote in a Dired buffer will rename the file using
version control (e.g. "git mv")
2022-10-18 15:45:11 +03:00
Protesilaos Stavrou 335a62cf91
Use 'user-error' for keyword add/remove commands
This is a scenario where 'user-error' is more appropriate, as invoking
the command in the wrong context is an "error".
2022-10-16 00:01:09 +03:00
Protesilaos Stavrou ced969aecf
Make denote-keywords-remove use completing-read-multiple
This makes the interface consistent with denote-keywords-add and, by
extension, with every command that leverages the denote-keywords-prompt.
2022-10-15 15:36:37 +03:00
Protesilaos Stavrou ed1402ad30
BREAKING: Use plural in new command symbols
See commits 6c26b18, 91c25fb.
2022-10-15 15:08:46 +03:00
Protesilaos Stavrou a8c450ff91
Fix denote-keyword-add when adding to existing keywords
Previously, it would throw an error if the keywords were a list.

Thanks to Elias Storms for reporting the issue:
<https://lists.sr.ht/~protesilaos/denote/%3Cm24jwvpbt2.fsf@MBA21.fritz.box%3E#%3Cm2a65ycnp7.fsf@MBA21.fritz.box%3E>.
2022-10-15 05:14:07 +03:00
Protesilaos Stavrou 6c26b18e7a
Document commands to add/remove keywords
See commit 91c25fb by Elias Storms.  Elias has assigned copyright to
the Free Software Foundation.

Also read the relevant thread on the mailing list:
<https://lists.sr.ht/~protesilaos/denote/%3Cm24jwvpbt2.fsf%40MBA21.fritz.box%3E#%3Cm28rlik0tc.fsf@MBA21.fritz.box%3E>.
2022-10-14 19:09:33 +03:00
Elias Storms 91c25fbeed
Add commands to add/remove keywords and rename file 2022-10-14 19:08:50 +03:00
Protesilaos Stavrou d125e839a2
Re-indent file 2022-10-14 18:39:15 +03:00
Protesilaos Stavrou 6a0646c5d5
Avoid blank title in denote--retrieve-title-or-filename
See commits 522896f, 63a2b21.
2022-10-12 08:55:38 +03:00
Protesilaos Stavrou 522896fe8c
Make renaming remove title if empty
This is the same idea as with commit 63a2b21.  NEEDS THOROUGH TESTING.
2022-10-12 08:47:14 +03:00
Protesilaos Stavrou 63a2b21453
Make renaming remove keywords if empty
The idea is an empty "keywords" entry in the front matter should mean
that the "__KEYWORDS" component of the title should not be present.
We already allow this, such as if the 'denote-prompts' is configured
to not have a 'keywords' prompt (check its doc string).

THIS NEEDS MORE TESTING TO BE SURE THERE ARE NO REGRESSIONS.
2022-10-12 06:38:56 +03:00
Protesilaos Stavrou df40fc5484
Reword denote-rename-file-using-front-matter docstring 2022-10-12 06:15:08 +03:00
Protesilaos Stavrou 74231ccbe9
Revert "Exclude Info indices from the HTML version of the ToC"
This reverts commit cfd2d42954.

I thought it only affected the HTML output, but it also applies to the
Info manual.  Given that the indices are for the latter, this change
has to be reverted.  Maybe there is way to limit this effect to the
HTML output only.
2022-10-12 05:18:36 +03:00
Eshel Yaron cfd2d42954
Exclude Info indices from the HTML version of the ToC
Currently the HTML version of the manual at
https://protesilaos.com/emacs/denote lists in its table of contents
links to the Indices header and its subheaders, but these are not
present in the HTML version of the manual.

Set the UNNUMBERED property of the Indices header to "notoc" to
exclude the entire subtree from the ToC during export to HTML.
2022-10-11 18:55:23 +03:00
Protesilaos Stavrou 02dd24967a
Clarify that new function is part of dev version 2022-10-10 16:58:42 +03:00
Protesilaos Stavrou f535e918c4
Limit xrefs to notes files only
We do not want to grep the contents of, say, video files as this (i)
will not return the expected result, while (ii) will considerably slow
down the collection of backlinks.
2022-10-10 16:57:37 +03:00
Protesilaos Stavrou 19efdf3151
Add function denote-directory-text-only-files
This filters the return value of 'denote-directory-files' to only
include what we consider "notes".  So it leaves out, say, mp3 files.
2022-10-10 16:55:12 +03:00
Protesilaos Stavrou 4698913f33
Clarify denote-link region behaviour in the manual
Thanks to Charanjit Singh for the contribution, which was done in pull
request 110 on GitHub following our discussion:
<https://github.com/protesilaos/denote/pull/110>.

This, together with Charanjit's other contribution in commits b350035,
fe66333 is within the limits of what is allowed without assigning
copyright to the Free Software Foundation.  Though the author will
need to do the paperwork for any future contributions.
2022-10-10 05:12:49 +03:00
Protesilaos Stavrou 77b4bca5b8
Make minor stylistic tweaks 2022-10-10 05:09:26 +03:00
Protesilaos Stavrou bc8dbbe9d8
Placate the compiler for double space after dot 2022-10-10 04:54:40 +03:00
Protesilaos Stavrou 16335454e1
Merge pull request #110 from bitspook/links-with-region-as-title
Org-mode-like insert-link behavior with empty active region
2022-10-10 04:51:59 +03:00
Charanjit Singh b0554c9589
fix: org-mode-like insert-link behavior with empty active region
If user has whitespace-only region active when inserting a denote-link, behave
org-mode does when inserting a link in this case. i.e selected region is
deleted, and an id-only link is inserted. Active region is trimmed regardless,
so if user try to link "hello " part of "hello world", the text is changed to
"helloworld" with "hello" being the link description and "world" plain text.
2022-10-09 21:12:02 +05:30
Protesilaos Stavrou 369f3cc7af
Add TODO for denote-link region 2022-10-09 03:37:20 +03:00
Protesilaos Stavrou e4450998f3
Document the ability to link to region text
This builds on the commits b350035, fe66333 by Charanjit Singh:
<https://github.com/protesilaos/denote/pull/109>.

Also see 4a10683, 44c2a6a.
2022-10-09 03:34:50 +03:00
Protesilaos Stavrou 44c2a6add8
Clarify denote-link doc string on description text 2022-10-09 03:33:10 +03:00
Protesilaos Stavrou 4a10683036
Make stylistic tweaks to denote-link
This builds on the commits b350035, fe66333 by Charanjit Singh:
<https://github.com/protesilaos/denote/pull/109>.
2022-10-09 03:27:43 +03:00
Protesilaos Stavrou d0aab79ed2
Acknowledge Charanjit Singh
This is for commits b350035, fe66333 which were done as part of pull
request 109 on the GitHub mirror: <https://github.com/protesilaos/denote/pull/109>.

The change is within the ~15 line limit and thus requires no copyright
assignment to the Free Software Foundation.
2022-10-09 03:12:42 +03:00
Protesilaos Stavrou 2bb344e344
Merge pull request #109 from bitspook/links-with-region-as-title
Use region as link title when inserting a link
2022-10-09 03:08:16 +03:00
Charanjit Singh b350035103
refactor: handle region-activation entirely in denote-link
Clearer responsibilities for denote-link--format-link and denote-link.
`denote-link--format-link` has been expanded to accept an optional DESCRIPTION
argument.
2022-10-09 01:09:14 +05:30
Charanjit Singh fe66333d84
feat: use region as link title on denote-link
It is a common use-case to create a link in existing notes. In such cases, some
text is already there, and user just want to create a link on that text (instead
of inserting the link's title). With this change, if a region is active when
user tries to insert a link, the region is replaced with the link while using
the region's content as link's title.
2022-10-08 18:27:58 +05:30
Protesilaos Stavrou 31e6bcb2eb
Add optional DATE to denote-rename-file
Thanks to Florian for suggesting the idea on the mailing list:
<https://lists.sr.ht/~protesilaos/denote/%3C166521684647.7.5483179875879361874.67576870%40aboulafia.org%3E>.

For the technicalities that enabled this change, see commits 2ac68a1,
582f38c.
2022-10-08 15:22:46 +03:00
Protesilaos Stavrou 582f38c642
Add optional DATE in function that returns identifier 2022-10-08 15:14:31 +03:00
Protesilaos Stavrou 6df993ee6c
Make minor correction to a doc string 2022-10-08 14:54:08 +03:00
Protesilaos Stavrou 2ac68a135b
Implement denote-prompt-for-date-return-id
This is a function that might prove useful elsewhere in denote.el or
for users that want to extend Denote.
2022-10-08 14:53:24 +03:00
Protesilaos Stavrou a8c286577c
Make denote-file-has-identifier-p not error out
This is because it might get a nil value from buffer-file-name and we
do not want an error in such a case.
2022-10-07 20:45:59 +03:00
Protesilaos Stavrou 233bb14a2a
Document optional arg denote-rename-file-using-front-matter
It was implemented in commit 6e0482e with a minor tweak in 565e4c8.
2022-10-07 17:57:57 +03:00
Protesilaos Stavrou 565e4c8ef2
Add missing current-prefix arg from 6e0482e 2022-10-07 17:53:39 +03:00
Protesilaos Stavrou f5d5a25c8f
Placate the compiler for double spacing 2022-10-07 17:49:50 +03:00
EFLS 6e0482e8ac
Add optional argument to denote-rename-file-using-front-matter
To rename a file, denote-rename-file-using-front-matter asks for
confirmation via a y-or-n-p. With the optional argument AUTO-CONFIRM,
it's possible to skip these confirmation requests.
2022-10-07 17:48:17 +03:00
Protesilaos Stavrou a3f0ecce65
Add autoload cookies for org link functions
This is just to be sure that they are available if Org encounters a
'denote:' link (e.g. in its agenda files) before the 'require' call to
denote.el.

It may be what causes the problem reported by Sven Seebeck regarding
an error with 'denote-link-ol-store':

* <https://lists.sr.ht/~protesilaos/denote/%3C87r0zovwix.fsf%40svenseebeck.me%3E>
* <https://lists.sr.ht/~protesilaos/denote/%3C87fsg4kjuy.fsf%40protesilaos.com%3E>
2022-10-06 19:05:56 +03:00
Protesilaos Stavrou 0fb7c53024
Delete and deprecate all "migrate" code
We had this for version 0.5.0 which introduced a breaking change to
how keywords are recorded in the front matter.  It is unlikely that
someone now uses a version from before that switch happened.
2022-10-06 15:14:19 +03:00
Protesilaos Stavrou 37adf6593f
Document how to speed up backlink buffer creation 2022-10-06 04:53:56 +03:00
Protesilaos Stavrou b8a5a14240
Add revert-buffer-function to backlinks' buffer
This is basically to allow 'g' to recreate the buffer and thus include
any new links to the referenced file.
2022-10-06 04:34:41 +03:00
Protesilaos Stavrou 2bcc8dff6f
Clarify that c6c3fc9 is part of dev version 2022-10-05 18:45:25 +03:00
Protesilaos Stavrou c6c3fc95c6
Add optional INITIAL-TEXT to denote-file-prompt
Thanks to Alan Schmitt for suggesting the idea:
<https://lists.sr.ht/~protesilaos/denote/%3C87pmf676n1.fsf@m4x.org%3E>.
2022-10-05 17:51:15 +03:00
Protesilaos Stavrou 3775a61028
Allow nil :front-matter in denote-file-types
The 'denote-file-types' is, for the time being, specified as a
'defvar' for advanced users.  We do eventually want to turn it into a
defcustom, assuming there is a need for it (we will figure it out
through further testing).

This change allows the ':front-matter' property to accept a nil value,
which we internally read as an empty string.

Thanks to Noboru Ota (nobiot) for pointing this out on the mailing list:
<https://lists.sr.ht/~protesilaos/denote/%3C86k05gsqsg.fsf%40nobiot.com%3E>.
2022-10-04 17:26:41 +03:00
Protesilaos Stavrou c19163fd6a
My mistake: it's "Noboru Ota". Sorry! 2022-10-04 14:09:29 +03:00
Protesilaos Stavrou 028d4bf3a2
Acknowledge Noburu Ota (nobiot) for commit 9afdf86
The author has already assigned copyright to the Free Software
Foundation.
2022-10-04 14:05:17 +03:00
Noburu Ota (nobiot) 9afdf86cf1
Change how 'denote-file-types' :front-matter is defined
This will allow changing front-matter variables by 'setq' after
'denote' is loaded/compiled without needing to set 'define-file-types'
again.

Currently, changing variables 'denote-*-front-matter' to personalize
the front matter with using 'setq' requires the user to set variable
'denote-file-types' again to reflect the change.

This is because 'denote-file-types' is defined with macro expansion
with using the backquote ("`") and "," to evaluate variables
'denote-*-front-matter' inside the macro.  This results in the front
matters fixed by the values of front-matter variables at the time of
loading or compiling 'denote', and setting the front-matter variables
thereafter with 'setq' will not affect the front matter in notes
created -- this will require setting 'denote-file-types' again.

For the relevant discussion, read:
<https://lists.sr.ht/~protesilaos/denote/%3C86k05gsqsg.fsf%40nobiot.com%3E>.
2022-10-04 14:01:34 +03:00
Protesilaos Stavrou 9bd7a73037
Fix typo in the manual
Thanks to Federico Stilman for bringing this matter to my attention.
It was done via a private channel and the information is shared with
permission.
2022-10-03 14:36:31 +03:00
Protesilaos Stavrou 8c7d48858c
Tweak key bindings in sample configuration 2022-10-03 06:20:09 +03:00
Protesilaos Stavrou c33872507f
Add cross links for the backlink commands 2022-10-03 06:18:37 +03:00
EFLS 56c3953166
Add denote-link-find-backlink command
Variation on denote-link-find-file, but for visiting backlinks to the current
note via the minibuffer.
2022-10-03 06:13:42 +03:00
Protesilaos Stavrou 45a5897d98
Add missing colon sign in prompt 2022-10-03 06:13:21 +03:00
Protesilaos Stavrou 226fa78f4e
Change a couple 'user-error' symbols to 'message'
Those are not real errors.  Just no results from an otherwise valid
search.

This is done in consultation with Elias Storms,[1] who contributed the
'denote-link-add-missing-links' command (see commits faa7a66, 6bf916b).

[1] <2c7184352f>
2022-10-01 22:02:04 +03:00
Protesilaos Stavrou 2c7184352f
Tweak denote-link-add-links code 2022-10-01 19:23:55 +03:00
Protesilaos Stavrou 2c2eb5d9e7
Tweak wording for docs on adding missing links
This was contributed by Elias Storms in pull request 108 on the GitHub
mirror: <https://github.com/protesilaos/denote/pull/108>.
2022-09-30 16:48:03 +03:00
Protesilaos Stavrou 27e5ed7e0c
Remove full stop to placate the compiler 2022-09-30 16:42:47 +03:00
Protesilaos Stavrou 4a3d3e5c5e
Don't check for Org when buttonizing
This is already done by denote-link-buttonize-buffer
2022-09-30 16:42:26 +03:00
Protesilaos Stavrou 5eee3489c9
Remove extra let from denote-link-add-missing-links 2022-09-30 16:40:21 +03:00
Protesilaos Stavrou faa7a66771
Acknowledge Elias Storms for commit 6bf916b
Elias is in the process of finalising the copyright assignment to the
Free Software Foundation.

Elias' contribution was done in pull request 108 on the GitHub mirror:
<https://github.com/protesilaos/denote/pull/108>.
2022-09-30 16:36:40 +03:00
Protesilaos Stavrou 89d324b28f
Merge pull request #108 from EFLS/missing-links
Add denote-link-add-missing-links
2022-09-30 16:31:56 +03:00
EFLS 6bf916b03e Add denote-link-add-missing-links
Similar to `denote-link-add-missing-links', but only insert links
that are not yet included in the current buffer.
2022-09-30 14:59:33 +02:00
Protesilaos Stavrou 9b969da55c
Update to version 1.0.0 2022-09-30 09:27:18 +03:00
Protesilaos Stavrou e2c8d87478
Rewrite doc string of denote-link-buttonize-buffer 2022-09-30 08:17:53 +03:00
Protesilaos Stavrou 776e35d801
Make file name variables public 2022-09-30 06:28:44 +03:00
Protesilaos Stavrou 612a817038
Improve format of reference for developers 2022-09-30 06:12:14 +03:00
Protesilaos Stavrou 5ad5077d95
Add link to virtual dired section 2022-09-29 20:23:33 +03:00
Protesilaos Stavrou 024231a46e
Add documentation about dired-virtual-mode
Thanks to Yi Liu for asking the question that inspired this entry:
<https://lists.sr.ht/~protesilaos/denote/%3C1C75FF01-EC76-49DF-9AEB-ED718A2795FF@gmail.com%3E>.
2022-09-29 20:20:22 +03:00
Marc Fargas 468a4840e4
Fix regression in denote-ol-store-link
Introduced by 3f47374.

`org-link-store` functions should return `nil` when not
handling the current buffer but the current code always
returns `org-store-link-plist`.

We simply move a parenthesis so that when the `when-let*` aborts
we return `nil`, which was the previous behaviour.
2022-09-28 12:10:26 +03:00
Protesilaos Stavrou c2440dcd94
Write argument in denote-open-or-create doc string 2022-09-26 15:25:43 +03:00
Protesilaos Stavrou f0dedb320b
Fix missing parens in denote-link-ol-store
This was a regression caused by commit a74adca.  Thanks to Elias
Storms for reporting a potentially related bug on the mailing list:
<https://lists.sr.ht/~protesilaos/denote/%3C15D55F4B-64D1-4083-AD5E-B5BACA8F1909%40ap.be%3E>.
2022-09-26 15:22:38 +03:00
Protesilaos Stavrou 5889d60efb
Make denote-extract-id-from-string public
Thanks to Elias Storms for discussing the utility of such a function:
<https://lists.sr.ht/~protesilaos/denote/%3CDD9ABAAD-6E45-49AD-A77A-694D87B59754@gmail.com%3E>.
2022-09-26 11:54:18 +03:00
Protesilaos Stavrou 6374751ee2
REMOVE 'denote-faces-broken-link'
It leads to performance issues in Org under certain circumstances.
Fundamentally, this has to do with the fontification mechanism, which
would call the 'denote-link-ol-face' function too often.

Thanks to Peter Prevos for reporting the issue and discussing it with
me: <https://lists.sr.ht/~protesilaos/denote/%3C87k05umyyo.fsf%40prevos.net%3E>.
2022-09-26 06:24:05 +03:00
Protesilaos Stavrou a74adca476
Remove private function; make internal adjustments
This was the right moment to also address the TODO about the
buttonisation of links outside the 'denote-directory'.
2022-09-26 06:19:36 +03:00
Protesilaos Stavrou 3f47374435
Reformat paragraph 2022-09-26 05:54:50 +03:00
Protesilaos Stavrou b8f448f5f5
Fix typo in the README 2022-09-26 05:53:40 +03:00
Protesilaos Stavrou f612c62146
Clarify language in "Things to do" 2022-09-24 07:33:17 +03:00
Protesilaos Stavrou 2dc4ad1bad
Mark sections from cf356e2 as in-development 2022-09-19 10:08:08 +03:00
Protesilaos Stavrou cf356e2312
Move some commands from denote.el to the manual
It is easier for the maintenance of the project to have such code in the
manual.  Otherwise we are setting a precedent where we need to maintain
variants of the same command that have a slightly different behaviour.

Perhaps we will find a more elegant solution that gives the user maximum
flexibility.

This is discussed on the mailing list:
<https://lists.sr.ht/~protesilaos/denote/%3C87fsgvddny.fsf%40protesilaos.com%3E>.
2022-09-19 10:04:50 +03:00
Protesilaos Stavrou d1d3c28fb9
Fix typo in doc string 2022-09-18 21:05:19 +03:00
Protesilaos Stavrou 73ffe18348
Acknowledge Alan Schmitt for commit 570ac0e
The patch was sent on the mailing list:
<https://lists.sr.ht/~protesilaos/denote/%3C87fsgvddny.fsf%40protesilaos.com%3E>.

It is within the limit of what is allowed without assigning copyright to
the Free Software Foundation.
2022-09-18 15:50:16 +03:00
Protesilaos Stavrou 2f42ff7bbd
Reposition some convenience commands 2022-09-18 15:45:41 +03:00
Protesilaos Stavrou 67c80d6766
Expand "link or create", "open or create" commands
This is based on the discussion over at the mailing list:
<https://lists.sr.ht/~protesilaos/denote/%3C87fsgvddny.fsf%40protesilaos.com%3E>.
2022-09-18 15:42:42 +03:00
Protesilaos Stavrou 5fedf8eaf6
Mention Org+calendar date prompt in denote-date 2022-09-18 15:29:33 +03:00
Protesilaos Stavrou 4c4187ee3a
Tweak denote-prompts doc string 2022-09-18 15:29:20 +03:00
Alan Schmitt 570ac0eebd
New utility functions
- `denote-link-or-create-with-date' is identical to
  `denote-link-or-create' with a date prompt in case of creation
- `denote-open-or-create' opens a denote file if it exists, otherwise it
  proposes to create it
- `denote-open-or-create-with-date' is identical to
  `denote-open-or-create' with a date prompt in case of creation
2022-09-18 15:18:20 +03:00
Protesilaos Stavrou 92d85a2ed3
Acknowledge Clemens Radermacher for commit 22c14c9
Clemens has assigned copyright to the Free Software Foundation.
2022-09-17 15:20:56 +03:00
Protesilaos Stavrou 82dd42090f
Update docs of denote-desluggify 2022-09-17 15:20:39 +03:00
Clemens Radermacher 22c14c9ced
Upcase first char in denote-desluggify 2022-09-17 15:18:56 +03:00
Protesilaos Stavrou 98e5263b94
Harden denote-retrieve-filename-title; clarify doc 2022-09-17 12:49:50 +03:00
Protesilaos Stavrou 641311b97a
Refine denote--retrieve-title-or-filename
The idea is to return the TITLE component of the file name if there is
no relevant front matter.
2022-09-17 12:37:42 +03:00
Protesilaos Stavrou 8ce221da71
Make denote-extract-keywords-from-path public
We are working towards version 1.0.0.  The idea is to provide functions
that users/developers can rely on.  By making them public (removing the
double hyphens) we signify that those forms are (i) in a stable
state, and (ii) any change to them will be handled with care and
documented accordingly.

Thanks to Peter Prevos for informing me about this function on the
mailing list in relation to the 'denote-statistics' package:

- <https://github.com/pprevos/denote-statistics>
- <https://lists.sr.ht/~protesilaos/denote/%3C87o7vio7ix.fsf%40protesilaos.com%3E#%3C87r10cexe6.fsf@prevos.net%3E>
2022-09-15 15:33:03 +03:00
Protesilaos Stavrou 54c87a9735
Document denote-update-dired-buffers in API 2022-09-15 04:34:55 +03:00
Protesilaos Stavrou d4010ee23d
Remove obsoletion forms from older versions 2022-09-15 04:34:33 +03:00
Protesilaos Stavrou 4027c0ae5e
Tweak denote-link-button-action doc string 2022-09-15 04:28:42 +03:00
Protesilaos Stavrou 3b8a14cc8b
Add custom code sample to split Org subtree into note
Thanks to Sven Seebeck for suggesting the idea and for testing my
prototypes (this information is shared with permission, as it was
provided via a private channel).
2022-09-14 20:18:50 +03:00
Protesilaos Stavrou 7218f6be4e
Annotate for indices all API forms 2022-09-14 12:49:39 +03:00
Protesilaos Stavrou 7c701890c4
Document API of denote-keywords, denote-directory 2022-09-14 12:48:29 +03:00
Protesilaos Stavrou d13bb705ff
Make denote-directory-subdirectories public
We are working towards version 1.0.0.  The idea is to provide functions
that users/developers can rely on.  By making them public (removing the
double hyphens) we signify that those forms are (i) in a stable
state, and (ii) any change to them will be handled with care and
documented accordingly.
2022-09-14 12:38:34 +03:00
Protesilaos Stavrou 7f475adff8
Tweak denote-directory-files doc string 2022-09-14 12:38:16 +03:00
Protesilaos Stavrou f39b517428
Make denote-barf-duplicate-id public
We are working towards version 1.0.0.  The idea is to provide functions
that users/developers can rely on.  By making them public (removing the
double hyphens) we signify that those forms are (i) in a stable
state, and (ii) any change to them will be handled with care and
documented accordingly.
2022-09-14 12:33:00 +03:00
Protesilaos Stavrou c1c06e8897
Include functions of denote-file-types in the API 2022-09-14 12:29:13 +03:00
Protesilaos Stavrou 6395e69a76
Tweak spacing in some doc strings 2022-09-14 12:29:01 +03:00
Protesilaos Stavrou 03902ba812
Clarify doc strings of Markdown front matter vars 2022-09-14 12:23:10 +03:00
Protesilaos Stavrou bde60acd80
Make denote-get-path-by-id public
We are working towards version 1.0.0.  The idea is to provide functions
that users/developers can rely on.  By making them public (removing the
double hyphens) we signify that those forms are (i) in a stable
state, and (ii) any change to them will be handled with care and
documented accordingly.
2022-09-14 12:17:51 +03:00
Protesilaos Stavrou a02f768b63
BREAKING: Rename to denote-get-file-name-relative-to-denote-directory
This changes commit fb92d22, which was pushed about 20 minutes ago.
2022-09-14 12:15:50 +03:00
Protesilaos Stavrou 76d8c2eba6
Add TODO for denote--current-file-is-note-p 2022-09-14 12:00:50 +03:00
Protesilaos Stavrou 382d890e85
Fix typo in doc string 2022-09-14 11:56:03 +03:00
Protesilaos Stavrou fb92d22a57
Make denote-file-name-relative-to-denote-directory public
We are working towards version 1.0.0.  The idea is to provide functions
that users/developers can rely on.  By making them public (removing the
double hyphens) we signify that those forms are (i) in a stable
state, and (ii) any change to them will be handled with care and
documented accordingly.
2022-09-14 11:53:00 +03:00
Protesilaos Stavrou 8c11c5867d
Make denote-file-is-writable-and-supported-p public
We are working towards version 1.0.0.  The idea is to provide functions
that users/developers can rely on.  By making them public (removing the
double hyphens) we signify that those forms are (i) in a stable
state, and (ii) any change to them will be handled with care and
documented accordingly.
2022-09-14 11:48:57 +03:00
Protesilaos Stavrou 46e207a2cd
Fix typo in doc string 2022-09-14 11:46:24 +03:00
Protesilaos Stavrou 88c396e0bb
Make two file/note predicates public
We are working towards version 1.0.0.  The idea is to provide functions
that users/developers can rely on.  By making them public (removing the
double hyphens) we signify that those forms are (i) in a stable
state, and (ii) any change to them will be handled with care and
documented accordingly.
2022-09-14 11:46:11 +03:00
Protesilaos Stavrou d6b0355483
Fix typo in the manual 2022-09-14 11:45:23 +03:00
Protesilaos Stavrou dbdf8f58f2
Make denote-file-is-note-p public
We are working towards version 1.0.0.  The idea is to provide functions
that users/developers can rely on.  By making them public (removing the
double hyphens) we signify that those forms are (i) in a stable
state, and (ii) any change to them will be handled with care and
documented accordingly.
2022-09-14 11:38:29 +03:00
Protesilaos Stavrou ea0f50575e
Make some "rename" functions public
We are working towards version 1.0.0.  The idea is to provide functions
that users/developers can rely on.  By making them public (removing the
double hyphens) we signify that those forms are (i) in a stable
state, and (ii) any change to them will be handled with care and
documented accordingly.
2022-09-14 10:40:21 +03:00
Protesilaos Stavrou e7ebd85b41
Make denote-format-file-name public
We are working towards version 1.0.0.  The idea is to provide functions
that users/developers can rely on.  By making them public (removing the
double hyphens) we signify that those forms are (i) in a stable
state, and (ii) any change to them will be handled with care and
documented accordingly.
2022-09-14 10:35:42 +03:00
Protesilaos Stavrou 9f2c6b4022
Make all "sluggify" functions public
We are working towards version 1.0.0.  The idea is to provide functions
that users/developers can rely on.  By making them public (removing the
double hyphens) we signify that those forms are (i) in a stable
state, and (ii) any change to them will be handled with care and
documented accordingly.
2022-09-14 10:32:52 +03:00
Protesilaos Stavrou 569a52f140
Update docs "For developers or advanced users" 2022-09-14 10:25:23 +03:00
Protesilaos Stavrou f90d151f68
Make denote-retrieve-or-create-file-identifier public
We are working towards version 1.0.0.  The idea is to provide functions
that users/developers can rely on.  By making them public (removing the
double hyphens) we signify that those forms are (i) in a stable
state, and (ii) any change to them will be handled with care and
documented accordingly.
2022-09-14 10:23:23 +03:00
Protesilaos Stavrou 05a5038abd
Improve conditionality of Org button fontification
This way we only try to use the correct face when we are inside of a
Denote note.  We do not want Org to try to figure this out in other
situations, such as while building the agenda.

Thanks to Alan Schmitt for reporting the problem on the mailing list.
It led me down the path of debugging the issue:
<https://lists.sr.ht/~protesilaos/denote/%3C877d2e2ini.fsf%40m4x.org%3E>.
2022-09-14 09:45:40 +03:00
Protesilaos Stavrou 4b43fe2718
Fix typo in the manual 2022-09-14 08:21:54 +03:00
Protesilaos Stavrou 2756931bec
Add section "For developers or advanced users"
This is not necessarily its final state.  It may be better to use
subheadings.  I will check.  The list of functions/variables is not
complete yet.  It will be in time for version 1.0.0.
2022-09-14 08:08:02 +03:00
Protesilaos Stavrou 459294c84b
Refine doc string of denote-directory-files 2022-09-14 07:53:58 +03:00
Protesilaos Stavrou a424a2a677
Refine doc string of denote-subdirectory-prompt 2022-09-14 07:51:16 +03:00
Protesilaos Stavrou fa01663063
Refine doc string of denote-template-prompt 2022-09-14 07:48:19 +03:00
Protesilaos Stavrou 9cec3a16d4
Refine doc string of denote-date-prompt 2022-09-14 07:47:00 +03:00
Protesilaos Stavrou 2dab6a18ae
Make denote-filetype-heuristics public
We are working towards version 1.0.0.  The idea is to provide functions
that users/developers can rely on.  By making them public (removing the
double hyphens) we signify that those forms are (i) in a stable
state, and (ii) any change to them will be handled with care and
documented accordingly.
2022-09-14 07:41:02 +03:00
Protesilaos Stavrou 4e4d8cf50e
Rename denote-subdirs-prompt to denote-subdirectory-prompt
Also see commit 7ce102b.
2022-09-14 07:18:56 +03:00
Protesilaos Stavrou 1e14370c6f
Make denote-template-prompt public
We are working towards version 1.0.0.  The idea is to provide functions
that users/developers can rely on.  By making them public (removing the
double hyphens) we signify that those forms are (i) in a stable
state, and (ii) any change to them will be handled with care and
documented accordingly.
2022-09-14 07:18:18 +03:00
Protesilaos Stavrou 7ce102b206
Make denote-subdirs-prompt public
We are working towards version 1.0.0.  The idea is to provide functions
that users/developers can rely on.  By making them public (removing the
double hyphens) we signify that those forms are (i) in a stable
state, and (ii) any change to them will be handled with care and
documented accordingly.
2022-09-14 07:16:52 +03:00
Protesilaos Stavrou 505dae7f4f
Make denote-date-prompt public
We are working towards version 1.0.0.  The idea is to provide functions
that users/developers can rely on.  By making them public (removing the
double hyphens) we signify that those forms are (i) in a stable
state, and (ii) any change to them will be handled with care and
documented accordingly.
2022-09-14 07:15:43 +03:00
Protesilaos Stavrou c197c7167d
Make denote-file-type-prompt public
We are working towards version 1.0.0.  The idea is to provide functions
that users/developers can rely on.  By making them public (removing the
double hyphens) we signify that those forms are (i) in a stable
state, and (ii) any change to them will be handled with care and
documented accordingly.
2022-09-14 07:14:35 +03:00
Protesilaos Stavrou 582b50ab13
Make denote-title-prompt public
We are working towards version 1.0.0.  The idea is to provide functions
that users/developers can rely on.  By making them public (removing the
double hyphens) we signify that those forms are (i) in a stable
state, and (ii) any change to them will be handled with care and
documented accordingly.
2022-09-14 07:13:25 +03:00
Protesilaos Stavrou b3443ca6ff
Add denote-file-prompt instead of private function
We are working towards version 1.0.0.  The idea is to provide functions
that users/developers can rely on.  By making them public (removing the
double hyphens) we signify that those forms are (i) in a stable
state, and (ii) any change to them will be handled with care and
documented accordingly.
2022-09-14 07:11:35 +03:00
Protesilaos Stavrou e938e65950
Make denote-keywords-prompt public
We are working towards version 1.0.0.  The idea is to provide functions
that users/developers can rely on.  By making them public (removing the
double hyphens) we signify that those forms are (i) in a stable
state, and (ii) any change to them will be handled with care and
documented accordingly.
2022-09-14 07:04:38 +03:00
Protesilaos Stavrou c74eea19a9
Make some "retrieve" functions public
We are working towards version 1.0.0.  The idea is to provide functions
that users/developers can rely on.  By making them public (removing the
double hyphens) we signify that those forms are (i) in a stable
state, and (ii) any change to them will be handled with care and
documented accordingly.
2022-09-14 06:46:10 +03:00
Protesilaos Stavrou 74c74ce6c6
Tweak denote--retrieve-keywords-line doc string 2022-09-14 06:36:57 +03:00
Protesilaos Stavrou abaf5dc064
Update denote--retrieve-keywords-value doc string 2022-09-14 06:36:19 +03:00
Protesilaos Stavrou 97eb6b989a
Tweak denote--retrieve-title-line doc string 2022-09-14 06:35:32 +03:00
Protesilaos Stavrou ad7d0db798
Tweak denote--retrieve-title-value doc string 2022-09-14 06:34:35 +03:00
Protesilaos Stavrou fc5ba9f1ad
Expand FAQ on performance of Org agenda with many files 2022-09-14 06:19:48 +03:00
Protesilaos Stavrou adce7a1b67
Document sample command to create note with region contents
This is not part of denote.el, though we provide it in the manual for
users that may need it.

Thanks to sundar bp for suggesting the idea (this was done via a private
channel and the information is shared with permission).
2022-09-13 13:57:06 +03:00
Protesilaos Stavrou 3384ee91df
Add commands for linking to existing or new notes
Thanks to user sienic for suggesting the idea and for testing the
prototypes.  And thanks to Juanjo Presa for participating in the
discussion to share the view that this functionality should be part of
denote.el.  This happened in issue 96 over at the GitHub mirror:
<https://github.com/protesilaos/denote/issues/96>.
2022-09-13 08:36:41 +03:00
Protesilaos Stavrou cc0f9398b3
Improve denote--retrieve-filename-identifier check
This makes it work as intended when 'buffer-file-name' returns the value
of an unsaved buffer.  The denote--retrieve-filename-identifier should
have no opinion about whether the file is saved or not.  It just needs
to return the identifier.
2022-09-13 07:58:45 +03:00
Protesilaos Stavrou ce5148e801
Add NOTE about fixing dired font-lock 2022-09-12 06:55:13 +03:00
Protesilaos Stavrou 528901354c
Rewrite the "Things to do" section for clarity 2022-09-12 05:46:49 +03:00
Protesilaos Stavrou b4d3573766
Remove TODO for Embark
There seems to be no demand for it and it should anyway not be part of
denote.el.
2022-09-12 05:36:00 +03:00
Protesilaos Stavrou 016f1bc2ca
Tweak how denote-faces-title sets its nil value
Specifying 'nil' is more precise.  For the user, this is the same as
before.
2022-09-12 05:34:20 +03:00
Protesilaos Stavrou 97f5f041aa
Remove empty line 2022-09-12 05:29:11 +03:00
Protesilaos Stavrou e9512a5d65
Placate the compiler for denote-link-ol-store 2022-09-12 05:28:31 +03:00
Protesilaos Stavrou 26c97bdee2
Make denote-directory-files-matching-regexp public
This is the same idea as with commit c294eaf.

It means that users or developers can rely on this function in their own
code.  By making it "public" (removing the double hyphens), we declare
that we will keep this form in check and document any changes to its
behaviour.
2022-09-12 05:26:23 +03:00
Protesilaos Stavrou c294eaf15f
Make denote-directory-files a public function
This means that users or developers can rely on this function in their
own code.  By making it "public" (removing the double hyphens), we
declare that we will keep this form in check and document any changes to
its behaviour.
2022-09-12 05:15:36 +03:00
Protesilaos Stavrou 2ca1223c7b
Add TODO for denote-link-buttonize-buffer conditionality 2022-09-05 15:01:12 +03:00
Protesilaos Stavrou 93be4a5681
Clarify denote-link-buttonize-buffer doc string 2022-09-05 14:59:00 +03:00
Protesilaos Stavrou a3cc59acfe
Make denote-link-find-file find file reliably
The current code works even if the link is stored in a file outside the
'denote-directory'.  It works for as long as the target file is in the
'denote-directory'.

I discovered this problem while exchanging views with Marc Fargas
regarding commit dd086b7:
<https://lists.sr.ht/~protesilaos/denote/patches/35137>.
2022-09-05 14:54:40 +03:00
Protesilaos Stavrou e070da85b4
Remove empty space 2022-09-05 14:41:28 +03:00
Protesilaos Stavrou fb6b6f84c4
Acknowledge Marc Fargas for commit dd086b7
The patch is below the ~15 line threshold and thus does not require
copyright assignment to the Free Software Foundation.

It was discussed on the mailing list:
<https://lists.sr.ht/~protesilaos/denote/patches/35137>.  A prior
exchange took place on issue 104 over at the GitHub mirror:
<https://github.com/protesilaos/denote/issues/104>.
2022-09-05 14:39:04 +03:00
Marc Fargas dd086b78fc
Add support for org-store-link.
Hi,

Denote, uses the `denote:` link type internally.

This patch adds support for `org-store-link` of denote files meaning
that you can call `org-store-link` from a note and get a `denote:` link
instead of the current `file:` link.

The main benefit of a denote link is that it is resilient to renames,
etc. A file link would brake if the note was ever to be renamed.

As a side benefit, as `org-capture` uses `org-store-link` now you can
capture tasks on notes with resilient links!

This may seem related to `denote-link-use-org-id` though that one would
only work with orgmode notes (and, I think, as long as those were
withing `org-directory` when using `id:` links).

This should work with notes in any format, now `org-capture` works and
`org-store-link` too.

Best,
Marc

PS: This closes #104 on Github[1].
PSS: Second attempt at submitting a patch via git-email ...

[1]: https://github.com/protesilaos/denote/issues/104

Signed-off-by: Marc Fargas <marc@marcfargas.com>
2022-09-05 14:37:59 +03:00
Protesilaos Stavrou a143347053
Bump version 0.6.1 to trigger package rebuild
This is to include commit 2532464.
2022-09-04 18:41:12 +03:00
Protesilaos Stavrou 9758fa4393
Acknowledge Hilde Rhyne for commit 2532464
The patch is below the ~15 line threshold and thus does not require
copyright assignment to the Free Software Foundation.

The issue was discussed on the mailing list:
<https://lists.sr.ht/~protesilaos/denote/%3Cm035d7nq22.fsf%40disroot.org%3E>.
2022-09-04 18:33:06 +03:00
Hilde Rhyne 2532464b00
Make denote--current-file-is-note-p check for file
This avoids errors when buffer-file-name returns a nil value.
2022-09-04 18:31:07 +03:00
Protesilaos Stavrou 1971ffeacd
Refine denote--title-history 2022-09-04 13:45:40 +03:00
Protesilaos Stavrou 9c94de9934
Add :link to Info manual in denote group 2022-09-04 13:45:21 +03:00
Protesilaos Stavrou bb349f3383
Fix point-at-[be]ol obsoletion warnings (Emacs 29) 2022-09-02 05:49:19 +03:00
Protesilaos Stavrou 4d67ff82a0
Update to version 0.6.0 2022-08-31 13:02:03 +03:00
Protesilaos Stavrou 5ee7e6e9c0
Tweak indentation for stylistic consistency 2022-08-30 06:07:23 +03:00
Protesilaos Stavrou 95fcf091b0
Reorder front matter vars to mirror denote-file-types
I find it a bit easier to read, though I understand this is trivial.
2022-08-30 06:04:16 +03:00
Protesilaos Stavrou 77b34219d7
Tweak two doc strings 2022-08-30 06:04:02 +03:00
Protesilaos Stavrou d23a9401ea
Make minor stylistic tweak to indentation 2022-08-30 05:58:41 +03:00
Peter Prevos 57ebacc80a
Added a prompt to denote-rename-file-using-front-matter. 2022-08-30 05:52:11 +03:00
Protesilaos Stavrou 6c82337f47
Tweak some doc string for style consistency 2022-08-30 05:45:03 +03:00
Protesilaos Stavrou 869f9b0d06
Update doc strings of front matter format vars 2022-08-30 05:41:43 +03:00
Protesilaos Stavrou b43e1e2c1b
Remove TODO for front matter variables
They will stay as 'defvar' because they are fairly advanced.
2022-08-30 05:40:52 +03:00
Protesilaos Stavrou f3d1706f95
Reword docs for changing front matter format 2022-08-30 05:40:33 +03:00
Protesilaos Stavrou 67637bbaa0
Remove TODO from f5b45f5 (it's okay) 2022-08-28 08:46:50 +03:00
Protesilaos Stavrou f5b45f5f10
Add TODO for denote-file-types 2022-08-28 07:26:21 +03:00
Protesilaos Stavrou 651c985c81
Make minor correction to doc string 2022-08-28 07:24:17 +03:00
Protesilaos Stavrou 399ad5e9f1
Clarify that KEYWORDS arg is a list of strings 2022-08-28 07:23:09 +03:00
Protesilaos Stavrou 53f71dd406
Expand denote-file-types doc string 2022-08-28 07:21:27 +03:00
Protesilaos Stavrou ca88b5a86a
Make another ancillary function public
Missed it in commit ebd88bc.
2022-08-28 07:14:26 +03:00
Protesilaos Stavrou 1b2ab658fc
Let denote-file-type accept explicit 'org' symbol
This was already possible before, but now we make it explicit to avoid
potential confusion.
2022-08-28 07:02:08 +03:00
Protesilaos Stavrou ebd88bc271
Make denote-file-types ancillary functions public 2022-08-28 06:55:22 +03:00
Protesilaos Stavrou 14b2aa9de3
Document that active region is default title value
Per commit 5faa20b.
2022-08-23 20:47:21 +03:00
Protesilaos Stavrou a842cbd258
Add Eshel Yaron to the acknowledgements for 5faa20b
The commit is below the ~15 line threshold that thus requires no
copyright assignment to the Free Software Foundation.
2022-08-23 20:40:00 +03:00
Eshel Yaron 5faa20b7bf
Use active region in default title prompt
Facilitate a slightly smoother note taking by passing the contents of
the region from the denote command to denote--title-prompt as the
DEFAULT-TITLE argument, when the region is active.

The idea behind this DWIM-flavored patch is to be able to take a note
about a subject that appears in a buffer by simply marking it before
invoking the denote command, which feels natural to me.
2022-08-23 20:38:50 +03:00
Protesilaos Stavrou e97e926fa7
Merge pull request #102 from jeanphilippegg/format-org-keywords
Return empty string when no keywords in org notes
2022-08-22 17:30:05 +03:00
Jean-Philippe Gagné Guay ceff94f5a9 Return empty string when no keywords in denote--format-keywords-for-org-front-matter 2022-08-22 10:22:42 -04:00
Protesilaos Stavrou 62c6a801a8
Add documentation for DIY convenience commands 2022-08-22 12:36:10 +03:00
Protesilaos Stavrou c5a5cfb104
Merge pull request #101 from jeanphilippegg/fix-rename-marked-files
Fix denote-dired-rename-markd-files
2022-08-22 09:58:41 +03:00
Jean-Philippe Gagné Guay 2e5ae8b804 Fix denote-dired-rename-markd-files
- keywords should be allowed to be nil.
- The answer to yes-or-no-p should not yield the error "No marked files"
  if the answer is no.
2022-08-22 02:16:52 -04:00
Protesilaos Stavrou cab563803c
Merge pull request #100 from jeanphilippegg/filetype-heuristics
Fix denote--filetype-heuristics for md files when no key regexps match
2022-08-21 18:44:49 +03:00
Jean-Philippe Gagné Guay 5d9f1992e9 Rework denote--filetype-heuristics
denote--filetype-heuristics should always return an md filetype if the
file extension is md even if no key regexps match in the file. In that
case, we use the first md type in denote-file-types.

markdown-yaml should appear before markdown-toml in denote-file-types
because it used to be the default markdown type of
denote--filetype-heuristics.
2022-08-21 10:37:06 -04:00
Protesilaos Stavrou 621a721468
Add Org date selection to the manual 2022-08-21 14:37:01 +03:00
Protesilaos Stavrou 495f452392
Mention Org date selection in denote-prompts 2022-08-21 14:35:12 +03:00
Protesilaos Stavrou 5d578096e2
Reword denote-date-prompt-use-org-read-date docstring 2022-08-21 14:24:44 +03:00
Protesilaos Stavrou 8eea59281a
Merge pull request #99 from pprevos/main
Also remove leading dash when sluggifying title.
2022-08-21 05:47:26 +03:00
Peter Prevos b4bbff817c Also remove leading dash when sluggifying title. 2022-08-21 12:25:25 +10:00
Protesilaos Stavrou bef859aea1
Use parens in declared function's args
This is just for stylistic consistency with another 'declare-function'
we have.
2022-08-21 04:51:55 +03:00
Protesilaos Stavrou 1a94b58e81
Make minor tweaks to placate the compiler 2022-08-21 04:50:54 +03:00
Protesilaos Stavrou 6e0ba78d2a
Merge pull request #97 from jeanphilippegg/use-org-read-date
Add option denote-date-prompt-use-org-read-date
2022-08-21 04:49:15 +03:00
Jean-Philippe Gagné Guay c2f96b072a Load org in denote--date-prompt 2022-08-20 00:15:23 -04:00
Jean-Philippe Gagné Guay 1d68f35021 Rework denote--date-prompt
When org-read-date is used and the seconds are 00, add the current
seconds to the time returned by org-read-date.
2022-08-20 00:07:40 -04:00
Jean-Philippe Gagné Guay 8a168582e8 Add seconds to org time object 2022-08-19 14:13:27 -04:00
Jean-Philippe Gagné Guay d0e76beb01 Add option denote-date-prompt-use-org-read-date 2022-08-19 11:06:06 -04:00
Protesilaos Stavrou b1f115990e
Use correct front matter for plain text 2022-08-17 20:28:59 +03:00
Protesilaos Stavrou c1f8b3ffa6
Mark old name of denote backlinks mode as obsolete 2022-08-16 06:59:49 +03:00
Protesilaos Stavrou 4e269bf260
Merge pull request #94 from jeanphilippegg/cleanup
Cleanup
2022-08-16 06:55:27 +03:00
Jean-Philippe Gagné Guay d4d67a6118 Simplify some lambdas 2022-08-15 22:10:13 -04:00
Jean-Philippe Gagné Guay 71008dc939 Remove check for denote--only-note-p in denote--add-front-matter 2022-08-15 22:10:13 -04:00
Jean-Philippe Gagné Guay 89d1fdc1dd Simplify denote--valid-date 2022-08-15 22:10:13 -04:00
Jean-Philippe Gagné Guay 02e35f7e5d Remove denote--retrieve-files-in-output 2022-08-15 22:10:13 -04:00
Jean-Philippe Gagné Guay 0a22460e4f Remove checks in front matter retrieval functions 2022-08-15 22:10:13 -04:00
Jean-Philippe Gagné Guay 0f045279e2 Remove the check for empty file from denote--edit-front-matter-p 2022-08-15 22:10:13 -04:00
Jean-Philippe Gagné Guay 1aeee8410f Remove check for writable-and-supported-p in denote--edit-front-matter-p
- Move the check in denote-rename-file and denote-dired-rename-marked-files
2022-08-15 22:09:38 -04:00
Jean-Philippe Gagné Guay c7bf701030 Remove condition in denote--edit-front-matter-p
- Do not check if the file is inside denote-directory.
2022-08-15 18:12:06 -04:00
Jean-Philippe Gagné Guay c33c772fd7 Remove FIXME for denote--rewrite-front-matter 2022-08-15 17:10:42 -04:00
Jean-Philippe Gagné Guay 9e28fc8a78 Fix docstring of denote--retrieve-filename-title 2022-08-15 17:08:54 -04:00
Jean-Philippe Gagné Guay 11fef925c0 Rework docstring of denote--directory-files 2022-08-15 17:07:30 -04:00
Jean-Philippe Gagné Guay ada6348415 Remove TODO for denote--only-note-p 2022-08-15 17:01:25 -04:00
Jean-Philippe Gagné Guay 4ef21b0217 Rename denote-backlinks-mode and denote-backlinks-mode-map 2022-08-15 16:59:45 -04:00
Protesilaos Stavrou 29b6ec1aad
Add desluggify in denote--retrieve-filename-title
Builds on commit fe348c5.

This is based on the idea of Peter Prevos from commit 0ac3680.  Peter
sent the code on the GitHub mirror, as pull request 93:
<https://github.com/protesilaos/denote/pull/93>.
2022-08-15 13:55:36 +03:00
Protesilaos Stavrou fe348c5a18
Add denote--desluggify helper
This is based on the idea of Peter Prevos from commit 0ac3680.  Peter
sent the code on the GitHub mirror, as pull request 93:
<https://github.com/protesilaos/denote/pull/93>.
2022-08-15 13:54:41 +03:00
Protesilaos Stavrou a76d6240b1
Merge pull request #93 from pprevos/main
Update denote--retrieve-filename-title: remove dashes and capitalize
2022-08-15 13:50:25 +03:00
Protesilaos Stavrou 07303fd901
Fix regexp in denote--file-has-identifier-p 2022-08-15 13:48:26 +03:00
Peter Prevos 0ac3680b15 Update denote--retrieve-filename-title: remove dashes and capitalize 2022-08-15 20:29:24 +10:00
Protesilaos Stavrou 317b9927f5
Don't use empty string as default in title prompt
If we ever get an empty string, we do not want it to be the default
value.
2022-08-15 12:45:06 +03:00
Protesilaos Stavrou 0afea4ee71
Simplify denote--retrieve-title-or-filename 2022-08-15 12:40:01 +03:00
Protesilaos Stavrou bdba736be9
Refine file name retrieval 2022-08-15 12:26:21 +03:00
Protesilaos Stavrou 91b626aa1c
Make links use denote--retrieve-title-or-filename 2022-08-15 12:07:12 +03:00
Protesilaos Stavrou c9b5806c5b
Rename function that returns title 2022-08-15 12:07:05 +03:00
Protesilaos Stavrou 137f2a57f3
Remove useless progn 2022-08-15 12:02:35 +03:00
Protesilaos Stavrou 37dd43bb22
Add helper to return all denote-file-type keys
We might need this when checking the return value of the file type
heuristics.
2022-08-15 11:01:42 +03:00
Protesilaos Stavrou 4b4623ec74
Add helper to return title for renaming 2022-08-15 10:57:21 +03:00
Protesilaos Stavrou 6181335d7a
Simplify format of denote-file-types value 2022-08-15 10:19:05 +03:00
Protesilaos Stavrou fedd04ebf4
Merge pull request #91 from jeanphilippegg/cleanup
Some cleanups for denote--only-note-p
2022-08-15 09:32:04 +03:00
Jean-Philippe Gagné Guay a7b51fe041 Refactor denote--only-note-p and remove denote--extension-regexp 2022-08-15 02:14:03 -04:00
Jean-Philippe Gagné Guay 459955287d Add denote--extensions and refactor denote--file-supported-extension-p 2022-08-15 02:09:43 -04:00
Jean-Philippe Gagné Guay 0b4a888c36 Check if file is in denote-directory in denote--only-note-p 2022-08-15 01:51:32 -04:00
Jean-Philippe Gagné Guay 1ce1237326 Remove unreachable condition 2022-08-15 01:48:26 -04:00
Protesilaos Stavrou b84d945d58
Merge pull request #89 from jeanphilippegg/cleanup
File types section
2022-08-15 08:28:10 +03:00
Jean-Philippe Gagné Guay 2d1664c276 Use when-let in denote--filetype-heuristics 2022-08-14 23:59:11 -04:00
Jean-Philippe Gagné Guay 96c09e65b5 Add denote--file-types-with-extension 2022-08-14 23:58:04 -04:00
Jean-Philippe Gagné Guay 09232baa8d Add comments to some functions 2022-08-14 21:17:30 -04:00
Jean-Philippe Gagné Guay b179ea3178 Refactor denote--get-title-line-from-front-matter and denote--get-keywords-line-from-front-matter
Return the title and keywords lines with the formatted title and keywords
2022-08-14 19:12:38 -04:00
Jean-Philippe Gagné Guay c7d8d07119 Rename save-excursion and save-restriction when using with-temp-buffer 2022-08-14 14:38:27 -04:00
Jean-Philippe Gagné Guay 3d7c33e4cf Fix denote--format-front-matter 2022-08-14 12:34:42 -04:00
Jean-Philippe Gagné Guay 759fe4cb4e Fix denote--filetype-heuristics 2022-08-14 01:05:01 -04:00
Jean-Philippe Gagné Guay f9fbebd9e4 Use plists in denote-file-types 2022-08-14 00:27:30 -04:00
Jean-Philippe Gagné Guay 685152876e Rename denote--file-types to denote-file-types 2022-08-13 23:56:29 -04:00
Jean-Philippe Gagné Guay a270951e9b Rename denote--retrieve-value-title and denote--retrieve-value-keywords 2022-08-13 23:51:48 -04:00
Jean-Philippe Gagné Guay 9ea4078fb3 Remove denote--front-matter-keywords-to-list and use denote--retrieve-value-keywords instead 2022-08-13 23:31:01 -04:00
Jean-Philippe Gagné Guay 4dc13f44e5 Refactor denote--migrate-type-files and use denote--retrieve-keywords-line 2022-08-13 23:28:22 -04:00
Jean-Philippe Gagné Guay 1eb8d368b1 Refactor many functions to use denote--file-types 2022-08-13 22:57:22 -04:00
Jean-Philippe Gagné Guay e14ca11118 Implement accessor functions for denote--file-types 2022-08-13 15:54:27 -04:00
Jean-Philippe Gagné Guay b3cd0a7d4c Add denote--file-types 2022-08-13 15:54:20 -04:00
Jean-Philippe Gagné Guay 24e713f096 Add a File types section
- Move denote--file-extension, denote--title-key-regexp and
denote--keywords-key-regexp in the "File types" section.

- Add denote--front-matter, denote--title-key-value-function,
denote--title-value-reverse-function, denote--keywords-value-function,
denote--keywords-value-reverse-function.
2022-08-13 13:52:20 -04:00
Protesilaos Stavrou 5482ce6dad
Update the manual's Acknowledgements
This is for the patches that Abin Simon sent on the mailing list:
<https://lists.sr.ht/~protesilaos/denote/patches/34632>.

The aggregate change is below the ~15 line threshold and thus requires
no copyright assignment to the Free Software Foundation.
2022-08-13 10:41:38 +03:00
Abin Simon 7877d4c77c
Fix denote--migrate-type-files detection of old keywords when only one tag 2022-08-13 10:40:24 +03:00
Abin Simon f6501c6d42
Fix regexp for denote--{title,keywords}-key-regexp 2022-08-13 10:40:13 +03:00
Abin Simon a07851218d
Fix confirmation message for denote-migrate-old-markdown-yaml-tags 2022-08-13 10:40:01 +03:00
Protesilaos Stavrou 1981a16aeb
Relax denote--directory-files conditionality
The idea is noted in commit 8a8be90.
2022-08-13 10:38:45 +03:00
Protesilaos Stavrou ff1aca7fc6
Simplify denote--directory-files-matching-regexp 2022-08-13 10:38:29 +03:00
Protesilaos Stavrou 4934870625
Tweak how links are formatted (due to 8a8be90) 2022-08-13 10:33:25 +03:00
Protesilaos Stavrou 0b8a24ca0c
Add helper to check regular+writable file 2022-08-13 10:33:05 +03:00
Protesilaos Stavrou 8a8be90200
Relax conditionality for adding links
The idea is to be able to create a 'denote:' link to any file that has a
Denote identifier and is in the 'denote-directory'.

There still are some refinements to be made, though they belong to
separate commits.

Thanks to Peter Prevos for discussing this on the mailing list:
<https://lists.sr.ht/~protesilaos/denote/%3C87fsi1m5ze.fsf@prevos.net%3E>.
2022-08-13 10:05:26 +03:00
Protesilaos Stavrou 75cbaaf3a1
Merge pull request #88 from jeanphilippegg/cleanup
Remove some unused variables and functions
2022-08-13 06:35:11 +03:00
Jean-Philippe Gagné Guay fe4bd822fd Remove the optional key parameter from denote--retrieve-search and related functions
- Make file-type parameter mandatory in denote--retrieve-value-title and
denote--retrieve-value-keywords.
2022-08-11 22:58:41 -04:00
Protesilaos Stavrou 16e67cba93
Clarify TODO about denote--only-note-p 2022-08-12 05:18:15 +03:00
Protesilaos Stavrou 85fc959f5e
Add FIXME tasks for denote-dired-mode 2022-08-12 05:14:59 +03:00
Protesilaos Stavrou ed21ef8dcb
Update the manual's Acknowledgements 2022-08-12 05:13:23 +03:00
Protesilaos Stavrou 46f123c21d
Relax condition for batch rename from front matter
This is the same idea as with commit 64c5b74.  Thanks to atanasj for the
feedback in issue 87 on the GitHub mirror:
<https://github.com/protesilaos/denote/issues/87>.
2022-08-12 05:10:21 +03:00
Jean-Philippe Gagné Guay eff882fb09 Add file-type parameter to denote--add-front-matter 2022-08-11 13:38:36 -04:00
Jean-Philippe Gagné Guay dbe003bae7 Use with-temp-buffer instead of with-current-buffer in denote--regexp-in-file-p 2022-08-11 13:33:12 -04:00
Jean-Philippe Gagné Guay 061c7013eb Add denote--title-key-regexp and denote--keywords-key-regexp functions and use them
- Use the new functions instead of
denote--retrieve-title-front-matter-key-regexp and
denote--retrieve-keywords-front-matter-key-regexp.

- Add file-type parameters in some functions.

- Refactor denote--filetype-heuristics to not use the retrieval
functions because they depend on the file type and this is what we want
to find in denote--filetype-heuristics.
2022-08-11 13:31:39 -04:00
Jean-Philippe Gagné Guay aeb8905128 Remove some unused variables and functions
- Remove denote--retrieve-id-front-matter-key-regexp,
denote--retrieve-date-front-matter-regexp and
denote--retrieve-value-date.
2022-08-11 02:20:12 -04:00
Jean-Philippe Gagné Guay 4bb79fe89f
Remove fallback value in denote--file-extension 2022-08-11 09:13:02 +03:00
Jean-Philippe Gagné Guay 3748ac5f6d
Simplify denote--format-file 2022-08-11 09:13:02 +03:00
Jean-Philippe Gagné Guay 8256c85df9
Rename denote--file-type-symbol to denote--valid-file-type
- denote--valid-file-type takes a filetype argument (string or symbol)
and returns a valid filetype symbol.
2022-08-11 09:13:02 +03:00
Jean-Philippe Gagné Guay 1b2d4319bd
Refactor denote command to prepare all arguments for denote--prepare-note 2022-08-11 09:13:02 +03:00
Protesilaos Stavrou 1bdd0eb5e7
Fix argument in denote--writable-and-supported-p 2022-08-11 09:08:03 +03:00
Protesilaos Stavrou 64c5b74dbd
Relax conditionality in denote--retrieve-search 2022-08-11 09:06:25 +03:00
Protesilaos Stavrou 73ba47e832
Add comments for denote--only-note-p 2022-08-11 09:05:00 +03:00
Protesilaos Stavrou 465a093893
Simplify denote--edit-front-matter-p
The 'denote--writable-and-supported-p' was added in commit 29ed5c3.
2022-08-11 08:44:17 +03:00
Protesilaos Stavrou 29ed5c3449
Add denote--writable-and-supported-p helper 2022-08-11 08:44:02 +03:00
Protesilaos Stavrou c4d76bdd55
Add denote--file-supported-extension-p helper 2022-08-11 08:43:46 +03:00
Protesilaos Stavrou 1d714e8fb2
Bump version to 0.5.1
Just to trigger a rebuild of the package to include commit e13dc9c.
2022-08-10 21:43:43 +03:00
Protesilaos Stavrou a461df46d6
Update the manual's Acknowledgements
Thanks to Jürgen Hötzel for the bug fix to M-x denote which was
contributed in pull request 84 on the GitHub mirror:
<https://github.com/protesilaos/denote/pull/84>.
2022-08-10 21:30:03 +03:00
Protesilaos Stavrou 70b31867e6
Merge pull request #84 from juergenhoetzel/handle_nil_filetype
denote--format-front-matter: Handle nil filetype gracefuly
2022-08-10 21:27:10 +03:00
Juergen Hoetzel e13dc9cfa4 denote--format-front-matter: Handle nil filetype gracefuly
As descriped in denote-file-type docstring:

By default (a nil value), the file type is that of Org mode.
Any other non-nil value is the same as the default."
2022-08-10 19:59:45 +02:00
Protesilaos Stavrou d9c4746991
Update to version 0.5.0 2022-08-10 17:41:41 +03:00
Protesilaos Stavrou 9dfaa947c5
Specify :package-version in all defface forms 2022-08-10 16:53:03 +03:00
Protesilaos Stavrou 59891204ce
Limit the scope of the "migration" files
See commits 5c2237e and e711b16.  This is about updating the front
matter of Org and YAML to the correct syntax for tags.

The function I just wrote is not the best code ever written, but we will
not keep it for too long, anyway.
2022-08-10 16:29:49 +03:00
Protesilaos Stavrou 2704250ea6
Mark denote-directory as changed for 0.5.0
The change was done in commit 4b21e42 by Philip Kaludercic.
2022-08-10 14:58:40 +03:00
Protesilaos Stavrou e711b1610f
Add TEMPORARY command to migrate YAML tags
This is due to the changes we made to the format of the YAML front
matter where tags are now written as a standard comma-separated list of
strings (per commit cb9af65).

Same idea as with commit 5c2237e.
2022-08-10 14:42:39 +03:00
Protesilaos Stavrou 3c9a99d21f
Refine what was done in commit 5c2237e 2022-08-10 14:37:41 +03:00
Protesilaos Stavrou 5c2237e00d
Add TEMPORARY command to migrate Org filetags
This is due to the changes we made to the format of the Org front matter
where filetags are now written in the standard colon-separated
notation (check commit 37dca91).

Thanks to Alan Schmitt for bringing this matter to my attention:
https://lists.sr.ht/~protesilaos/denote/%3C871qu0jw5l.fsf%40protesilaos.com%3E
2022-08-10 12:53:08 +03:00
Protesilaos Stavrou 77d65716fd
Add conditionality in keyword to list conversion 2022-08-10 12:48:00 +03:00
Protesilaos Stavrou 10646db649
Remove needless 'declare-function'
We already 'require' Dired.
2022-08-10 09:26:00 +03:00
Protesilaos Stavrou 0e3f98810f
Tweak format for stylistic consistency 2022-08-10 09:25:24 +03:00
Protesilaos Stavrou 0d896b5495
Add TODO about "backlink" and "backlinks" inconsistency 2022-08-10 09:23:34 +03:00
Protesilaos Stavrou 48d8caee12
Tweak format of function for stylistic consistency 2022-08-10 09:20:55 +03:00
Protesilaos Stavrou f10e80fb5e
Add comment to clarify format of specifiers 2022-08-10 09:20:00 +03:00
Protesilaos Stavrou d75a0c2ac2
Add :info link to denote-link-fontify-backlinks 2022-08-10 09:18:48 +03:00
Protesilaos Stavrou fed4293084
Add :info link to denote-dired-directories 2022-08-10 09:17:53 +03:00
Protesilaos Stavrou 3adf83fea2
Clarify denote-dired-mode docstring
Striclty speaking, this minor mode has no Dired code.  We should revise
it to add keywords to Dired's and tie the two more closely.
2022-08-10 09:16:02 +03:00
Protesilaos Stavrou 7aa1c44f4f
Add comment about empty value of face 2022-08-10 09:14:20 +03:00
Protesilaos Stavrou 80fd25336c
Tweak format of faces for consistency 2022-08-10 09:14:04 +03:00
Protesilaos Stavrou fea84b28be
Remove empty line from doc string 2022-08-10 09:12:12 +03:00
Protesilaos Stavrou 0f4dbbdf0b
Rename private function for clarity 2022-08-10 09:09:58 +03:00
Protesilaos Stavrou b8d4c362c3
Add helper to test that dir is part of denote
This is done to avoid duplication in the code.
2022-08-10 09:07:57 +03:00
Protesilaos Stavrou 4477a24b74
Add comment about rationale of completion table 2022-08-10 08:58:27 +03:00
Protesilaos Stavrou 4e2f0c8d9e
Reword statement in docstring 2022-08-10 08:57:18 +03:00
Protesilaos Stavrou b401e249e9
Clarify comment about duplicate IDs 2022-08-10 08:55:59 +03:00
Protesilaos Stavrou f04fb92eae
Remove potentially confusing statement in doc
The reason is that the function itself does not handle that case.  The
DATE is determined elsewhere.
2022-08-10 08:47:55 +03:00
Protesilaos Stavrou 18a210b265
Add comment about front matter format variables 2022-08-10 08:45:48 +03:00
Protesilaos Stavrou 20040e7a2f
Clarify docstring about 'downcase' function 2022-08-10 08:42:16 +03:00
Protesilaos Stavrou 394c5d3e69
Tweak indentation for stylistic consistency 2022-08-10 08:40:58 +03:00
Protesilaos Stavrou 8c28b4818b
Remove delete-dups from denote--inferred-keywords
It is not needed as 'denote-keywords' has a 'delete-dups' as well.
2022-08-10 08:34:31 +03:00
Protesilaos Stavrou b201438b70
Add denote-templates :info link 2022-08-10 08:26:09 +03:00
Protesilaos Stavrou 0ab93d9f8a
Fix typo in the manual 2022-08-10 08:22:01 +03:00
Protesilaos Stavrou 94cbaf151e
Add clarification to Commentary 2022-08-10 08:21:50 +03:00
Protesilaos Stavrou f3cd705d51
Clarify doc string 2022-08-10 08:19:33 +03:00
Protesilaos Stavrou 94fb45c486
Placate the compiler regarding docstring format 2022-08-10 08:12:52 +03:00
Protesilaos Stavrou 8103476e31
Simplify docstrings of helper date functions 2022-08-10 08:11:04 +03:00
Protesilaos Stavrou 877c7243b9
Merge pull request #83 from jeanphilippegg/cleanup
Refactor denote--date
2022-08-10 08:08:58 +03:00
Jean-Philippe Gagné Guay e3c099bc25 Refactor denote--date
- Make date parameter mandatory.
- Add file-type parameter.
2022-08-10 00:35:53 -04:00
Protesilaos Stavrou 82424803d0
Merge pull request #82 from jeanphilippegg/cleanup
Minor cleanups
2022-08-10 07:08:33 +03:00
Jean-Philippe Gagné Guay b5704da5c2 Refactor denote--file-extension and denote--path
- Make all parameters mandatory in denote--path.
- Add file-type parameter in denote--file-extension and use it instead
of denote-file-type.
2022-08-09 23:23:58 -04:00
Jean-Philippe Gagné Guay ca6aa0d104 Make filetype parameter mandatory in denote--format-front-matter 2022-08-09 22:41:47 -04:00
Jean-Philippe Gagné Guay 34daa52ea3 Refactor denote--dir-in-denote-directory-p
- (denote-directory) is already expanded
2022-08-09 22:41:38 -04:00
Jean-Philippe Gagné Guay a992c74a71 Delete denote--prompt-symbols 2022-08-09 22:06:16 -04:00
Jean-Philippe Gagné Guay eb1131af24 Refactor denote--format-front-matter-keywords
- Make type parameter mandatory
- Delete denote--format-markdown-keywords and
denote--format-org-keywords
2022-08-09 21:56:51 -04:00
Jean-Philippe Gagné Guay 12dc9e23ac Rename denote--retrieve-process-grep and denote-link-button-action 2022-08-09 18:54:52 -04:00
Protesilaos Stavrou 55b4a09606
Add reference to denote-backlink-mode
Thanks to Philip Kaludercic for the patch that made it happen:
<https://lists.sr.ht/~protesilaos/denote/patches/34561>.
2022-08-09 16:02:00 +03:00
Philip Kaludercic 5bd454c26a
Add a major mode for backlink buffers
* denote.el (denote-backlink-mode-map): Add new map for 'denote-backlink-mode'.
(denote-backlink-mode): Add new mode that derives from 'special-mode'.
(denote-link--prepare-backlinks): Use 'denote-backlink-mode'.
2022-08-09 15:52:16 +03:00
Philip Kaludercic 4b21e42e26
* denote.el (denote-directory): Use 'xdg-user-dir' 2022-08-09 15:52:05 +03:00
Protesilaos Stavrou 2f7ac757f5
Update the manual's Acknowledgements 2022-08-09 08:18:37 +03:00
Protesilaos Stavrou 325853286d
Merge pull request #81 from jeanphilippegg/small-fix
Fix denote--id-exists-p
2022-08-09 08:16:51 +03:00
Jean-Philippe Gagné Guay 92310d2c37 Fix denote--id-exists-p 2022-08-09 00:44:29 -04:00
Protesilaos Stavrou 065a10fc60
Merge pull request #80 from jeanphilippegg/cleanup
Cleanup
2022-08-09 06:48:51 +03:00
Jean-Philippe Gagné Guay 2c00c3ed44 Fix backlinks buffer
- Clicking on a link in a file in a subdirectory should open the linked file.
2022-08-08 22:37:21 -04:00
Jean-Philippe Gagné Guay 9b4310779f Use absolute paths in denote--retrieve-files-in-xrefs and denote--retrieve-proces-grep 2022-08-08 22:22:21 -04:00
Jean-Philippe Gagné Guay 769f497f17 Ignore hidden directories in denote--subdirs 2022-08-08 20:09:40 -04:00
Jean-Philippe Gagné Guay 1e8b1b62b4 Refactor denote--buffer-file-names
- Adjust denote-link--buffer-prompt
2022-08-08 20:09:26 -04:00
Jean-Philippe Gagné Guay d0a174082a Remove the absolute parameter from denote--directory-files and delete denote--directory-files-recursively
- Adjust denote-link--find-file-prompt to have the file names relative to
denote-directory.
2022-08-08 17:34:46 -04:00
Jean-Philippe Gagné Guay 2d12ec7457 Refactor denote--id-exists-p 2022-08-08 17:11:55 -04:00
Jean-Philippe Gagné Guay c925928795 Refactor denote--directory-files-matching-regexp 2022-08-08 17:06:15 -04:00
Jean-Philippe Gagné Guay 8a25727777 Remove check of current buffer in denote--id-exists-p 2022-08-08 17:06:12 -04:00
Jean-Philippe Gagné Guay 6793a4319d Delete variable denote-link--links-to-files 2022-08-08 02:49:20 -04:00
Jean-Philippe Gagné Guay 5d7f4f3cfc Remove let-bindings of default-directory 2022-08-08 02:03:43 -04:00
Protesilaos Stavrou 22bb68b86c
Merge pull request #78 from jeanphilippegg/org-capture
Remove most denote-last-* variables
2022-08-08 06:43:58 +03:00
Jean-Philippe Gagné Guay 24e5b54fca Remove most denote-last-* variables 2022-08-07 23:13:23 -04:00
Protesilaos Stavrou 77200064dc
Merge pull request #77 from jeanphilippegg/template
Insert template in denote--prepare-note
2022-08-07 14:06:48 +03:00
Jean-Philippe Gagné Guay 7580c9bee4 Insert template in denote--prepare-note 2022-08-07 06:43:46 -04:00
Protesilaos Stavrou 00c4e70dfa
Add denote-templates user option 2022-08-07 08:27:11 +03:00
Protesilaos Stavrou 1526f320eb
Refill paragraphs in the manual 2022-08-07 08:22:47 +03:00
Protesilaos Stavrou 803aef89db
Tweak doc string of internal variable 2022-08-07 08:00:42 +03:00
Protesilaos Stavrou 3fd1219044
Fill doc string to meet proper line length 2022-08-07 08:00:24 +03:00
Protesilaos Stavrou eccdc49298
Add :package-version to user options
This is normally used by packages which are built into Emacs and which
specify the :version (e.g. the modus-themes).  Though I find it useful
for our purposes as well, as it provides a hint to the user of when the
variable was last updated.
2022-08-07 07:56:29 +03:00
Protesilaos Stavrou f3b09f95c2
Re-indent form 2022-08-06 21:33:43 +03:00
Protesilaos Stavrou 9efa59452b
Add denote-add-front-matter command
The idea for this command originates in the discussion in issue 74 over
at the GitHub mirror: <https://github.com/protesilaos/denote/issues/74>.
The relevant point is this comment of mine:
<https://github.com/protesilaos/denote/issues/74#issuecomment-1207201324>.
2022-08-06 20:16:39 +03:00
Protesilaos Stavrou c7d1d1b6fd
Tweak examples with front matter format
Better to use Org as it is the default.  Also added the sample with the
all capital entries.
2022-08-06 19:24:28 +03:00
Protesilaos Stavrou 937f0023e4
Add node in manual to change front matter format 2022-08-06 17:11:20 +03:00
Protesilaos Stavrou a2794d8484
Tweak denote-org-front-matter doc string 2022-08-06 17:11:00 +03:00
Protesilaos Stavrou 22ef6df7c4
Disambiguate buffer-file-name to placate compiler 2022-08-06 09:49:51 +03:00
Protesilaos Stavrou a41686a3d0
Change how front matter keywords turn into a list
The idea is to try to catch faulty syntax in order to always return the
desired list of strings that Denote uses.

This change was discussed with Jean-Philippe Gagné Guay in issue 74 on
the GitHub mirror, starting from this message:
<https://github.com/protesilaos/denote/issues/74#issuecomment-1206328912>.
2022-08-05 21:35:08 +03:00
Protesilaos Stavrou 529578dfce
Update the manual's Acknowledgements 2022-08-05 14:52:46 +03:00
Protesilaos Stavrou 2c9c9cc18c
Document in the manual batch front matter rename
This is part of the work being done to refine the feature set of the
renaming mechanism.

Issue on the GitHub mirror: <https://github.com/protesilaos/denote/issues/74>.

Mailing list threads (I wish they were not split like that, but here we
are):

- <https://lists.sr.ht/~protesilaos/denote/%3C87k081l6vw.fsf%40silverstone.mail-host-address-is-not-set%3E>
- <https://lists.sr.ht/~protesilaos/denote/%3C878rogw5kk.fsf%40protesilaos.com%3E>
- <https://lists.sr.ht/~protesilaos/denote/%3C87fsiljv1s.fsf%40hu.mail-host-address-is-not-set%3E>
- <https://lists.sr.ht/~protesilaos/denote/%3C87r122afe3.fsf%40hu.mail-host-address-is-not-set%3E>
2022-08-05 14:51:16 +03:00
Protesilaos Stavrou a56720e362
Reposition node in the manual 2022-08-05 14:43:53 +03:00
Protesilaos Stavrou c594723e98
Update batch front matter rename doc string
This is part of the work being done to refine the feature set of the
renaming mechanism.

Issue on the GitHub mirror: <https://github.com/protesilaos/denote/issues/74>.

Mailing list threads (I wish they were not split like that, but here we
are):

- <https://lists.sr.ht/~protesilaos/denote/%3C87k081l6vw.fsf%40silverstone.mail-host-address-is-not-set%3E>
- <https://lists.sr.ht/~protesilaos/denote/%3C878rogw5kk.fsf%40protesilaos.com%3E>
- <https://lists.sr.ht/~protesilaos/denote/%3C87fsiljv1s.fsf%40hu.mail-host-address-is-not-set%3E>
- <https://lists.sr.ht/~protesilaos/denote/%3C87r122afe3.fsf%40hu.mail-host-address-is-not-set%3E>
2022-08-05 14:41:29 +03:00
Protesilaos Stavrou 6fd162c9b0
Use consistent phrasing in doc string
Just so we have the same voice throughout.
2022-08-05 13:45:12 +03:00
Protesilaos Stavrou 5faa2b41b0
Clarify denote-rename-file-using-front-matter doc 2022-08-05 13:43:46 +03:00
Protesilaos Stavrou bbe8ea2574
Document rename single file based on front matter
This is part of the work being done to refine the feature set of the
renaming mechanism.

Issue on the GitHub mirror: <https://github.com/protesilaos/denote/issues/74>.

Mailing list threads (I wish they were not split like that, but here we
are):

- <https://lists.sr.ht/~protesilaos/denote/%3C87k081l6vw.fsf%40silverstone.mail-host-address-is-not-set%3E>
- <https://lists.sr.ht/~protesilaos/denote/%3C878rogw5kk.fsf%40protesilaos.com%3E>
- <https://lists.sr.ht/~protesilaos/denote/%3C87fsiljv1s.fsf%40hu.mail-host-address-is-not-set%3E>
- <https://lists.sr.ht/~protesilaos/denote/%3C87r122afe3.fsf%40hu.mail-host-address-is-not-set%3E>
2022-08-05 13:35:25 +03:00
Protesilaos Stavrou b439189d13
Fix typo in 31e7364 2022-08-05 13:33:47 +03:00
Protesilaos Stavrou 31e7364c56
Update denote-rename-file-using-front-matter doc 2022-08-05 13:24:34 +03:00
Protesilaos Stavrou 7ce1f97844
Add denote-rename-file-using-front-matter y-or-n 2022-08-05 13:23:30 +03:00
Protesilaos Stavrou f1f7ab6450
Update manual about filetags format 2022-08-05 13:12:16 +03:00
Protesilaos Stavrou 1e584e26dd
Update introduction to "Renaming files" section 2022-08-05 13:06:33 +03:00
Protesilaos Stavrou d57da9f475
Reposition helper function in the file 2022-08-05 12:57:51 +03:00
Protesilaos Stavrou 91cf9e409e
Merge pull request #76 from jeanphilippegg/update-docstring
Update docstring of denote-rename-file-using-front-matter
2022-08-05 09:20:29 +03:00
Jean-Philippe Gagné Guay 399f6a794d Update docstring of denote-rename-file-using-front-matter 2022-08-05 02:09:06 -04:00
Protesilaos Stavrou aeb394789e
Merge pull request #75 from jeanphilippegg/rename-files-using-front-matter
Add denote-rename-file-using-front-matter and denote-rename-marked-fi…
2022-08-05 09:01:08 +03:00
Jean-Philippe Gagné Guay 03b761e4c5 Rename denote-reverse-rename-file and add denote-rename-marked-files-using-front-matter 2022-08-05 01:52:37 -04:00
Protesilaos Stavrou 3ffe839458
Add proof-of-concept denote-reverse-rename-file
This is part of the work being done to add a "reverse rename" operation
which will rename a file based on its front matter.

Issue on the GitHub mirror: <https://github.com/protesilaos/denote/issues/74>.

Mailing list threads (I wish they were not split like that, but here we
are):

- <https://lists.sr.ht/~protesilaos/denote/%3C87k081l6vw.fsf%40silverstone.mail-host-address-is-not-set%3E>
- <https://lists.sr.ht/~protesilaos/denote/%3C878rogw5kk.fsf%40protesilaos.com%3E>
- <https://lists.sr.ht/~protesilaos/denote/%3C87fsiljv1s.fsf%40hu.mail-host-address-is-not-set%3E>
- <https://lists.sr.ht/~protesilaos/denote/%3C87r122afe3.fsf%40hu.mail-host-address-is-not-set%3E>
2022-08-05 08:13:53 +03:00
Protesilaos Stavrou 1ab9171bfe
Add denote--front-matter-keywords-to-list helper
This is part of the work being done to add a "reverse rename" operation
which will rename a file based on its front matter.

Issue on the GitHub mirror: <https://github.com/protesilaos/denote/issues/74>.

Mailing list threads (I wish they were not split like that, but here we
are):

- <https://lists.sr.ht/~protesilaos/denote/%3C87k081l6vw.fsf%40silverstone.mail-host-address-is-not-set%3E>
- <https://lists.sr.ht/~protesilaos/denote/%3C878rogw5kk.fsf%40protesilaos.com%3E>
- <https://lists.sr.ht/~protesilaos/denote/%3C87fsiljv1s.fsf%40hu.mail-host-address-is-not-set%3E>
- <https://lists.sr.ht/~protesilaos/denote/%3C87r122afe3.fsf%40hu.mail-host-address-is-not-set%3E>
2022-08-05 08:02:09 +03:00
Protesilaos Stavrou 6ef8a3036f
Remove obsolete reference in the manual 2022-08-05 06:13:39 +03:00
Protesilaos Stavrou 5efd1bc7be
Clarify outline heading 2022-08-05 06:00:10 +03:00
Protesilaos Stavrou 0dc7c03348
Update manual for denote-dired-rename-marked-files 2022-08-05 05:57:37 +03:00
Protesilaos Stavrou be068f0e05
Clarify that 44868ad is part of development 2022-08-05 05:57:11 +03:00
Protesilaos Stavrou 44868ad948
Update denote-rename-file doc string and manual 2022-08-05 05:45:47 +03:00
Protesilaos Stavrou 6b2067dba9
Remove obsolete denote-dired-rename-expert 2022-08-05 05:23:00 +03:00
Protesilaos Stavrou 5cfc1d1be5
Add denote-faces-broken-link (only works with Org) 2022-08-05 05:10:41 +03:00
Protesilaos Stavrou c819500a4e
Give better names to private functions 2022-08-05 04:42:39 +03:00
Protesilaos Stavrou 94c3b9df14
Tweak private function for front matter format 2022-08-05 04:39:23 +03:00
Protesilaos Stavrou a941833ec4
Fix regression in plain text keywords front matter
They were formatted in the Org style.  Technically this is not a
problem, as plain text has no standard, though I prefer the double
spacing.
2022-08-04 21:37:59 +03:00
Protesilaos Stavrou 2802037f5f
Document denote-faces-link (per commit 8d35900) 2022-08-04 13:08:03 +03:00
Protesilaos Stavrou ddff2b5f11
Clarify a statement in the manual 2022-08-04 13:07:06 +03:00
Protesilaos Stavrou 66e9bf53f3
Repunctuate sentences to placate the compiler 2022-08-04 13:03:05 +03:00
Protesilaos Stavrou 8d3590027b
Use a face for 'denote:' links
This lets the user style them differently than ordinary links.

Thanks to Peter Prevos for the request on the mailing list:
<https://lists.sr.ht/~protesilaos/denote/%3C03618bb20d3eaba78c32cd0cb63bfc71@prevos.net%3E>.
2022-08-04 12:57:53 +03:00
Protesilaos Stavrou c3df0d6575
Merge pull request #73 from jeanphilippegg/cleanup
Cleanup
2022-08-03 06:09:27 +03:00
Jean-Philippe Gagné Guay 5c95a56bf4 Ignore return value of denote--barf-duplicate-id 2022-08-02 21:28:48 -04:00
Jean-Philippe Gagné Guay 4a95695d52 Simplify denote-link--map-over-notes 2022-08-02 21:24:49 -04:00
Jean-Philippe Gagné Guay 3284762918 Simplify denote--directory-files-matching-regexp 2022-08-02 21:22:02 -04:00
Jean-Philippe Gagné Guay e01cdf4123 Use file-name-base 2022-08-02 21:09:19 -04:00
Jean-Philippe Gagné Guay 9ea59c442b Simplify denote--retrieve-files-in-output 2022-08-02 20:47:35 -04:00
Jean-Philippe Gagné Guay 49c4e4e094 Simplify denote--format-file 2022-08-02 20:44:26 -04:00
Protesilaos Stavrou aabc3abdd3
Merge pull request #72 from jeanphilippegg/slug-hyphenate
Replace underscore with hyphen in denote--slug-hyphenate
2022-08-02 20:00:06 +03:00
Jean-Philippe Gagné Guay c3b2dbe754 Replace underscore with hyphen in denote--slug-hyphenate 2022-08-02 12:27:48 -04:00
Protesilaos Stavrou 21d9cf02b4
Merge pull request #69 from jeanphilippegg/rename-functions
Remove denote-dired-rename-file-and-add-front-matter
2022-08-01 19:59:56 +03:00
Protesilaos Stavrou 7d6c51eb86
Update the manual's Acknowledgements for 606e43f
Colin McLear's contribution is below the ~15 line threshold and thus
does not require copyright assignment to the Free Software Foundation.

This was done in pull request 70 over at the GitHub mirror:
<https://github.com/protesilaos/denote/pull/70>.

[ Colin is the author/maintainer of the 'consult-notes' package. ]
2022-08-01 19:53:08 +03:00
Protesilaos Stavrou 3d3b1d3d50
Merge pull request #70 from mclearc/main
Revise README for consult-notes & denote
2022-08-01 19:51:56 +03:00
Colin McLear 606e43fd8b Revise README for consult-notes & denote
- update info for consult-notes package
- add info about searching notes
2022-08-01 12:19:46 -04:00
Jean-Philippe Gagné Guay a72817326a Remove denote-dired-rename-marked-files-and-add-front-matter
- Rework denote-dired-rename-marked-files to make it add a front
matter when appropriate.
- Make denote-dired-rename-marked-files-and-add-front-matters
obsolete.
2022-08-01 03:56:34 -04:00
Jean-Philippe Gagné Guay 0df694a554 Add denote-rename-file and remove denote-dired-rename-file-and-add-front-matter
- Add unified denote-rename-file.
- Make denote-dired-rename-file and
denote-dired-rename-file-and-add-front-matter obsolete.
2022-08-01 03:21:14 -04:00
Protesilaos Stavrou fc5626d0da
Add development note about format of Org filetags 2022-08-01 09:55:48 +03:00
Protesilaos Stavrou 37dca91643
CHANGE how Org filetags are formatted by default
Before, we would separate them by two spaces:

    filetags:  tag1  tag2

Now we do:

    filetags:  :tag1:tag2:

Technically, our space-separated format was correct though it could
confuse users, as the Org manual only mentions the colon-separated
format.  To avoid potential conflicts, we now do what Org and its users
expect.

Thanks to Jean-Philippe Gagné Guay for commenting on this change:
<ea7d079c2d>.

Also thanks to Alan Schmitt and Peter Prevos for mentioning this topic
on different mailing list threads:

- <https://lists.sr.ht/~protesilaos/denote/%3C875yk1x8en.fsf@m4x.org%3E#%3C87mtd8m82n.fsf@m4x.org%3E>
- <https://lists.sr.ht/~protesilaos/denote/%3C87k081l6vw.fsf@silverstone.mail-host-address-is-not-set%3E#%3Cecd9f72563bbe41db77291a050b3de38@prevos.net%3E>
2022-08-01 09:37:44 +03:00
Protesilaos Stavrou ea7d079c2d
Handle all keywords in front matter extraction
This is an attempt to address our TODO item on the matter.  Right now we
insert filetags separated by two spaces, though the Org manual only
shows tags that are separated by the colon sign.  Perhaps we should do
the same in Denote to avoid possible confusion.
2022-08-01 08:57:36 +03:00
Protesilaos Stavrou 7fccf96580
Fix typo in the manual 2022-08-01 06:49:26 +03:00
Protesilaos Stavrou ca76227936
Merge pull request #68 from jeanphilippegg/reorganization
Ignore return value of denote--rename-file
2022-07-31 09:14:11 +03:00
Jean-Philippe Gagné Guay e3cd519361 Ignore return value of denote--rename-file 2022-07-31 02:01:34 -04:00
Protesilaos Stavrou 95ee2d4f38
Put require call at the top 2022-07-31 08:32:49 +03:00
Protesilaos Stavrou 79f5b62aa6
Merge all ancillary files into denote.el
Makes things easier to manage and document.
2022-07-31 08:18:29 +03:00
Protesilaos Stavrou 8989d98d2c
Remove 'require' for dired in denote-dired.el
It is already 'require'd by denote.el.
2022-07-31 08:00:22 +03:00
Protesilaos Stavrou b78834c8fa
Remove obsoletion warnings from older versions 2022-07-31 07:59:15 +03:00
Protesilaos Stavrou 9246831598
Merge pull request #67 from jeanphilippegg/reorganization
Rename denote-dired--rename-file to denote-dired--rename-file-prompt
2022-07-31 07:57:36 +03:00
Jean-Philippe Gagné Guay 3453f409a3 Rename internal functions 2022-07-30 15:07:40 -04:00
Jean-Philippe Gagné Guay 35e2d93bfa Move renaming commands from denote-dired.el to denote.el 2022-07-30 15:07:40 -04:00
Jean-Philippe Gagné Guay 4ce8c6701c Fix denote--rename-file 2022-07-30 15:07:40 -04:00
Jean-Philippe Gagné Guay 1a1f3fb7cf Use denote--rename-file in renaming functions 2022-07-30 12:16:44 -04:00
Jean-Philippe Gagné Guay 7a8143a7c3 Rename denote-dired--rename-file to denote-dired--rename-file-prompt
The function only prompts to rename the file. The renaming is done by
the function denote--rename-file.
2022-07-30 11:57:17 -04:00
Protesilaos Stavrou b88eaf36a4
Move 'denote-faces' require call to the top
It is easier to notice.
2022-07-30 07:17:06 +03:00
Protesilaos Stavrou 7b0181835e
Merge denote-retrieve.el into denote.el
All those are internal changes that should not concern the user.  This
is a continuation of the work done in commit b284da5 by Jean-Philippe
Gagné Guay, which was submitted in pull request 66 on the GitHub mirror:
<https://github.com/protesilaos/denote/pull/66>.
2022-07-30 07:11:22 +03:00
Protesilaos Stavrou d3b35f6f2f
Merge pull request #66 from jeanphilippegg/reorganization
Move functions from denote-dired.el and create some utility functions
2022-07-30 07:03:53 +03:00
Jean-Philippe Gagné Guay b284da5293 Move functions from denote-dired.el and create some utility functions
- Move multiple functions from denote-dired.el to denote.el.
- Create section "Note modifications" in denote.el.
- Create section "Front matter retrieval functions" in denote.el.
- Create denote--rename-file and
  denote--extract-keywords-from-front-matter.
2022-07-29 20:44:32 -04:00
Protesilaos Stavrou e82a2fbb11
Add FAQ on performance; link to Peter Prevos blog 2022-07-29 12:32:07 +03:00
Protesilaos Stavrou 99cea51f83
Tweak FAQ about Org agenda 2022-07-29 12:28:45 +03:00
Protesilaos Stavrou 4fd7e0d8ea
Merge pull request #65 from jeanphilippegg/reorganization
Cleanup of denote.el
2022-07-29 11:53:59 +03:00
Jean-Philippe Gagné Guay b8b365bb82 Move keywords section header 2022-07-29 03:20:53 -04:00
Jean-Philippe Gagné Guay 1778ff24f2 Add section for denote command and its prompts
Move helper functions out of this new section.
2022-07-29 03:20:53 -04:00
Jean-Philippe Gagné Guay ee5fba669d Move convenience functions into their own section 2022-07-29 03:20:53 -04:00
Protesilaos Stavrou f698ce0332
Tweak denote--only-note-p to read .gpg extension
The idea of using encryption for Denote files was put forward by Paul
van Gelder:
<https://lists.sr.ht/~protesilaos/denote/%3C1123434736.64290.1658954014673%40kpc.webmail.kpnmail.nl%3E>
2022-07-28 06:18:38 +03:00
Protesilaos Stavrou cb9af65f28
Treat all Markdown keywords uniformly
In TOML we were doing this:

    ["one"]

And this:

    ["one", "two", "three"]

Now we do the same for YAML, as the space-separated list did not seem
correct.
2022-07-27 17:59:39 +03:00
Protesilaos Stavrou bb10f74f15
Rename private function for markdown tags 2022-07-27 15:30:51 +03:00
Protesilaos Stavrou 885aedc3d7
Remove needless detail from doc string 2022-07-26 06:06:13 +03:00
Protesilaos Stavrou 0ca421e3d4
Update to version 0.4.0 2022-07-25 11:28:34 +03:00
Protesilaos Stavrou dcff9625be
Tweak sample configuration 2022-07-25 10:59:41 +03:00
Protesilaos Stavrou 23d4ce71e4
Refine prompt for batch front matter insertion 2022-07-25 09:27:12 +03:00
Protesilaos Stavrou 3dbbffeef2
Fix denote-dired--add-front-matter 'when' format
The previous one did not execute the form but would instead bind
'denote--only-note-p' as a variable with a value of 'file'.

Writing it this way is the same as:

    (when (denote--only-note-p file) (let ...))
2022-07-25 09:23:30 +03:00
Protesilaos Stavrou c9c9b56a06
Refine denote-dired--filetype-heuristics
This guards against unailable front matter while trying to define what
Markdown flavour to use.
2022-07-25 09:16:19 +03:00
Protesilaos Stavrou ca62b258ce
Remove confusing phrase in doc string 2022-07-25 06:47:21 +03:00
Protesilaos Stavrou b5948bac04
Clarify denote-dired--add-front-matter doc string 2022-07-25 05:37:35 +03:00
Protesilaos Stavrou 60ec95f803
Let denote-dired-rename-marked-files rewrite keywords
This is only done if appropriate, i.e. if the underlying file is a
Denote note.
2022-07-25 05:24:37 +03:00
Protesilaos Stavrou 017b9d0f85
Clarify doc string 2022-07-25 05:23:48 +03:00
Protesilaos Stavrou 2080309cd7
Refine denote-dired--rewrite-front-matter
Remove unused code and make it work with narrowed buffers.
2022-07-25 05:11:35 +03:00
Protesilaos Stavrou f525bbd8fa
Update Acknowledgements for commit d3a537d
The change is below the ~15 line threshold and thus does not require
copyright assignment to the Free Software Foundation.
2022-07-25 04:46:30 +03:00
Protesilaos Stavrou 19c4fa8b09
Merge pull request #64 from pprevos/main
Regex to allow for non-ASCII characters in title and tags
2022-07-25 04:43:29 +03:00
Protesilaos Stavrou 47073aa2a0
Re-implement commit 36440d7
Sorry for the noise...  The previous code was incomplete.
2022-07-25 04:39:14 +03:00
Peter Prevos 0b69904020
Merge branch 'protesilaos:main' into main 2022-07-25 11:37:04 +10:00
Peter Prevos d3a537d065 Regex to allow for non-ASCII characters in title and tags 2022-07-25 11:32:48 +10:00
Protesilaos Stavrou b745cae875
Revert "Refine front matter rewrite"
This reverts commit 36440d7b7d.
2022-07-25 04:26:38 +03:00
Protesilaos Stavrou 36440d7b7d
Refine front matter rewrite
This should avoid false positives by anchoring the search at the
relevant front matter key.

The code is broken into smaller parts for easier hacking.

This change should address the bug with false positives reported by
hpgisler in issue 63 on the GitHub mirror:
<https://github.com/protesilaos/denote/issues/63>.
2022-07-25 03:50:17 +03:00
Protesilaos Stavrou 71b2216912
Use seq instead of cl-lib
We are already 'require'ing seq, so we might as well use it in the few
cases where we now call functionality from cl-lib.

Thanks to Philip Kaludercic for pointing this out on the emacs-devel
mailing list: <https://lists.gnu.org/archive/html/emacs-devel/2022-07/msg00838.html>.
2022-07-24 19:31:45 +03:00
Protesilaos Stavrou 5ab937f1da
Require 'subr-x' at compile time
This is to be sure that Emacs 28 evaluates 'when-let*'.  Otherwise we
will end up with errors such as the one reported by hpgisler in issue 62
on the GitHub mirror: <https://github.com/protesilaos/denote/issues/62>.
2022-07-24 18:16:42 +03:00
Protesilaos Stavrou 61e672f492
Replace needless 'when-let*' with 'when-let'
This should address the bug reported by hpgisler in issue 62 on the
GitHub mirror: <https://github.com/protesilaos/denote/issues/62>.
2022-07-24 17:54:29 +03:00
Protesilaos Stavrou d3fae65b78
Update the manual's Acknowledgements for 5d245df 2022-07-24 15:21:00 +03:00
Protesilaos Stavrou 5d245dfca6
Fix regexp to read non-ascii characters
There were two simultaneous threads about this issue:

1. On the mailing list with Frank Ehmsen and Peter Prevos:
   <https://lists.sr.ht/~protesilaos/denote/%3C2273b3b1-344c-6c6e-3ab6-a227b6bc3721%40eh-is.de%3E>.

2. On the GitHub mirror with user hpgisler:
   <https://github.com/protesilaos/denote/issues/61>.

This also relates to issue 57 on the GitHub mirror, with the
participation of pRotOta1p:
<https://github.com/protesilaos/denote/issues/57>.

Thanks to everyone involved!
2022-07-24 15:15:58 +03:00
Protesilaos Stavrou 8381abcfe5
Update docs about new front matter rewrite behaviour 2022-07-24 07:34:10 +03:00
Protesilaos Stavrou 4ebd1e9278
REFACTOR post-rename front matter rewrite
It should now update only the title and keywords, without erasing the
whole block and replacing it with a new one.

The old method involved (i) duplication of code and (ii) would overwrite
custom front matter that the user would maintain in their file.

The new method should be technically better as well as address the
latter problem.

Thanks to Peter Prevos for the feedback in issue 60 over at the GitHub
mirror: <https://github.com/protesilaos/denote/issues/60>.
2022-07-24 01:55:30 +03:00
Protesilaos Stavrou 00feb6cac6
Add helpers for keyword retrieval in front matter 2022-07-24 01:53:34 +03:00
Protesilaos Stavrou 4175ae2214
Tweak internal use of toml symbol for consistency 2022-07-24 01:12:44 +03:00
Protesilaos Stavrou ba6c6206ef
Capitalise argument to placate the compiler 2022-07-23 22:38:38 +03:00
Kyle Meyer b25d6a9a08
Fix quote protection in doc strings
A few doc strings put \\ in front of a single quote, but that doesn't
protect the quote from being processed according to
text-quoting-style.  Use \\= instead to ensure that the apostrophe is
rendered as is.
2022-07-23 22:37:44 +03:00
Protesilaos Stavrou 8f3b20471c
Update Acknowledgements for commit d58072a
Thanks to Kyle Meyer for the patch which was sent to the mailing list:
<https://lists.sr.ht/~protesilaos/denote/%3C20220723191243.9521-1-kyle@kyleam.com%3E>.
2022-07-23 22:20:44 +03:00
Kyle Meyer d58072a4c7
Fix variable name typo in denote-prompts doc string 2022-07-23 22:19:59 +03:00
Protesilaos Stavrou 75531ca904
Fix regression in denote-type
It would not use the correct file type extension for the file path, even
though the correct front matter was picked.

The regression was caused by the refactoring in commit a80ffc1.  For a
discussion, see pull request 55 on the GitHub mirror:
<https://github.com/protesilaos/denote/pull/55>.
2022-07-23 15:46:42 +03:00
Protesilaos Stavrou 95ffbe49cd
Update sample configuration 2022-07-21 16:38:52 +03:00
Protesilaos Stavrou 7af5123d0d
Rewrite all documentation about renaming files
Bring everything up to date and clarify relevant points.

NOTE that I kept the symbol 'denote-dired-rename-file' instead of
replacing it with 'denote-dired-rename-file-and-rewrite-front-matter'.
The obsoletion was done in pull request 51 over at the GitHub mirror but
I found the longer name harder to differentiate from the command
'denote-dired-rename-file-and-add-front-matter' (which is appropriately
named): <https://github.com/protesilaos/denote/pull/51>.
2022-07-21 16:35:51 +03:00
Protesilaos Stavrou d2bde54794
Add subsections to section on renaming 2022-07-21 15:26:21 +03:00
Protesilaos Stavrou dc84ed95e2
Rewrite section about links
* Add subsections to make it easier to find information.
* Document 'denote-link-dired-marked-notes'.
* Clarify that links are only to what we count as "notes".
2022-07-21 15:20:04 +03:00
Protesilaos Stavrou 510b943380
Tweak denote-link-dired-marked-notes doc string 2022-07-21 15:19:28 +03:00
Protesilaos Stavrou 5effd954fe
Make denote-link-dired-marked-notes robust 2022-07-21 14:56:59 +03:00
Protesilaos Stavrou f6a1276b4c
Fix error of date parsing in Emacs 28
The idea is to turn 2020-01-15 into 2020-01-15 16:19 so that the hour
and minute component is not left to 00:00.

This reduces the burden on the user who would otherwise need to input
that value in order to avoid the error of duplicate identifiers.

It also addresses a difference between Emacs 28 and Emacs 29 where the
former does not read dates without a time component.

Thanks to Peter Prevos for the feedback in issue 58 over at the GitHub
mirror: <https://github.com/protesilaos/denote/issues/58>.
2022-07-21 13:52:48 +03:00
Protesilaos Stavrou a170c81073
Document batch-renaming commands 2022-07-21 10:04:55 +03:00
Protesilaos Stavrou 95d0b8b1e5
Remove obsolete denote-dired-post-rename-functions 2022-07-21 09:45:34 +03:00
Protesilaos Stavrou a8b6af8978
Document buttonisation command 2022-07-21 09:20:24 +03:00
Protesilaos Stavrou d853429319
Add prototype to link to Dired marked notes 2022-07-21 09:18:41 +03:00
Protesilaos Stavrou b5bacbe180
Make denote-link-buttonize-buffer interactive
The user might want to use it that way.
2022-07-21 09:11:15 +03:00
Protesilaos Stavrou dae5fa1674
Clarify point about attachments to files 2022-07-20 09:37:28 +03:00
Protesilaos Stavrou fb534987ce
Add variable to extend "illegal" punctuation
This is to allow users to omit non-ascii characters from file names.

Thanks to pRot0ta1p for the feedback in issue 57 over at the GitHub
mirror: <https://github.com/protesilaos/denote/issues/57>.

Example based on the input of pRot0ta1p:

    (setq denote-punctuation-excluded-extra-regexp
          "[『』〖〗{}「」【】〔〕[]()《》〈〉«»!#¥%…&"'*,。;:、?—]*")
2022-07-20 07:16:32 +03:00
Protesilaos Stavrou 1524175e80
Reword denote--punctuation-regexp doc string 2022-07-20 07:16:09 +03:00
Protesilaos Stavrou a0f370d575
Add generic README.md for git forges
Neither SourceHut nor GitHub/GitLab are compliant with the Org markup.
SourceHut will not render the file at all, while the others render it
but do not parse it properly.
2022-07-19 08:46:01 +03:00
Protesilaos Stavrou b67a942a66
Reduce sample history-length
It was too high.
2022-07-18 21:18:03 +03:00
Protesilaos Stavrou 680dbdf6b2
Merge pull request #55 from jeanphilippegg/denote--prepare-notes
Refactor denote--prepare-notes and other modifications
2022-07-18 08:13:41 +03:00
Jean-Philippe Gagné Guay f4fae528c3 Return only Denote files in denote--buffer-file-names 2022-07-18 01:03:37 -04:00
Jean-Philippe Gagné Guay c5bba5fef1 Fix denote with subdirectories 2022-07-18 00:52:13 -04:00
Jean-Philippe Gagné Guay 0cddca8735 Remove no-check-current parameter from denote--directory-files-matching-regexp 2022-07-18 00:08:00 -04:00
Jean-Philippe Gagné Guay 6438bc7965 Check buffer file names in denote--id-exists-p
Add function denote--buffer-file-names
2022-07-17 21:57:28 -04:00
Jean-Philippe Gagné Guay 1d89fa0d33 Use string-prefix-p in denote--dir-in-denote-directory-p 2022-07-17 21:57:28 -04:00
Jean-Philippe Gagné Guay a80ffc1425 Rework denote--prepare-note 2022-07-17 21:57:28 -04:00
Protesilaos Stavrou c9a01a3718
Merge pull request #53 from jeanphilippegg/renaming-commands
Renaming commands, minor adjustments
2022-07-17 19:27:29 +03:00
Jean-Philippe Gagné Guay 5ca1882ce8 Rename denote-dired-rename-marked-files-and-add-front-matters 2022-07-17 12:20:03 -04:00
Jean-Philippe Gagné Guay 440231be75 Check that note has a Denote file type in denote-dired--add-front-matter 2022-07-17 12:18:44 -04:00
Protesilaos Stavrou befa6d9954
Update doc string of batch rename+redescribe 2022-07-17 11:40:34 +03:00
Protesilaos Stavrou de4b975d64
Check note in batch rename + front matter insert
Extends commit 8a194fb.
2022-07-17 11:37:31 +03:00
Protesilaos Stavrou 8a194bf07f
Add denote-dired-rename-marked-files-and-add-front-matter 2022-07-17 11:34:22 +03:00
Protesilaos Stavrou dc0b9dc8bb
Merge pull request #52 from jeanphilippegg/renaming-commands
Renaming commands, minor adjustments
2022-07-17 10:45:24 +03:00
Jean-Philippe Gagné Guay 1754fd3359 Use denote-dired--rename-buffer in denote-dired-rename-marked-files 2022-07-17 02:57:09 -04:00
Jean-Philippe Gagné Guay 143d902c17 Move denote-dired-update-dired-buffers out of denote-dired--rename-file 2022-07-17 02:56:38 -04:00
Protesilaos Stavrou 798b595220
Merge pull request #51 from jeanphilippegg/renaming-functions
Renaming functions
2022-07-17 09:26:04 +03:00
Jean-Philippe Gagné Guay 3df00e3758 Merge remote-tracking branch 'origin/main' into renaming-functions 2022-07-17 02:14:17 -04:00
Jean-Philippe Gagné Guay 24a0037d40 denote-retrieve--search only works on Denote file types 2022-07-17 01:55:55 -04:00
Jean-Philippe Gagné Guay 06bcd2d61b Mark denote-dired-rename-file and denote-dired-convert-file-to-denote obsolete 2022-07-17 00:49:03 -04:00
Jean-Philippe Gagné Guay 018f2d5618 Make denote-dired-post-rename-functions obsolete 2022-07-17 00:47:15 -04:00
Jean-Philippe Gagné Guay f35aefbc2f Remove condition in denote-dired-rename-marked-files 2022-07-17 00:19:28 -04:00
Jean-Philippe Gagné Guay 320c687791
Fix prompt placement in denote-dired-batch-rename 2022-07-17 07:06:10 +03:00
Jean-Philippe Gagné Guay 62a6e6e2ea Update docstring of denote-dired-rename-file-and-add-front-matter 2022-07-16 21:06:07 -04:00
Jean-Philippe Gagné Guay 0844cfb98a Rework denote-dired-rename-marked-files 2022-07-16 20:53:11 -04:00
Jean-Philippe Gagné Guay d823de7e82 Add denote-dired-rename-file alias 2022-07-16 20:36:18 -04:00
Jean-Philippe Gagné Guay 9fcd37911e Refactor renaming commands
- Rename denote-dired-rename-file to
denote-dired-rename-file-and-rewrite-front-matter
- Rename denote-dired-convert-file-to-denote to
denote-dired-rename-file-and-add-front-matter
- Rename denote-dired-batch-rename to denote-dired-rename-marked-files
- Rename denote-dired-rewrite-front-matter to
denote-dired--rewrite-front-matter
- Add denote-dired--add-front-matter
2022-07-16 20:36:18 -04:00
Jean-Philippe Gagné Guay 171270d901 Update dired buffers in subdirectories 2022-07-16 20:36:18 -04:00
Jean-Philippe Gagné Guay fb579e902d Remove unused arguments of denote-dired-update-dired-buffers 2022-07-16 20:36:18 -04:00
Jean-Philippe Gagné Guay 4f65a2d673 Remove option denote-dired-post-rename-functions 2022-07-16 20:36:18 -04:00
Jean-Philippe Gagné Guay a0c2289645 Remove denote-dired--rename-file-is-regular-p 2022-07-16 20:36:18 -04:00
Protesilaos Stavrou ee53a100f8
Ensure that 'denote' doesn't create dir via Lisp
This is another attempt at a change I made earlier today but reverted
soon thereafter (commit 75d63e, reverted by f279395).  The previous
implementation would break the interactive usage of 'denote'.
2022-07-16 23:19:48 +03:00
Protesilaos Stavrou c654d2922a
Bind keywords with let in batch rename
This was it produces the user-error outright if there are no marked
files.  Before, the prompt would come too early.
2022-07-16 19:53:16 +03:00
Protesilaos Stavrou 26967d78a4
Clarify denote-dired-batch-rename doc string 2022-07-16 19:40:40 +03:00
Protesilaos Stavrou 348b7290a9
Ignore notes in batch rename (WIP) 2022-07-16 19:37:22 +03:00
Protesilaos Stavrou b5d1d681b2
Clarify denote-dired-batch-rename doc string (WIP)
Extends commit 28fe1ac.
2022-07-16 17:58:22 +03:00
Protesilaos Stavrou 28fe1ac6ed
Add batch-renaming facility (WORK-IN-PROGRESS) 2022-07-16 17:55:14 +03:00
Protesilaos Stavrou f2793954fd
Revert commit 75d63e5
It needs to be done differently, as this breaks things.
2022-07-16 12:55:13 +03:00
Protesilaos Stavrou d42aa0f608
Clarify point on org-capture template constraint 2022-07-16 10:15:15 +03:00
Protesilaos Stavrou fbd223dfe8
Follow-up on commit 86b9022 for denote-org-capture 2022-07-16 10:13:03 +03:00
Protesilaos Stavrou 86b90227ed
Tweak denote-org-capture doc string 2022-07-16 10:11:43 +03:00
Protesilaos Stavrou 75d63e54e2
Ensure that 'denote' doesn't create dir via Lisp 2022-07-16 10:08:28 +03:00
Protesilaos Stavrou 6502817682
Make denote-link-find-file work with plain links 2022-07-16 09:57:43 +03:00
Protesilaos Stavrou 511989a047
Fix reference to crm-separator in the manual
David Wilson (System Crafters channel) spotted the error on the latest
live stream whose main topic was about Denote (thanks, by the way!):
<https://www.youtube.com/watch?v=QcRY_rsX0yY>.
2022-07-16 09:56:09 +03:00
Protesilaos Stavrou 0ab480b628
Update Acknowledgements for commit 9cce186
Thanks to Taoufik for the contribution on pull request 50 on the GitHub
mirror: <https://github.com/protesilaos/denote/pull/50>.

The change is below the ~15 line threshold and thus requires no
copyright assignment to the Free Software Foundation.
2022-07-16 05:37:19 +03:00
Protesilaos Stavrou 0c5dab42e8
Merge pull request #50 from taoufik07/patch-1
Remove duplicate keywords
2022-07-16 05:35:56 +03:00
Taoufik 9cce186c4c
Remove duplicate keywords 2022-07-16 00:20:16 +00:00
Protesilaos Stavrou ed1d40a45b
Document denote-dired-convert-file-to-denote 2022-07-15 15:02:58 +03:00
Protesilaos Stavrou 1edd1faa0a
Clarify that FILE may be the one at point
Extends commit fd6b751.
2022-07-15 08:37:50 +03:00
Protesilaos Stavrou fd6b7511a6
Tweak denote-dired-convert-file-to-denote docstring 2022-07-15 08:34:50 +03:00
Protesilaos Stavrou b782d5116c
Add autoload to denote-dired-convert-file-to-denote 2022-07-15 08:29:47 +03:00
Protesilaos Stavrou 9229bda278
Merge pull request #49 from jeanphilippegg/denote-dired-convert-file-to-denote
Add denote-dired-convert-file-to-denote
2022-07-15 08:27:48 +03:00
Jean-Philippe Gagné Guay bb620cfe97 Add denote-dired-convert-file-to-denote
The function renames a file and adds a front matter.
2022-07-14 23:24:21 -04:00
Protesilaos Stavrou ff6be0890f
Refine how 'denote:' Org link is loaded
This should load the setup only after Org is made available.  Whereas
what we had before would throw an error if the user was not already
using Org.

Thanks to Abin Simon for reporting the problem and for showing how
Elfeed handles this issue.  This was done in issue 47 on the GitHub
mirror: <https://github.com/protesilaos/denote/issues/47>.
2022-07-14 05:57:45 +03:00
Protesilaos Stavrou 08fa8b2239
Update to version 0.3.1 to fix an error in the manual
Thanks to Sven Seebeck for reporting the error on the TMR mailing list:
<https://lists.sr.ht/~protesilaos/tmr/%3C7d36f705-9afd-67a1-33d5-7fe86d29a12b@svenseebeck.me%3E>.
2022-07-12 08:17:22 +03:00
11 changed files with 20158 additions and 2535 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.

29
README.md Normal file
View file

@ -0,0 +1,29 @@
# 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
about, without reference to any other metadata. Denote basically
streamlines the creation of such files while providing facilities to
link between them.
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>
+ Change log: <https://protesilaos.com/emacs/denote-changelog>
+ 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.

6665
README.org

File diff suppressed because it is too large Load diff

View file

@ -1,388 +0,0 @@
;;; denote-dired.el --- Integration between Denote and Dired -*- lexical-binding: t -*-
;; Copyright (C) 2022 Free Software Foundation, Inc.
;; Author: Protesilaos Stavrou <info@protesilaos.com>
;; Maintainer: Denote Development <~protesilaos/denote@lists.sr.ht>
;; URL: https://git.sr.ht/~protesilaos/denote
;; Mailing-List: https://lists.sr.ht/~protesilaos/denote
;; Version: 0.3.0
;; Package-Requires: ((emacs "27.2"))
;; 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:
;;
;; Denote's file-naming scheme is not specific to notes or text files:
;; it is useful for all sorts of files, such as multimedia and PDFs that
;; form part of the user's longer-term storage (read manual's "The
;; file-naming scheme"). While Denote does not manage such files, it
;; already has all the mechanisms to facilitate the task of renaming
;; them.
;;
;; To this end, we provide the `denote-dired-rename-file' command. It
;; has a two-fold purpose: (i) to change the name of an existing file
;; while retaining its identifier and (ii) to write a Denote-compliant
;; file name for an item that was not created by `denote' or related
;; commands (such as an image or PDF).
;;
;; The `denote-dired-rename-file' command will target the file at point
;; if it finds one in the current Dired buffer. Otherwise it prompts
;; with minibuffer completion for a file name. It then uses the
;; familiar prompts for a `TITLE' and `KEYWORDS' the same way the
;; `denote' command does (read manual's "Points of entry). As a final
;; step, it asks for confirmation before renaming the file at point,
;; showing a message like:
;;
;; Rename sample.pdf to 20220612T052900--my-sample-title__testing.pdf? (y or n)
;;
;; However, if the user option `denote-dired-rename-expert' is non-nil,
;; conduct the renaming operation outright---no questions asked.
;;
;; When operating on a file that has no identifier, such as
;; `sample.pdf', Denote reads the file properties to retrieve its last
;; modification time. If the file was from a past date like 2000-11-31
;; it will get an identifier starting with `20001131' followed by the
;; time component (per our file-naming scheme).
;;
;; The file type extension (e.g. `.pdf') is read from the underlying
;; file and is preserved through the renaming process. Files that have
;; no extension are simply left without one.
;;
;; Renaming only occurs relative to the current directory. Files are not
;; moved between directories.
;;
;; The final step of the `denote-dired-rename-file' command is to call
;; the special hook `denote-dired-post-rename-functions'. Functions
;; added to that hook must accept three arguments, as explained in its
;; doc string. For the time being, the only function we define is the
;; one which updates the underlying note's front matter to match the new
;; file name: `denote-dired-rewrite-front-matter'. The function takes
;; care to only operate on an actual note, instead of arbitrary files.
;;
;; DEVELOPMENT NOTE: the `denote-dired-rewrite-front-matter' needs to be
;; tested thoroughly. It rewrites file contents so we have to be sure
;; it does the right thing. To avoid any trouble, it always asks for
;; confirmation before performing the replacement. This confirmation
;; ignores `denote-dired-rename-expert' for the time being, though we
;; might want to lift that restriction once everything works as
;; intended.
;;
;;
;; One of the upsides of Denote's file-naming scheme is the predictable
;; pattern it establishes, which appears as a near-tabular presentation in
;; a listing of notes (i.e. in Dired). The `denote-dired-mode' can help
;; enhance this impression, by fontifying the components of the file name
;; to make the date (identifier) and keywords stand out.
;;
;; There are two ways to set the mode. Either use it for all directories,
;; which probably is not needed:
;;
;; (require 'denote-dired)
;; (add-hook 'dired-mode-hook #'denote-dired-mode)
;;
;; Or configure the user option `denote-dired-directories' and then set up
;; the function `denote-dired-mode-in-directories':
;;
;; (require 'denote-dired)
;;
;; ;; We use different ways to specify a path for demo purposes.
;; (setq denote-dired-directories
;; (list denote-directory
;; (thread-last denote-directory (expand-file-name "attachments"))
;; (expand-file-name "~/Documents/vlog")))
;;
;; (add-hook 'dired-mode-hook #'denote-dired-mode-in-directories)
;;
;; The `denote-dired-mode' does not only fontify note files that were
;; created by Denote: it covers every file name that follows our naming
;; conventions (read about "The file-naming scheme" in the manual).
;; This is particularly useful for scenaria where, say, one wants to
;; organise their collection of PDFs and multimedia in a systematic way
;; (and, perhaps, use them as attachments for the notes Denote
;; produces).
;;
;; For the time being, the `diredfl' package is not compatible with this
;; facility.
;;; Code:
(require 'denote-retrieve)
(require 'dired)
(defgroup denote-dired ()
"Integration between Denote and Dired."
:group 'denote)
(defcustom denote-dired-directories
;; We use different ways to specify a path for demo purposes.
(list denote-directory
;; (thread-last denote-directory (expand-file-name "attachments"))
(expand-file-name "~/Documents/vlog"))
"List of directories where `denote-dired-mode' should apply to."
:type '(repeat directory)
:group 'denote-dired)
(defcustom denote-dired-rename-expert nil
"If t, `denote-dired-rename-file' doesn't ask for confirmation.
The confiration is asked via a `y-or-n-p' prompt which shows the
old name followed by the new one."
:type 'boolean
:group 'denote-dired)
(defcustom denote-dired-post-rename-functions
(list #'denote-dired-update-dired-buffers
#'denote-dired-rewrite-front-matter)
"List of functions called after `denote-dired-rename-file'.
Each function must accept three arguments: FILE, TITLE, and
KEYWORDS. The first is the full path to the file provided as a
string, the second is the human-readable file name (not what
Denote sluggifies) also as a string, and the third are the
keywords. If there is only one keyword, it is a string, else a
list of strings.
DEVELOPMENT NOTE: the `denote-dired-rewrite-front-matter' needs
to be tested thoroughly. It rewrites file contents so we have to
be sure it does the right thing. To avoid any trouble, it always
asks for confirmation before performing the replacement. This
confirmation ignores `denote-dired-rename-expert' for the time
being, though we might want to lift that restriction once
everything works as intended."
:type 'hook
:group 'denote-dired)
;;;; Commands
(defun denote-dired--file-attributes-time (file)
"Return `file-attribute-modification-time' of FILE as identifier."
(format-time-string
denote--id-format
(file-attribute-modification-time (file-attributes file))))
(defun denote-dired--file-name-id (file)
"Return FILE identifier, else generate one."
(cond
((string-match denote--id-regexp file)
(substring file (match-beginning 0) (match-end 0)))
((denote-dired--file-attributes-time file))
(t (format-time-string denote--id-format))))
(defun denote-dired--rename-buffer (old-name new-name)
"Rename OLD-NAME buffer to NEW-NAME, when appropriate."
(when-let* ((buffer (find-buffer-visiting old-name)))
(with-current-buffer buffer
(set-visited-file-name new-name nil t))))
(defun denote-dired--rename-dired-file-or-prompt ()
"Return Dired file at point, else prompt for one."
(or (dired-get-filename nil t)
(let* ((file (buffer-file-name))
(format (if file
(format "Rename file Denote-style [%s]: " file)
"Rename file Denote-style: ")))
(read-file-name format nil file t nil))))
(defun denote-dired--rename-file-is-regular (file)
"Throw error is FILE is not regular, else return FILE."
(if (or (file-directory-p file)
(not (file-regular-p file)))
(user-error "Only rename regular files")
file))
;;;###autoload
(defun denote-dired-rename-file (file title keywords)
"Rename FILE to include TITLE and KEYWORDS.
If in Dired, consider FILE to be the one at point, else prompt
with completion.
If FILE has a Denote-compliant identifier, retain it while
updating the TITLE and KEYWORDS fields of the file name. Else
create an identifier based on the file's attribute of last
modification time. If such attribute cannot be found, the
identifier falls back to the current time.
As a final step, prompt for confirmation, showing the difference
between old and new file names. If `denote-dired-rename-expert'
is non-nil, conduct the renaming operation outright---no
questions asked!
The file type extension (e.g. .pdf) is read from the underlying
file and is preserved through the renaming process. Files that
have no extension are simply left without one.
Renaming only occurs relative to the current directory. Files
are not moved between directories. As a final step, call the
`denote-dired-post-rename-functions'.
This command is intended to (i) rename existing Denote
notes, (ii) complement note-taking, such as by renaming
attachments that the user adds to their notes."
(interactive
(let ((file (denote-dired--rename-file-is-regular (denote-dired--rename-dired-file-or-prompt))))
(list
file
(denote--title-prompt (denote-retrieve--value-title file))
(denote--keywords-prompt))))
(let* ((dir (file-name-directory file))
(old-name (file-name-nondirectory file))
(extension (file-name-extension file t))
(new-name (denote--format-file
dir
(denote-dired--file-name-id file)
keywords
(denote--sluggify title)
extension))
(max-mini-window-height 0.33)) ; allow minibuffer to be resized
(unless (string= old-name (file-name-nondirectory new-name))
(when (y-or-n-p
(format "Rename %s to %s?"
(propertize old-name 'face 'error)
(propertize (file-name-nondirectory new-name) 'face 'success)))
(rename-file old-name new-name nil)
(denote-dired--rename-buffer old-name new-name)
(run-hook-with-args 'denote-dired-post-rename-functions new-name title keywords)))))
(defun denote-dired-update-dired-buffers (&rest _)
"Update Dired buffers of variable `denote-directory'.
Can run after `denote-dired-post-rename-functions', though it
ignores all its arguments."
(mapc
(lambda (buf)
(with-current-buffer buf
(when (and (eq major-mode 'dired-mode)
(string-match-p (expand-file-name default-directory)
(expand-file-name (denote-directory))))
(revert-buffer))))
(buffer-list)))
(defun denote-dired--file-meta-header (title date keywords id filetype)
"Front matter for renamed notes.
TITLE, DATE, KEYWORDS, FILENAME, ID, and FILETYPE are all strings
which are provided by `denote-dired-rewrite-front-matter'."
(let ((kw-space (denote--file-meta-keywords keywords))
(kw-toml (denote--file-meta-keywords keywords 'toml)))
(pcase filetype
('markdown-toml (format denote-toml-front-matter title date kw-toml id))
('markdown-yaml (format denote-yaml-front-matter title date kw-space id))
('text (format denote-text-front-matter title date kw-space id denote-text-front-matter-delimiter))
(_ (format denote-org-front-matter title date kw-space id)))))
(defun denote-dired--filetype-heuristics (file)
"Return likely file type of FILE.
The return value is for `denote--file-meta-header'."
(pcase (file-name-extension file)
("md" (if (string-match-p "title\\s-*=" (denote-retrieve--value-title file t))
'markdown-toml
'markdown-yaml))
("txt" 'text)
(_ 'org)))
(defun denote-dired--front-matter-search-delimiter (filetype)
"Return likely front matter delimiter search for FILETYPE."
(pcase filetype
('markdown-toml (re-search-forward "^\\+\\+\\+$" nil t 2))
('markdown-yaml (re-search-forward "^---$" nil t 2))
;; 2 at most, as the user might prepend it to the block as well.
;; Though this might give us false positives, it ultimately is the
;; user's fault.
('text (or (re-search-forward denote-text-front-matter-delimiter nil t 2)
(re-search-forward denote-text-front-matter-delimiter nil t 1)
(re-search-forward "^[\s\t]*$" nil t 1)))
;; Org does not have a real delimiter. This is the trickiest one.
(_ (re-search-forward "^[\s\t]*$" nil t 1))))
(defun denote-dired--edit-front-matter-p (file)
"Test if FILE should be subject to front matter rewrite.
This is relevant for `denote-dired-rewrite-front-matter': if FILE
has no front matter, then we abort early instead of trying to
replace what isn't there."
(when-let ((ext (file-name-extension file)))
(and (file-regular-p file)
(file-writable-p file)
(not (denote--file-empty-p file))
(string-match-p "\\(md\\|org\\|txt\\)\\'" ext)
;; Heuristic to check if this is one of our notes
(string= (expand-file-name default-directory) (denote-directory)))))
(defun denote-dired-rewrite-front-matter (file title keywords)
"Rewrite front matter of note after `denote-dired-rename-file'.
The FILE, TITLE, and KEYWORDS are passed from the renaming
command and are used to construct a new front matter block if
appropriate."
(when-let* ((denote-dired--edit-front-matter-p file)
(id (denote-retrieve--filename-identifier file))
(date (denote-retrieve--value-date file))
(filetype (denote-dired--filetype-heuristics file))
(new-front-matter (denote--file-meta-header title date keywords id filetype)))
(let (old-front-matter front-matter-delimiter)
(with-current-buffer (find-file-noselect file)
(save-excursion
(save-restriction
(widen)
(goto-char (point-min))
(setq front-matter-delimiter (denote-dired--front-matter-search-delimiter filetype))
(when front-matter-delimiter
(setq old-front-matter
(buffer-substring-no-properties
(point-min)
(progn front-matter-delimiter (point)))))))
(when (and old-front-matter
(y-or-n-p
(format "%s\n%s\nReplace front matter?"
(propertize old-front-matter 'face 'error)
(propertize new-front-matter 'face 'success))))
(delete-region (point-min) front-matter-delimiter)
(goto-char (point-min))
(insert new-front-matter)
;; FIXME 2022-06-16: Instead of `delete-blank-lines', we
;; should check if we added any new lines and delete only
;; those.
(delete-blank-lines))))))
;;;; Extra fontification
(require 'denote-faces)
;;;###autoload
(define-minor-mode denote-dired-mode
"Fontify all Denote-style file names in Dired."
:global nil
:group 'denote-dired
(if denote-dired-mode
(font-lock-add-keywords nil denote-faces-file-name-keywords t)
(font-lock-remove-keywords nil denote-faces-file-name-keywords))
(font-lock-flush (point-min) (point-max)))
(defun denote-dired--modes-dirs-as-dirs ()
"Return `denote-dired-directories' as directories.
The intent is to basically make sure that however a path is
written, it is always returned as a directory."
(mapcar
(lambda (dir)
(file-name-as-directory (file-truename dir)))
denote-dired-directories))
;;;###autoload
(defun denote-dired-mode-in-directories ()
"Enable `denote-dired-mode' in `denote-dired-directories'.
Add this function to `dired-mode-hook'."
(when (member (file-truename default-directory) (denote-dired--modes-dirs-as-dirs))
(denote-dired-mode 1)))
(provide 'denote-dired)
;;; denote-dired.el ends here

View file

@ -1,121 +0,0 @@
;;; denote-faces.el --- Faces and fontification rules for Denote -*- lexical-binding: t -*-
;; Copyright (C) 2022 Free Software Foundation, Inc.
;; Author: Protesilaos Stavrou <info@protesilaos.com>
;; Maintainer: Denote Development <~protesilaos/denote@lists.sr.ht>
;; URL: https://git.sr.ht/~protesilaos/denote
;; Mailing-List: https://lists.sr.ht/~protesilaos/denote
;; Version: 0.3.0
;; Package-Requires: ((emacs "27.2"))
;; 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:
;;
;; Used internally by Denote to fontify file names in Dired, the
;; backlinks' buffer, and related.
;;; Code:
(require 'denote)
(defgroup denote-faces ()
"Faces for Denote."
:group 'denote)
(defface denote-faces-subdirectory
'((t :inherit bold))
"Face for subdirectory of file name.
This should only ever needed in the backlinks' buffer (or
equivalent), not in Dired."
:group 'denote-faces)
(defface denote-faces-date
'((t :inherit font-lock-variable-name-face))
"Face for file name date in Dired buffers.
This is the part of the identifier that covers the year, month,
and day."
:group 'denote-faces)
(defface denote-faces-time
'((t :inherit denote-faces-date))
"Face for file name time in Dired buffers.
This is the part of the identifier that covers the hours, minutes,
and seconds."
:group 'denote-faces)
(defface denote-faces-title
'((t ))
"Face for file name title in Dired buffers."
:group 'denote-faces)
(defface denote-faces-extension
'((t :inherit shadow))
"Face for file extension type in Dired buffers."
:group 'denote-faces)
(defface denote-faces-keywords
'((t :inherit font-lock-builtin-face))
"Face for file name keywords in Dired buffers."
:group 'denote-faces)
(defface denote-faces-delimiter
'((((class color) (min-colors 88) (background light))
:foreground "gray70")
(((class color) (min-colors 88) (background dark))
:foreground "gray30")
(t :inherit shadow))
"Face for file name delimiters in Dired buffers."
:group 'denote-faces)
(defvar denote-faces--file-name-regexp
(concat "\\(?1:[0-9]\\{8\\}\\)\\(?2:T[0-9]\\{6\\}\\)"
"\\(?:\\(?3:--\\)\\(?4:[0-9A-Za-z-]*\\)\\)?"
"\\(?:\\(?5:__\\)\\(?6:[0-9A-Za-z_-]*\\)\\)?"
"\\(?7:\\..*\\)?$")
"Regexp of file names for fontification.")
(defconst denote-faces-file-name-keywords
`((,(concat " " denote-faces--file-name-regexp)
(1 'denote-faces-date)
(2 'denote-faces-time)
(3 'denote-faces-delimiter nil t)
(4 'denote-faces-title nil t)
(5 'denote-faces-delimiter nil t)
(6 'denote-faces-keywords nil t)
(7 'denote-faces-extension nil t )))
"Keywords for fontification of file names.")
(define-obsolete-variable-alias
'denote-faces-file-name-with-subdir-keywords
'denote-faces-file-name-keywords-for-backlinks
"0.3.0")
(defconst denote-faces-file-name-keywords-for-backlinks
`((,(concat "^\\(?8:.*/\\)?" denote-faces--file-name-regexp)
(8 'denote-faces-subdirectory nil t)
(1 'denote-faces-date)
(2 'denote-faces-time)
(3 'denote-faces-delimiter nil t)
(4 'denote-faces-title nil t)
(5 'denote-faces-delimiter nil t)
(6 'denote-faces-keywords nil t)
(7 'denote-faces-extension nil t )))
"Keywords for fontification of file names in the backlinks buffer.")
(provide 'denote-faces)
;;; denote-faces.el ends here

View file

@ -1,556 +0,0 @@
;;; denote-link.el --- Link facility for Denote -*- lexical-binding: t -*-
;; Copyright (C) 2022 Free Software Foundation, Inc.
;; Author: Protesilaos Stavrou <info@protesilaos.com>
;; Maintainer: Denote Development <~protesilaos/denote@lists.sr.ht>
;; URL: https://git.sr.ht/~protesilaos/denote
;; Mailing-List: https://lists.sr.ht/~protesilaos/denote
;; Version: 0.3.0
;; Package-Requires: ((emacs "27.2"))
;; 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:
;;
;; The `denote-link' command inserts a link at point to an entry specified
;; at the minibuffer prompt. Links are formatted depending on the file
;; type of current note. In Org and plain text buffers, links are
;; formatted thus: `[[denote:IDENTIFIER][TITLE]]'. While in Markdown they
;; are expressed as `[TITLE](denote:IDENTIFIER)'.
;;
;; When `denote-link' is called with a prefix argument (`C-u' by default),
;; it formats links like `[[denote:IDENTIFIER]]'. The user might prefer
;; its simplicity.
;;
;; Inserted links are automatically buttonized and remain active for as
;; long as the buffer is available. In Org this is handled by the major
;; mode: the `denote:' hyperlink type works exactly like the standard
;; `file:'. In Markdown and plain text, Denote performs the buttonization
;; of those links. To buttonize links in existing files while visiting
;; them, the user must add this snippet to their setup (it already excludes
;; Org):
;;
;; (add-hook 'find-file-hook #'denote-link-buttonize-buffer)
;;
;; Denote has a major-mode-agnostic mechanism to collect all linked file
;; references in the current buffer and return them as an appropriately
;; formatted list. This list can then be used in interactive commands.
;; The `denote-link-find-file' is such a command. It uses minibuffer
;; completion to visit a file that is linked to from the current note.
;; The candidates have the correct metadata, which is ideal for
;; integration with other standards-compliant tools (see manual's
;; "Extending Denote"). For instance, a package such as `marginalia'
;; will display accurate annotations, while the `embark' package will be
;; able to work its magic such as in exporting the list into a filtered
;; Dired buffer (i.e. a familiar Dired listing with only the files of
;; the current minibuffer session).
;;
;; The command `denote-link-backlinks' produces a bespoke buffer which
;; displays the file name of all notes linking to the current one. Each
;; file name appears on its own line and is buttonized so that it performs
;; the action of visiting the referenced file. The backlinks' buffer looks
;; like this:
;;
;; Backlinks to "On being honest" (20220614T130812)
;; ------------------------------------------------
;;
;; 20220614T145606--let-this-glance-become-a-stare__journal.txt
;; 20220616T182958--not-feeling-butterflies-in-your-stomach__journal.txt
;;
;; The backlinks' buffer is fontified by default, though the user has
;; access to the `denote-link-fontify-backlinks' option to disable this
;; effect by setting its value to nil.
;;
;; The placement of the backlinks' buffer is subject to the user option
;; `denote-link-backlinks-display-buffer-action'. Due to the nature of the
;; underlying `display-buffer' mechanism, this inevitably is a relatively
;; advanced feature. By default, the backlinks' buffer is displayed below
;; the current window. The doc string of our user option includes a sample
;; configuration that places the buffer in a left side window instead.
;; Reproducing it here for the sake of convenience:
;;
;; (setq denote-link-backlinks-display-buffer-action
;; '((display-buffer-reuse-window
;; display-buffer-in-side-window)
;; (side . left)
;; (slot . 99)
;; (window-width . 0.3)))
;;
;; The command `denote-link-add-links' adds links at point matching a
;; regular expression or plain string. The links are inserted as a
;; typographic list, such as:
;;
;; - link1
;; - link2
;; - link3
;;
;; Each link is formatted according to the file type of the current note,
;; as explained further above about the `denote-link' command. The current
;; note is excluded from the matching entries (adding a link to itself is
;; pointless).
;;
;; When called with a prefix argument (`C-u') `denote-link-add-links' will
;; format all links as `[[denote:IDENTIFIER]]', hence a typographic list:
;;
;; - [[denote:IDENTIFIER-1]]
;; - [[denote:IDENTIFIER-2]]
;; - [[denote:IDENTIFIER-3]]
;;
;; Same examples of a regular expression that can be used with this
;; command:
;;
;; - `journal' match all files which include `journal' anywhere in their
;; name.
;;
;; - `_journal' match all files which include `journal' as a keyword.
;;
;; - `^2022.*_journal' match all file names starting with `2022' and
;; including the keyword `journal'.
;;
;; - `\.txt' match all files including `.txt'. In practical terms, this
;; only applies to the file extension, as Denote automatically removes
;; dots (and other characters) from the base file name.
;;
;; If files are created with `denote-sort-keywords' as non-nil (the
;; default), then it is easy to write a regexp that includes multiple
;; keywords in alphabetic order:
;;
;; - `_denote.*_package' match all files that include both the `denote' and
;; `package' keywords, in this order.
;;
;; - `\(.*denote.*package.*\)\|\(.*package.*denote.*\)' is the same as
;; above, but out-of-order.
;;
;; Remember that regexp constructs only need to be escaped once (like `\|')
;; when done interactively but twice when called from Lisp. What we show
;; above is for interactive usage.
;;
;; For convenience, the `denote-link' command has an alias called
;; `denote-link-insert-link'. The `denote-link-backlinks' can also be used
;; as `denote-link-show-backlinks-buffer'. While `denote-link-add-links'
;; is aliased `denote-link-insert-links-matching-regexp'. The purpose of
;; these aliases is to offer alternative, more descriptive names of select
;; commands.
;;; Code:
(require 'denote-retrieve)
(defgroup denote-link ()
"Link facility for Denote."
:group 'denote)
;;;; User options
(defcustom denote-link-fontify-backlinks t
"When non-nil, apply faces to files in the backlinks' buffer."
:type 'boolean
:group 'denote-link)
(defcustom denote-link-backlinks-display-buffer-action
'((display-buffer-reuse-window display-buffer-below-selected)
(window-height . fit-window-to-buffer))
"The action used to display the current file's backlinks buffer.
The value has the form (FUNCTION . ALIST), where FUNCTION is
either an \"action function\", a list thereof, or possibly an
empty list. ALIST is a list of \"action alist\" which may be
omitted (or be empty).
Sample configuration to display the buffer in a side window on
the left of the Emacs frame:
(setq denote-link-backlinks-display-buffer-action
(quote ((display-buffer-reuse-window
display-buffer-in-side-window)
(side . left)
(slot . 99)
(window-width . 0.3))))
See Info node `(elisp) Displaying Buffers' for more details
and/or the documentation string of `display-buffer'."
:type '(cons (choice (function :tag "Display Function")
(repeat :tag "Display Functions" function))
alist)
:group 'denote-link)
;;;; Link to note
;; Arguments are: FILE-ID FILE-TITLE
(defconst denote-link--format-org "[[denote:%s][%s]]"
"Format of Org link to note.")
(defconst denote-link--format-markdown "[%2$s](denote:%1$s)"
"Format of Markdown link to note.")
(defconst denote-link--format-id-only "[[denote:%s]]"
"Format of identifier-only link to note.")
(defconst denote-link--regexp-org
(concat "\\[\\[" "denote:" "\\(?1:" denote--id-regexp "\\)" "]" "\\[.*?]]"))
(defconst denote-link--regexp-markdown
(concat "\\[.*?]" "(denote:" "\\(?1:" denote--id-regexp "\\)" ")"))
(defconst denote-link--regexp-plain
(concat "\\[\\[" "denote:" "\\(?1:" denote--id-regexp "\\)" "]]"))
(defun denote-link--file-type-format (current-file id-only)
"Return link format based on CURRENT-FILE format.
With non-nil ID-ONLY, use the generic link format without a
title."
;; Includes backup files. Maybe we can remove them?
(let ((current-file-ext (file-name-extension current-file)))
(cond
(id-only denote-link--format-id-only)
((string= current-file-ext "md")
denote-link--format-markdown)
;; Plain text also uses [[denote:ID][TITLE]]
(t denote-link--format-org))))
(defun denote-link--file-type-regexp (file)
"Return link regexp based on FILE format."
(pcase (file-name-extension file)
("md" denote-link--regexp-markdown)
(_ denote-link--regexp-org)))
(defun denote-link--format-link (file pattern)
"Prepare link to FILE using PATTERN."
(let ((file-id (denote-retrieve--filename-identifier file))
(file-title (unless (string= pattern denote-link--format-id-only)
(denote-retrieve--value-title file))))
(format pattern file-id file-title)))
;;;###autoload
(defun denote-link (target &optional id-only)
"Create link to TARGET note in variable `denote-directory'.
With optional ID-ONLY, such as a universal prefix
argument (\\[universal-argument]), insert links with just the
identifier and no further description. In this case, the link
format is always [[denote:IDENTIFIER]]."
(interactive (list (denote-retrieve--read-file-prompt) current-prefix-arg))
(let ((beg (point)))
(insert
(denote-link--format-link
target
(denote-link--file-type-format (buffer-file-name) id-only)))
(unless (derived-mode-p 'org-mode)
(make-button beg (point) 'type 'denote-link-button))))
(defalias 'denote-link-insert-link (symbol-function 'denote-link))
(defun denote-link--collect-identifiers (regexp)
"Return collection of identifiers in buffer matching REGEXP."
(let (matches)
(save-excursion
(goto-char (point-min))
(while (re-search-forward regexp nil t)
(push (match-string-no-properties 1) matches)))
matches))
(defun denote-link--expand-identifiers (regexp)
"Expend identifiers matching REGEXP into file paths."
(let ((files (denote--directory-files))
(found-files))
(dolist (file files)
(dolist (i (denote-link--collect-identifiers regexp))
(when (string-prefix-p i (file-name-nondirectory file))
(push file found-files))))
found-files))
(defvar denote-link--find-file-history nil
"History for `denote-link-find-file'.")
(defun denote-link--find-file-prompt (files)
"Prompt for linked file among FILES."
(completing-read "Find linked file "
(denote--completion-table 'file files)
nil t
nil 'denote-link--find-file-history))
;; TODO 2022-06-14: Do we need to add any sort of extension to better
;; integrate with Embark? For the minibuffer interaction it is not
;; necessary, but maybe it can be done to immediately recognise the
;; identifiers are links to files?
;;;###autoload
(defun denote-link-find-file ()
"Use minibuffer completion to visit linked file."
(interactive)
(if-let* ((regexp (denote-link--file-type-regexp (buffer-file-name)))
(files (denote-link--expand-identifiers regexp)))
(find-file (denote-link--find-file-prompt files))
(user-error "No links found in the current buffer")))
;;;; Link buttons
;; Evaluate: (info "(elisp) Button Properties")
;;
;; Button can provide a help-echo function as well, but I think we might
;; not need it.
(define-button-type 'denote-link-button
'follow-link t
'action #'denote-link--find-file-at-button)
(autoload 'thing-at-point-looking-at "thingatpt")
(defun denote-link--link-at-point-string ()
"Return identifier at point."
(when (or (thing-at-point-looking-at denote-link--regexp-plain)
(thing-at-point-looking-at denote-link--regexp-markdown)
(thing-at-point-looking-at denote-link--regexp-org)
;; Meant to handle the case where a link is broken by
;; `fill-paragraph' into two lines, in which case it
;; buttonizes only the "denote:ID" part. Example:
;;
;; [[denote:20220619T175212][This is a
;; test]]
;;
;; Maybe there is a better way?
(thing-at-point-looking-at "\\[\\(denote:.*\\)]"))
(match-string-no-properties 0)))
(defun denote-link--id-from-string (string)
"Extract identifier from STRING."
(replace-regexp-in-string
(concat ".*denote:" "\\(" denote--id-regexp "\\)" ".*")
"\\1" string))
;; NOTE 2022-06-15: I add this as a variable for advanced users who may
;; prefer something else. If there is demand for it, we can make it a
;; defcustom, but I think it would be premature at this stage.
(defvar denote-link-buton-action #'find-file-other-window
"Action for Denote buttons.")
(defun denote-link--find-file-at-button (button)
"Visit file referenced by BUTTON."
(let* ((id (denote-link--id-from-string
(buffer-substring-no-properties
(button-start button)
(button-end button))))
(file (denote--get-note-path-by-id id)))
(funcall denote-link-buton-action file)))
;;;###autoload
(defun denote-link-buttonize-buffer (&optional beg end)
"Make denote: links actionable buttons in the current buffer.
Add this to `find-file-hook'. It will only work with Denote
notes and will not do anything in `org-mode' buffers, as buttons
already work there. If you do not use Markdown or plain text,
then you do not need this.
When called from Lisp, with optional BEG and END as buffer
positions, limit the process to the region in-between."
(when (and (not (derived-mode-p 'org-mode)) (denote--current-file-is-note-p))
(save-excursion
(goto-char (or beg (point-min)))
(while (re-search-forward denote--id-regexp end t)
(when-let ((string (denote-link--link-at-point-string))
(beg (match-beginning 0))
(end (match-end 0)))
(make-button beg end 'type 'denote-link-button))))))
;;;; Backlinks' buffer
(define-button-type 'denote-link-backlink-button
'follow-link t
'action #'denote-link--backlink-find-file
'face nil) ; we use this face though we style it later
(defun denote-link--backlink-find-file (button)
"Action for BUTTON to `find-file'."
(funcall denote-link-buton-action (buffer-substring (button-start button) (button-end button))))
(defun denote-link--display-buffer (buf)
"Run `display-buffer' on BUF.
Expand `denote-link-backlinks-display-buffer-action'."
(display-buffer
buf
`(,@denote-link-backlinks-display-buffer-action)))
(require 'denote-faces)
(defun denote-link--prepare-backlinks (id files &optional title)
"Create backlinks' buffer for ID including FILES.
Use optional TITLE for a prettier heading."
(let ((inhibit-read-only t)
(buf (format "*denote-backlinks to %s*" id)))
(with-current-buffer (get-buffer-create buf)
(erase-buffer)
(special-mode)
(goto-char (point-min))
(when-let* ((title)
(heading (format "Backlinks to %S (%s)" title id))
(l (length heading)))
(insert (format "%s\n%s\n\n" heading (make-string l ?-))))
(mapc (lambda (f)
(insert f)
(make-button (point-at-bol) (point-at-eol) :type 'denote-link-backlink-button)
(newline))
files)
(goto-char (point-min))
(when denote-link-fontify-backlinks
(font-lock-add-keywords nil denote-faces-file-name-keywords-for-backlinks t)))
(denote-link--display-buffer buf)))
;;;###autoload
(defun denote-link-backlinks ()
"Produce a buffer with files linking to current note.
Each file is a clickable/actionable button that visits the
referenced entry. Files are fontified if the user option
`denote-link-fontify-backlinks' is non-nil.
The placement of the backlinks' buffer is controlled by the user
option `denote-link-backlinks-display-buffer-action'. By
default, it will show up below the current window."
(interactive)
(let* ((default-directory (denote-directory))
(file (buffer-file-name))
(id (denote-retrieve--filename-identifier file))
(title (denote-retrieve--value-title file)))
(if-let ((files (denote-retrieve--proces-grep id)))
(denote-link--prepare-backlinks id files title)
(user-error "No links to the current note"))))
(defalias 'denote-link-show-backlinks-buffer (symbol-function 'denote-link-backlinks))
;;;; Add links matching regexp
(defvar denote-link--links-to-files nil
"String of `denote-link-add-links-matching-keyword'.")
(defvar denote-link--prepare-links-format "- %s\n"
"Format specifiers for `denote-link-add-links'.")
;; NOTE 2022-06-16: There is no need to overwhelm the user with options,
;; though I expect someone to want to change the sort order.
(defvar denote-link-add-links-sort nil
"Add REVERSE to `sort-lines' of `denote-link-add-links' when t.")
(defun denote-link--prepare-links (files current-file id-only)
"Prepare links to FILES from CURRENT-FILE.
When ID-ONLY is non-nil, use a generic link format. See
`denote-link--file-type-format'."
(setq denote-link--links-to-files
(with-temp-buffer
(mapc (lambda (file)
(insert
(format
denote-link--prepare-links-format
(denote-link--format-link
file
(denote-link--file-type-format current-file id-only)))))
files)
(sort-lines denote-link-add-links-sort (point-min) (point-max))
(buffer-string))))
(defvar denote-link--add-links-history nil
"Minibuffer history for `denote-link-add-links'.")
;;;###autoload
(defun denote-link-add-links (regexp &optional id-only)
"Insert links to all notes matching REGEXP.
Use this command to reference multiple files at once.
Particularly useful for the creation of metanotes (read the
manual for more on the matter).
Optional ID-ONLY has the same meaning as in `denote-link': it
inserts links with just the identifier."
(interactive
(list
(read-regexp "Insert links matching REGEX: " nil 'denote-link--add-links-history)
current-prefix-arg))
(let* ((default-directory (denote-directory))
(current-file (buffer-file-name)))
(if-let ((files (denote--directory-files-matching-regexp regexp)))
(let ((beg (point)))
(insert (denote-link--prepare-links files current-file id-only))
(unless (derived-mode-p 'org-mode)
(denote-link-buttonize-buffer beg (point))))
(user-error "No links matching `%s'" regexp))))
(defalias 'denote-link-insert-links-matching-regexp (symbol-function 'denote-link-add-links))
;;;; Register `denote:' custom Org hyperlink
(autoload 'org-link-set-parameters "ol.el")
(org-link-set-parameters
"denote"
:follow #'denote-link-ol-follow
:complete #'denote-link-ol-complete
:export #'denote-link-ol-export)
(declare-function org-link-open-as-file "ol" (path arg))
(defun denote-link--ol-resolve-link-to-target (link &optional path-id)
"Resolve LINK into the appropriate target.
With optional PATH-ID return a cons cell consisting of the path
and the identifier."
(let* ((search (and (string-match "::\\(.*\\)\\'" link)
(match-string 1 link)))
(id (if (and (stringp search) (not (string-empty-p search)))
(substring link 0 (match-beginning 0))
link))
(path (denote--get-note-path-by-id id)))
(cond
(path-id
(cons (format "%s" path) (format "%s" id)))
((and (stringp search) (not (string-empty-p search)))
(concat path "::" search))
(path))))
(defun denote-link-ol-follow (link)
"Find file of type `denote:' matching LINK.
LINK is the identifier of the note, optionally followed by a
search option akin to that of standard Org `file:' link types.
Read Info node `(org) Search Options'.
Uses the function `denote-directory' to establish the path to the
file."
(org-link-open-as-file
(denote-link--ol-resolve-link-to-target link)
nil))
(defun denote-link-ol-complete ()
"Like `denote-link' but for Org integration.
This lets the user complete a link through the `org-insert-link'
interface by first selecting the `denote:' hyperlink type."
(concat
"denote:"
(denote-retrieve--filename-identifier (denote-retrieve--read-file-prompt))))
(defun denote-link-ol-export (link description format)
"Export a `denote:' link from Org files.
The LINK, DESCRIPTION, and FORMAT are handled by the export
backend."
(let* ((path-id (denote-link--ol-resolve-link-to-target link :path-id))
(path (file-name-nondirectory (car path-id)))
(p (file-name-sans-extension path))
(id (cdr path-id))
(desc (or description (concat "denote:" id))))
(cond
((eq format 'html) (format "<a target=\"_blank\" href=\"%s.html\">%s</a>" p desc))
((eq format 'latex) (format "\\href{%s}{%s}" (replace-regexp-in-string "[\\{}$%&_#~^]" "\\\\\\&" path) desc))
((eq format 'texinfo) (format "@uref{%s,%s}" path desc))
((eq format 'ascii) (format "[%s] <denote:%s>" desc path)) ; NOTE 2022-06-16: May be tweaked further
((eq format 'md) (format "[%s](%s.md)" desc p))
(t path))))
(provide 'denote-link)
;;; denote-link.el ends here

View file

@ -1,106 +0,0 @@
;;; denote-org-capture.el --- Integration between Denote and org-capture -*- lexical-binding: t -*-
;; Copyright (C) 2022 Free Software Foundation, Inc.
;; Author: Protesilaos Stavrou <info@protesilaos.com>
;; Maintainer: Denote Development <~protesilaos/denote@lists.sr.ht>
;; URL: https://git.sr.ht/~protesilaos/denote
;; Mailing-List: https://lists.sr.ht/~protesilaos/denote
;; Version: 0.3.0
;; Package-Requires: ((emacs "27.2"))
;; 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:
;;
;; Denote integration with org-capture.
;;
;; Samples of an `org-capture-templates' entry:
;;
;; (setq org-capture-templates
;; '(("n" "New note (with denote.el)" plain
;; (file denote-last-path)
;; #'denote-org-capture
;; :no-save t
;; :immediate-finish nil
;; :kill-buffer t
;; :jump-to-captured t)))
;;
;; (with-eval-after-load 'org-capture
;; (add-to-list 'org-capture-templates
;; '("n" "New note (with denote.el)" plain
;; (file denote-last-path)
;; #'denote-org-capture
;; :no-save t
;; :immediate-finish nil
;; :kill-buffer t
;; :jump-to-captured t)))
;;
;; Note that `denote-org-capture' ignores the `denote-file-type': it
;; always sets the Org file extension for the created note to ensure
;; that the capture process works as intended, especially for the
;; desired output of the `denote-org-capture-specifiers'.
;;; Code:
(require 'denote)
(defgroup denote-org-capture ()
"Integration between Denote and Org Capture."
:group 'denote)
(defcustom denote-org-capture-specifiers "%l\n%i\n%?"
"String with format specifiers for `org-capture-templates'.
Check that variable's documentation for the details.
This string is appended to new notes in the `denote-org-capture'
function. Every new note has the standard front matter we
define."
:type 'string
:group 'denote-org-capture)
;;;###autoload
(defun denote-org-capture ()
"Create new note through `org-capture-templates'.
Use this as a function that returns the path to the new file.
The file is populated with Denote's front matter. It can then be
expanded with the usual specifiers or strings that
`org-capture-templates' supports.
Note that this function ignores the `denote-file-type': it always
sets the Org file extension for the created note to ensure that
the capture process works as intended, especially for the desired
output of the `denote-org-capture-specifiers'.
Consult the manual for template samples."
(let ((title (denote--title-prompt))
(keywords (denote--keywords-prompt))
(denote-file-type nil)) ; we enforce the .org extension for `org-capture'
(denote--path title keywords)
(denote--prepare-note denote-last-title denote-last-keywords denote-last-path)
(denote--keywords-add-to-history denote-last-keywords)
(concat denote-last-front-matter denote-org-capture-specifiers)))
(defun denote-org-capture-delete-empty-file ()
"Delete file if capture with `denote-org-capture' is aborted."
(when-let* ((file denote-last-path)
((denote--file-empty-p file)))
(delete-file denote-last-path)))
(add-hook 'org-capture-after-finalize-hook #'denote-org-capture-delete-empty-file)
(provide 'denote-org-capture)
;;; denote-org-capture.el ends here

View file

@ -1,121 +0,0 @@
;;; denote-retrieve.el --- Internal search functions for Denote -*- lexical-binding: t -*-
;; Copyright (C) 2022 Free Software Foundation, Inc.
;; Author: Protesilaos Stavrou <info@protesilaos.com>
;; Maintainer: Denote Development <~protesilaos/denote@lists.sr.ht>
;; URL: https://git.sr.ht/~protesilaos/denote
;; Mailing-List: https://lists.sr.ht/~protesilaos/denote
;; Version: 0.3.0
;; Package-Requires: ((emacs "27.2"))
;; 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:
;;
;; Used internally by commands that operate on file contents.
;;; Code:
(require 'denote)
(require 'xref)
(defconst denote-retrieve--title-front-matter-key-regexp
"^\\(?:#\\+\\)?\\(?:title\\)\\s-*[:=]"
"Regular expression for title key.")
(defconst denote-retrieve--id-front-matter-key-regexp
"^.?.?\\b\\(?:identifier\\)\\s-*[:=]"
"Regular expression for identifier key.")
(defconst denote-retrieve--date-front-matter-key-regexp
"^\\(?:#\\+\\)?\\(?:date\\)\\s-*[:=]"
"Regular expression for date key.")
(defun denote-retrieve--filename-identifier (file)
"Extract identifier from FILE name."
(if (file-exists-p file)
(progn
(string-match denote--id-regexp file)
(match-string 0 file))
(error "Cannot find `%s' as a file" file)))
(defun denote-retrieve--search (file key-regexp &optional key)
"Return value of KEY-REGEXP key in current buffer from FILE.
If optional KEY is non-nil, return the key instead."
(with-temp-buffer
(insert-file-contents file)
(save-excursion
(save-restriction
(widen)
(goto-char (point-min))
(when (re-search-forward key-regexp nil t 1)
(if key
(match-string-no-properties 0)
(let ((trims "[ \t\n\r\"']+"))
(string-trim
(buffer-substring-no-properties (point) (point-at-eol))
trims trims))))))))
(defun denote-retrieve--value-title (file &optional key)
"Return title value from FILE.
If optional KEY is non-nil, return the key instead."
(denote-retrieve--search file denote-retrieve--title-front-matter-key-regexp key))
(defun denote-retrieve--value-date (file &optional key)
"Return date value from FILE.
If optional KEY is non-nil, return the key instead."
(denote-retrieve--search file denote-retrieve--date-front-matter-key-regexp key))
(defun denote-retrieve--read-file-prompt ()
"Prompt for regular file in variable `denote-directory'."
(read-file-name "Select note: " (denote-directory) nil nil nil
(lambda (f) (or (denote--only-note-p f) (file-directory-p f)))))
(defun denote-retrieve--files-in-output (files)
"Return list of FILES from `find' output."
(delq nil (mapcar (lambda (f)
(when (denote--only-note-p f) f))
files)))
(defun denote-retrieve--xrefs (identifier)
"Return xrefs of IDENTIFIER in variable `denote-directory'.
The xrefs are returned as an alist."
(xref--alistify
(xref-matches-in-files identifier (denote--directory-files :absolute))
(lambda (x)
(xref-location-group (xref-item-location x)))))
(defun denote-retrieve--files-in-xrefs (xrefs)
"Return sorted file names sans directory from XREFS.
Parse `denote-retrieve--xrefs'."
(sort
(delete-dups
(mapcar (lambda (x)
(denote--file-name-relative-to-denote-directory (car x)))
xrefs))
#'string-lessp))
(defun denote-retrieve--proces-grep (identifier)
"Process lines matching IDENTIFIER and return list of files."
(let* ((default-directory (denote-directory))
(file (denote--file-name-relative-to-denote-directory (buffer-file-name))))
(denote-retrieve--files-in-output
(delete file (denote-retrieve--files-in-xrefs
(denote-retrieve--xrefs identifier))))))
(provide 'denote-retrieve)
;;; denote-retrieve.el ends here

7746
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: