Commit graph

3334 commits

Author SHA1 Message Date
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