branch: externals/denote-review
commit a1ec49993a82aa2a527da67d97a42c45a56a2f36
Author: Matto Fransen <[email protected]>
Commit: Matto Fransen <[email protected]>
first step to prepare to support more filetypes
---
README.org | 8 +++++++-
my-denote-review.el | 16 +++++++++-------
2 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/README.org b/README.org
index b5b5379d2e..91a3eb3bb9 100644
--- a/README.org
+++ b/README.org
@@ -1,7 +1,7 @@
* my-denote-review
`my-denote-review' aims to provide a practical and simple manner to
-implement a review process for some of your denote notes.
+implement a review process for some of your [[
https://protesilaos.com/emacs/denote][denote]] notes.
It is made for notes in org mode format.
@@ -63,6 +63,8 @@ Example screenshot of the list with some notes:
#+CAPTION: /Tabulated list to select a note to review/
[[./images/denote-review-tabulated-view.png]]
+[Note: The filenames in the screenshots based on headers in the README from
Protesilaos Stavrou, see https://protesilaos.com/emacs/denote ]
+
Default the list is ordered by review date, from the oldest to the
newest. Click on a column header to change the order.
@@ -132,6 +134,10 @@ point a few lines below your frontmatter and issue the
command
~C-x =~ to see what a better value for
~my-denote-review-max-search-point~ could be.
+** Limitations
+Currenlty only org-mode denote notes are supported.
+`my-denote-review' does not dive into subdirectories.
+
** Source code. bugs and patches
~my-denote-review~ is developed at
https://codeberg.org/mattof/my-denote-review
diff --git a/my-denote-review.el b/my-denote-review.el
index 17676a5356..2f485db62b 100644
--- a/my-denote-review.el
+++ b/my-denote-review.el
@@ -1,6 +1,6 @@
;;; my-denote-review --- organize notes review -*- lexical-binding: t; -*-
-;; Copyright (C) 2025 Matto Fransen
+;; Copyright (C) 2026 Matto Fransen
;; Author: Matto Fransen <[email protected]>
;; Maintainer: Matto Fransen <[email protected]>
@@ -52,7 +52,7 @@
Or use THISDATE, when not nil."
(goto-char (point-min))
(let ((mydate (format-time-string "%F")))
- (when (not (null thisdate))
+ (unless (null thisdate)
(setq mydate thisdate))
(re-search-forward "^$" nil t)
(replace-match (format "#+reviewdate: [%s]" mydate))
@@ -70,11 +70,11 @@ Replace an existing reviewdate."
(format "#+reviewdate: [%s]" (format-time-string "%F")))
(my-denote-review-insert-date))))
-(defun my-denote-review-get-date ()
+(defun my-denote-review-get-date (search-regexp)
"Get the reviewdate from current buffer."
(save-excursion
(goto-char (point-min))
- (when (re-search-forward "\\(^#\\+reviewdate:[
\t]\\[\\)\\([^\t\n]+\\)\\]"
+ (when (re-search-forward search-regexp
my-denote-review-max-search-point t)
(match-string-no-properties 2))))
@@ -83,7 +83,8 @@ Replace an existing reviewdate."
(defun my-denote-review-set-initial-date (thisdate)
"Insert reviewdate with THISDATE.
Only do this when no reviewdate already exist."
- (when (null (my-denote-review-get-date))
+ (when (null (my-denote-review-get-date
+ "\\(^#\\+reviewdate:[ \t]\\[\\)\\([^\t\n]+\\)\\]"))
(my-denote-review-insert-date thisdate)))
(defun my-denote-review-get-date-from-filename (filename)
@@ -152,7 +153,8 @@ Does not overwrite existing reviewdates."
"Get the reviewdate of MYFILE."
(let ((mybuffer (find-file myfile))
myreviewdate)
- (setq myreviewdate (my-denote-review-get-date))
+ (setq myreviewdate (my-denote-review-get-date
+ "\\(^#\\+reviewdate:[ \t]\\[\\)\\([^\t\n]+\\)\\]"))
(kill-buffer mybuffer)
myreviewdate))
@@ -169,7 +171,7 @@ Create a list in the format required by
`tabulated-list-mode'."
(string-match
(format "_%s" (cdr denotepath-and-keyword)) myfile))
(let ((reviewdate (my-denote-review-check-date-of-file myfile)))
- (when (not (null reviewdate))
+ (unless (null reviewdate)
(push (list myfile
(vector
reviewdate