branch: externals/denote-review
commit b8d55b5faf5e7493cff3f7a68337146468d7ab5e
Author: Matto Fransen <[email protected]>
Commit: Matto Fransen <[email protected]>

    Location of review date customizable
---
 README.org            |  9 +++++++++
 my-denote-review.el   |  9 ++++++---
 my-denote-review.texi | 35 +++++++++++++++++++++--------------
 3 files changed, 36 insertions(+), 17 deletions(-)

diff --git a/README.org b/README.org
index beb3bf93b7..57f46705d4 100644
--- a/README.org
+++ b/README.org
@@ -52,6 +52,15 @@ To make this easy, bind this command to a key, f.e.:
 - When the  ~reviewdate~ field is already part of the frontmatter,
   the review date will be updated with the current date.
 
+The default location of the ~reviewdate~ frontmatter is right below
+the identifier frontmatter line. This can be customized by setting
+the useroption ~my-denote-review-insert-after~.
+
+For example, to insert the ~reviewdate~ right below the "date"
+frontmatter, add the following to your Emacs configuration:
+
+~(setopt my-denote-review-insert-after "date")~
+
 Example screenshot of the frontmatter of a note:
 
 #+CAPTION: /Example note showing frontmatter with the latest review date/
diff --git a/my-denote-review.el b/my-denote-review.el
index bbd592a367..6295327a97 100644
--- a/my-denote-review.el
+++ b/my-denote-review.el
@@ -52,6 +52,10 @@
   "Point to stop `re-search-forward' after some lines."
   :type 'natnum)
 
+(defcustom my-denote-review-insert-after "identifier"
+  "Frontmatter after which to insert review date line."
+  :type 'string)
+
 ;; Regexps for different filetypes
 
 (defun my-denote-review-search-regexp-for-filetype ()
@@ -71,8 +75,8 @@ Defaults to regexp for org filetype."
        (eq denote-file-type 'markdown-yaml)
        (eq denote-file-type 'markdown-toml)
        (eq denote-file-type 'text))
-      "^identifier"
-    "^#\\+identifier"))
+      (format "^%s" my-denote-review-insert-after)
+    (format "^#\\+%s" my-denote-review-insert-after)))
 
 ;; Setting and getting the reviewdate
 
@@ -336,7 +340,6 @@ DENOTEPATH-AND-KEYWORD is a cons of a path and a keyword.
       (my-denote-review-mode)
       (setq tabulated-list-entries (my-denote-review-collect-files
                                     denotepath-and-keyword))
-      (setf datastore denotepath-and-keyword)
       (add-hook 'tabulated-list-revert-hook
                 (lambda ()
                   (my-denote-review-collect-files--revert 
denotepath-and-keyword)) 0 t)
diff --git a/my-denote-review.texi b/my-denote-review.texi
index ac0b5a8d73..c508a18baf 100644
--- a/my-denote-review.texi
+++ b/my-denote-review.texi
@@ -53,7 +53,8 @@ The document was typeset with
 * Getting started::
 * Commands::
 * Customization::
-* Copying This Manual::
+* Command Index::
+* GNU Free Documentation License::
 @end menu
 
 @c Update all node entries with `C-c C-u C-n'.
@@ -233,10 +234,21 @@ frontmatter, will be left untouched.
 @node Customization
 @chapter Customization
 
-There is only one variable to customize.
+@defopt my-denote-review-insert-after
+Location of the review date frontmatter line.
+@end defopt
+
+The default location of the review date frontmatter is right below
+the identifier frontmatter line. This can be customized by setting
+the user option @code{my-denote-review-insert-after}.
+
+For example, to insert the ~reviewdate~ right below the "date"
+frontmatter, add the following to your Emacs configuration:
+
+@code{(setopt my-denote-review-insert-after "date")}
 
 @defopt my-denote-review-max-search-point
-Defines where the search-forward command stops.
+Location at which the search-forward command stops.
 @end defopt
 
 Not all notes have to contain the review date frontmatter.
@@ -253,22 +265,17 @@ point a few lines below your frontmatter and issue the 
command
 @key{C-x =} to see what a better value for
 @code{my-denote-review-max-search-point} could be.
 
-@node Copying This Manual
-@appendix Copying This Manual
+@node Command Index
+@unnumbered Command and Function Index
+@printindex fn
 
-* GNU Free Documentation License::  License for copying this manual.
+@node GNU Free Documentation License
+@appendix GNU Free Documentation License
 
+* GNU Free Documentation License::  License for copying this manual.
 
 @c Get fdl.texi from https://www.gnu.org/licenses/fdl.html
 @include fdl.texi
 
-@node Command index
-
-@printindex fn
-
-node Index
-@unnumbered Index
-
-@printindex cp
 
 @bye

Reply via email to