Commit graph

1846 commits

Author SHA1 Message Date
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 0993df4fbc
Fix typo about "keymap" 2026-04-09 21:11:40 +03: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 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 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 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 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 d93056137f
In denote-link--prepare-links pass the file-type to denote-get-link-description 2026-03-19 07:12:31 +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 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 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 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 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
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
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
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 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
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