[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote 1646c43bc3 05/12: Make denote-keywords-{add, re
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote 1646c43bc3 05/12: Make denote-keywords-{add, remove} honour denote-rename-no-confirm |
Date: |
Thu, 15 Feb 2024 00:58:18 -0500 (EST) |
branch: externals/denote
commit 1646c43bc3425fdc779186c775a35e9c1c293ba5
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
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.
---
README.org | 5 +++++
denote.el | 12 ++++++++++--
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/README.org b/README.org
index 7fcb748b81..6603ae2dcc 100644
--- a/README.org
+++ b/README.org
@@ -527,6 +527,11 @@ Similarly, the ~denote-keywords-remove~ removes one or
more keywords
from the list of existing keywords and then renames the file
accordingly.
+[ The following is part of {{{development-version}}}. ]
+
+Both commands will automatically save the buffer if the user option
+~denote-rename-no-confirm~ is set to a non-nil value
([[#h:a2ae9090-c49e-4b32-bcf5-eb8944241fd7][The ~denote-rename-no-confirm~
option]]).
+
** Create a note from the current Org subtree
:PROPERTIES:
:CUSTOM_ID: h:d0c7cb79-21e5-4176-a6af-f4f68578c8dd
diff --git a/denote.el b/denote.el
index a7c5f0ee91..26ead141f2 100644
--- a/denote.el
+++ b/denote.el
@@ -2384,7 +2384,10 @@ note's actual title. At the `denote-file-prompt' type
When called from Lisp, KEYWORDS is a list of strings.
Rename the file without further prompt so that its name reflects
-the new front matter, per `denote-rename-file-using-front-matter'."
+the new front matter, per `denote-rename-file-using-front-matter'.
+
+If the user option `denote-rename-no-confirm' is non-nil, save
+the buffer. Otherwise, leave it unsaved for further review."
(interactive (list (denote-keywords-prompt)))
;; A combination of if-let and let, as we need to take into account
;; the scenario in which there are no keywords yet.
@@ -2396,6 +2399,7 @@ the new front matter, per
`denote-rename-file-using-front-matter'."
(seq-uniq (append keywords cur-keywords)))))
(denote-rewrite-keywords file new-keywords file-type)
(denote-rename-file-using-front-matter file :auto-confirm)
+ (when denote-rename-no-confirm (save-buffer))
(run-hooks 'denote-after-rename-file-hook))
(user-error "Buffer not visiting a Denote file")))
@@ -2415,7 +2419,10 @@ output is sorted with `string-collate-lessp'."
Keywords are retrieved from the file's front matter.
Rename the file without further prompt so that its name reflects
-the new front matter, per `denote-rename-file-using-front-matter'."
+the new front matter, per `denote-rename-file-using-front-matter'.
+
+If the user option `denote-rename-no-confirm' is non-nil, save
+the buffer. Otherwise, leave it unsaved for further review."
(declare (interactive-only t))
(interactive)
(if-let ((file (buffer-file-name))
@@ -2428,6 +2435,7 @@ the new front matter, per
`denote-rename-file-using-front-matter'."
(seq-difference cur-keywords del-keyword)
file-type)
(denote-rename-file-using-front-matter file :auto-confirm)
+ (when denote-rename-no-confirm (save-buffer))9
(run-hooks 'denote-after-rename-file-hook))
(user-error "Buffer not visiting a Denote file")))
- [elpa] externals/denote updated (127c9a38a8 -> b82da20d5d), ELPA Syncer, 2024/02/15
- [elpa] externals/denote edac33337c 01/12: Avoid keeping opened buffers in `denote-link-return-links`, ELPA Syncer, 2024/02/15
- [elpa] externals/denote 13a64f7709 02/12: Merge branch 'protesilaos:main' into main, ELPA Syncer, 2024/02/15
- [elpa] externals/denote 2f122d374f 03/12: Merge pull request #252 from mattyonweb/main, ELPA Syncer, 2024/02/15
- [elpa] externals/denote f978dd746d 04/12: Acknowledge mattyonweb for commit edac333, ELPA Syncer, 2024/02/15
- [elpa] externals/denote 969367db4b 06/12: Update the documentation of the user option denote-rename-no-confirm, ELPA Syncer, 2024/02/15
- [elpa] externals/denote 1646c43bc3 05/12: Make denote-keywords-{add, remove} honour denote-rename-no-confirm,
ELPA Syncer <=
- [elpa] externals/denote 6035d777cd 07/12: Update the documentation of denote-after-new-note-hook, ELPA Syncer, 2024/02/15
- [elpa] externals/denote 489e59e61c 08/12: Move denote-keywords-{add, remove} where the renaming commands are, ELPA Syncer, 2024/02/15
- [elpa] externals/denote 5a53344bbd 09/12: Make denote-save-buffer-after-creation a user option and document it, ELPA Syncer, 2024/02/15
- [elpa] externals/denote 79e5ec02d3 11/12: Update the documentation of denote-keywords-{add,remove}; group as "rename", ELPA Syncer, 2024/02/15
- [elpa] externals/denote b82da20d5d 12/12: Clarify that all convenience commands append to the denote-prompts, ELPA Syncer, 2024/02/15
- [elpa] externals/denote c6ef5ec335 10/12: Define aliases for denote-keywords-{add, remove}, ELPA Syncer, 2024/02/15