emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/denote 5a53344bbd 09/12: Make denote-save-buffer-after-


From: ELPA Syncer
Subject: [elpa] externals/denote 5a53344bbd 09/12: Make denote-save-buffer-after-creation a user option and document it
Date: Thu, 15 Feb 2024 00:58:22 -0500 (EST)

branch: externals/denote
commit 5a53344bbdee6400baaa203b44778c75318cd8c9
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    Make denote-save-buffer-after-creation a user option and document it
---
 README.org | 20 ++++++++++++++++++++
 denote.el  | 19 +++++++++++++++----
 2 files changed, 35 insertions(+), 4 deletions(-)

diff --git a/README.org b/README.org
index 303018be0b..06d5b9c08a 100644
--- a/README.org
+++ b/README.org
@@ -493,6 +493,25 @@ variants which you can then assign to keys, invoke with 
=M-x=, or add
 to the list of commands available at the ~denote-command-prompt~
 ([[#h:98c732ac-da0e-4ebd-a0e3-5c47f9075e51][Choose which commands to prompt 
for]]).
 
+*** The ~denote-save-buffer-after-creation~ option
+:PROPERTIES:
+:CUSTOM_ID: h:bf80f4cd-6f56-4f7c-a991-8573161e4511
+:END:
+
+[ Part of {{{development-version}}}. ]
+
+#+vindex: denote-save-buffer-after-creation
+The user option ~denote-save-buffer-after-creation~ controls whether
+commands that creeate new notes save their buffer outright.
+
+The default behaviour of commands such as ~denote~ (or related) is to
+not save the buffer they create 
([[#h:17896c8c-d97a-4faa-abf6-31df99746ca6][Points of entry]]). This gives the 
user
+the chance to review the text before writing it to a file. The user
+may choose to delete the unsaved buffer, thus not creating a new note.
+
+If ~denote-save-buffer-after-creation~ is set to a non-nil value, such
+buffers are saved automatically.
+
 *** The ~denote-date-prompt-use-org-read-date~ option
 :PROPERTIES:
 :CUSTOM_ID: h:e7ef08d6-af1b-4ab3-bb00-494a653e6d63
@@ -3755,6 +3774,7 @@ Everything is in place to set up the package.
 
 ;; Remember to check the doc strings of those variables.
 (setq denote-directory (expand-file-name "~/Documents/notes/"))
+(setq denote-save-buffer-after-creation nil)
 (setq denote-known-keywords '("emacs" "philosophy" "politics" "economics"))
 (setq denote-infer-keywords t)
 (setq denote-sort-keywords t)
diff --git a/denote.el b/denote.el
index a197b133f5..d60c865a76 100644
--- a/denote.el
+++ b/denote.el
@@ -140,6 +140,21 @@ the function `denote-directory' instead."
   :link '(info-link "(denote) Maintain separate directories for notes")
   :type 'directory)
 
+(defcustom denote-save-buffer-after-creation4 nil
+  "Control whether commands that creeate new notes save their buffer outright.
+
+The default behaviour of commands such as `denote' (or related)
+is to not save the buffer they create.  This gives the user the
+chance to review the text before writing it to a file.  The user
+may choose to delete the unsaved buffer, thus not creating a new
+note.
+
+If this user option is set to a non-nil value, such buffers are
+saved automatically."
+  :group 'denote
+  :package-version '(denote . "3.0.0")
+  :type 'boolean)
+
 (defcustom denote-known-keywords
   '("emacs" "philosophy" "politics" "economics")
   "List of strings with predefined keywords for `denote'.
@@ -1953,10 +1968,6 @@ prompted for a title.  When this variable is non-nil, the
 `denote' command ignores the region.  This variable is useful in
 commands that have their own way of handling the region.")
 
-;; NOTE 2024-01-13: This is a candidate for a user option.
-(defvar denote-save-buffer-after-creation nil
-  "If non-nil, the buffer is saved at the end of the `denote' command.")
-
 (defvar denote-title-prompt-current-default nil
   "Currently bound default title for `denote-title-prompt'.
 Set the value of this variable within the lexical scope of a



reply via email to

[Prev in Thread] Current Thread [Next in Thread]