[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote 47073aa2a0 4/6: Re-implement commit 36440d7
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote 47073aa2a0 4/6: Re-implement commit 36440d7 |
Date: |
Sun, 24 Jul 2022 21:57:28 -0400 (EDT) |
branch: externals/denote
commit 47073aa2a031761982513fc6ad4ad51efb72ca8a
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Re-implement commit 36440d7
Sorry for the noise... The previous code was incomplete.
---
denote-dired.el | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/denote-dired.el b/denote-dired.el
index d990169ee4..b6649089a8 100644
--- a/denote-dired.el
+++ b/denote-dired.el
@@ -282,6 +282,9 @@ replace what isn't there."
;; Heuristic to check if this is one of our notes
(string= (expand-file-name default-directory) (denote-directory)))))
+;; FIXME 2022-07-25: We should make the underlying regular expressions
+;; that `denote-retrieve--value-title' targets more refined, so that we
+;; capture eveyrhing at once.
(defun denote-dired--rewrite-front-matter (file title keywords)
"Rewrite front matter of note after `denote-dired-rename-file'.
The FILE, TITLE, and KEYWORDS are passed from the renaming
@@ -297,16 +300,18 @@ appropriate."
keywords (denote-dired--filetype-heuristics file))))
(with-current-buffer (find-file-noselect file)
(when (y-or-n-p (format
- "Replace front matter?\n-%s\n+%s\n\n-%s\n+%s"
+ "Replace front matter?\n-%s\n+%s\n\n-%s\n+%s?"
(propertize old-title 'face 'error)
(propertize new-title 'face 'success)
(propertize old-keywords 'face 'error)
(propertize new-keywords 'face 'success)))
(save-excursion
(goto-char (point-min))
+ (re-search-forward denote-retrieve--title-front-matter-key-regexp
nil t 1)
(search-forward old-title nil t 1)
(replace-match (concat "\\1" new-title) t)
(goto-char (point-min))
+ (re-search-forward
denote-retrieve--keywords-front-matter-key-regexp nil t 1)
(search-forward old-keywords nil t 1)
(replace-match (concat "\\1" new-keywords) t)))))))
- [elpa] externals/denote updated (36440d7b7d -> f525bbd8fa), ELPA Syncer, 2022/07/24
- [elpa] externals/denote d3a537d065 2/6: Regex to allow for non-ASCII characters in title and tags, ELPA Syncer, 2022/07/24
- [elpa] externals/denote 19c4fa8b09 5/6: Merge pull request #64 from pprevos/main, ELPA Syncer, 2022/07/24
- [elpa] externals/denote 0b69904020 3/6: Merge branch 'protesilaos:main' into main, ELPA Syncer, 2022/07/24
- [elpa] externals/denote 47073aa2a0 4/6: Re-implement commit 36440d7,
ELPA Syncer <=
- [elpa] externals/denote f525bbd8fa 6/6: Update Acknowledgements for commit d3a537d, ELPA Syncer, 2022/07/24
- [elpa] externals/denote b745cae875 1/6: Revert "Refine front matter rewrite", ELPA Syncer, 2022/07/24