branch: externals/denote
commit 785258557867df7714079c4b62641adeab61fdb9
Author: Protesilaos Stavrou <[email protected]>
Commit: Protesilaos Stavrou <[email protected]>

    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.
---
 README.org |  9 +++++++--
 denote.el  | 27 ++++++++++++++-------------
 2 files changed, 21 insertions(+), 15 deletions(-)

diff --git a/README.org b/README.org
index d16be1bd87..8e719287bf 100644
--- a/README.org
+++ b/README.org
@@ -2939,8 +2939,13 @@ includes the title and keywords (aka "tags" or 
"filetags", depending on
 the file type) which the user specified at the relevant prompt, as well
 as the date and unique identifier, which are derived automatically.
 
-This is how it looks for Org mode (when ~denote-file-type~ is nil or the
-=org= symbol):
+This is how it looks for Org mode (when ~denote-file-type~ is set to
+the =org= symbol, which is the default):
+
+[ The ~org~ symbol is made the default as of {{{development-version}}}.
+  Previous versions were also defaulting to Org, but the ~denote-file-type~
+  was not explicitly set to ~org~, which could lead to unpredictable
+  results in certain cases. ]
 
 #+begin_example
 #+title:      This is a sample note
diff --git a/denote.el b/denote.el
index 7831067507..7e74110b5e 100644
--- a/denote.el
+++ b/denote.el
@@ -400,26 +400,27 @@ If nil, show the keywords in their given order."
   :package-version '(denote . "0.1.0")
   :type 'boolean)
 
-(defcustom denote-file-type nil
+(defcustom denote-file-type 'org
   "The file type extension for new notes.
 
-By default (a nil value), the file type is that of Org mode.
-Though the `org' symbol can be specified for the same effect.
+When the value is `org' (the default), the file type is that of Org
+mode.
 
-When the value is the symbol `markdown-yaml', the file type is
-that of Markdown mode and the front matter uses YAML notation.
-Similarly, `markdown-toml' is Markdown but has TOML syntax in the
-front matter.
+When the value is the symbol `markdown-yaml', the file type is that of
+Markdown mode and the front matter uses YAML notation.  Similarly,
+`markdown-toml' is Markdown but has TOML syntax in the front matter.
 
 When the value is `text', the file type is that of Text mode.
 
-Any other non-nil value is the same as the default.
+Any other value makes Denote use the first element of the
+`denote-file-types', which is the registry with all the supported file
+types (Org is the first there out-of-the-box, but users may modify it).
 
-NOTE: Expert users can change the supported file-types by editing
-the value of `denote-file-types'.  That variable, which is not a
-user option, controls the behaviour of all file-type-aware
+NOTE: Expert users can change the supported file-types by editing the
+value of `denote-file-types'.  That variable, which is not a user
+option, controls the behaviour of all file-type-aware
 functions (creating notes, renaming them, inserting front matter,
-formatting a link, etc.). Consult its documentation for the
+formatting a link, etc.).  Consult its documentation for the
 technicalities."
   :type '(choice
           (const :tag "Unspecified (defaults to Org)" nil)
@@ -427,7 +428,7 @@ technicalities."
           (const :tag "Markdown (YAML front matter)" markdown-yaml)
           (const :tag "Markdown (TOML front matter)" markdown-toml)
           (const :tag "Plain text" text))
-  :package-version '(denote . "0.6.0")
+  :package-version '(denote . "4.2.0")
   :group 'denote)
 
 (defcustom denote-date-format nil

Reply via email to