branch: externals/denote commit 0d4ff4a1eddfe930bbdebe5c0ef9aed369deed24 Merge: e58479f096 22b96a2baf Author: Protesilaos Stavrou <i...@protesilaos.com> Commit: GitHub <nore...@github.com>
Merge pull request #512 from jeanphilippegg/fix-issue Fix regression in denote-prepend-front-matter (issue #510) --- denote.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/denote.el b/denote.el index abdbb65596..3dba1af90d 100644 --- a/denote.el +++ b/denote.el @@ -3125,7 +3125,9 @@ The TITLE, KEYWORDS, DATE, ID, SIGNATURE, and FILE-TYPE are passed from the renaming command and are used to construct a new front matter block if appropriate." (when-let* ((new-front-matter (denote--format-front-matter title date keywords id signature file-type))) - (denote--file-with-temp-buffer file + (with-current-buffer (if (denote--file-type-org-extra-p) + denote-last-path-after-rename + (find-file-noselect file)) (goto-char (point-min)) (insert new-front-matter))))