emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/denote 47e619feef 4/4: Make denote-rename-file-using-fr


From: ELPA Syncer
Subject: [elpa] externals/denote 47e619feef 4/4: Make denote-rename-file-using-front-matter also read file-at-point in Dired
Date: Wed, 31 Jul 2024 12:58:01 -0400 (EDT)

branch: externals/denote
commit 47e619feefb47c5e512be9b2940622c147aba7a4
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    Make denote-rename-file-using-front-matter also read file-at-point in Dired
    
    This makes it consistent with how 'denote-rename-file' works. I am
    implementing this in response to issue 401 where Alp Eren Kose assumed
    this was the default behaviour: 
<https://github.com/protesilaos/denote/issues/401>
    
    I think it makes sense to have it this way to avoid such confusion.
    Still, it seems easier to edit the file and call 
'denote-rename-file-using-front-matter'
    directly, rather do an intermediate step through Dired.
---
 README.org | 20 ++++++++++----------
 denote.el  | 15 +++++----------
 2 files changed, 15 insertions(+), 20 deletions(-)

diff --git a/README.org b/README.org
index df122a3077..d05e139c10 100644
--- a/README.org
+++ b/README.org
@@ -5915,16 +5915,16 @@ Denote is meant to be a collective effort.  Every bit 
of help matters.
 
 + Ideas and/or user feedback :: Abin Simon, Aditya Yadav, Alan
   Schmitt, Aleksandr Vityazev, Alex Hirschfeld, Alexis Purslane,
-  Alfredo Borrás, Ashton Wiersdorf, Benjamin Kästner, Claudio
-  Migliorelli, Claudiu Tănăselia, Colin McLear, Damien Cassou, Elias
-  Storms, Federico Stilman, Florian, Frédéric Willem Frank Ehmsen,
-  Glenna D., Guo Yong, Hanspeter Gisler Harold Ollivier, Jack Baty,
-  Jay Rajput, Jean-Charles Bagneris, Jens Östlund, Jeremy Friesen,
-  Jonathan Sahar, Johan Bolmsjö, Jousimies, Juanjo Presa, Julian Hoch,
-  Kai von Fintel, Kaushal Modi, Kolmas, M. Hadi Timachi, Maikol Solis,
-  Mark Olson, Mirko Hernandez, Niall Dooley, Nick Bell, Paul van
-  Gelder, Peter Prevos, Peter Smith, Samuel W. Flint, Suhail Singh,
-  Shreyas Ragavan, Stefan Thesing, Summer Emacs, Sven Seebeck,
+  Alfredo Borrás, Alp Eren Kose, Ashton Wiersdorf, Benjamin Kästner,
+  Claudio Migliorelli, Claudiu Tănăselia, Colin McLear, Damien Cassou,
+  Elias Storms, Federico Stilman, Florian, Frédéric Willem Frank
+  Ehmsen, Glenna D., Guo Yong, Hanspeter Gisler Harold Ollivier, Jack
+  Baty, Jay Rajput, Jean-Charles Bagneris, Jens Östlund, Jeremy
+  Friesen, Jonathan Sahar, Johan Bolmsjö, Jousimies, Juanjo Presa,
+  Julian Hoch, Kai von Fintel, Kaushal Modi, Kolmas, M. Hadi Timachi,
+  Maikol Solis, Mark Olson, Mirko Hernandez, Niall Dooley, Nick Bell,
+  Paul van Gelder, Peter Prevos, Peter Smith, Samuel W. Flint, Suhail
+  Singh, Shreyas Ragavan, Stefan Thesing, Summer Emacs, Sven Seebeck,
   Taoufik, TJ Stankus, Vick (VicZz), Viktor Haag, Wade Mealing, Yi
   Liu, Ypot, atanasj, azegas, babusri, doolio, duli, drcxd, elge70,
   fingerknight, hpgisler, mentalisttraceur, pRot0ta1p, rbenit68,
diff --git a/denote.el b/denote.el
index bacbbb5d38..73d91fea46 100644
--- a/denote.el
+++ b/denote.el
@@ -3251,15 +3251,10 @@ Also see the specialized commands to only add or remove 
keywords:
 ;;;###autoload
 (defun denote-rename-file-using-front-matter (file)
   "Rename FILE using its front matter as input.
-When called interactively, FILE is the return value of the
-function `buffer-file-name' which is subsequently inspected for
-the requisite front matter.  It is thus implied that the FILE has
-a file type that is supported by Denote, per `denote-file-type'.
-
-Never modify the identifier of the FILE, if any, even if it is
-edited in the front matter.  Denote considers the file name to be
-the source of truth in this case to avoid potential breakage with
-typos and the like.
+When called interactively, FILE is the variable `buffer-file-name' or
+the Dired file at point, which is subsequently inspected for the
+requisite front matter.  It is thus implied that the FILE has a file
+type that is supported by Denote, per `denote-file-type'.
 
 The values of `denote-rename-confirmations' and `denote-save-buffers'
 are respected.  Though there is no prompt to confirm the rewrite of the
@@ -3272,7 +3267,7 @@ with typos and the like.
 
 Construct the file name in accordance with the user option
 `denote-file-name-components-order'."
-  (interactive (list buffer-file-name))
+  (interactive (list (or (dired-get-filename nil t) buffer-file-name)))
   (unless (denote-file-is-writable-and-supported-p file)
     (user-error "The file is not writable or does not have a supported file 
extension"))
   (if-let ((file-type (denote-filetype-heuristics file))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]