[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote c4bbd64e2a 4/6: Reposition denote-change-file-ty
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote c4bbd64e2a 4/6: Reposition denote-change-file-type-and-front-matter |
Date: |
Thu, 19 Oct 2023 03:58:08 -0400 (EDT) |
branch: externals/denote
commit c4bbd64e2a08caa9b000814a8c8e32a0c6bd554a
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Reposition denote-change-file-type-and-front-matter
---
denote.el | 82 +++++++++++++++++++++++++++++++--------------------------------
1 file changed, 41 insertions(+), 41 deletions(-)
diff --git a/denote.el b/denote.el
index edad191ed4..bce53cfe16 100644
--- a/denote.el
+++ b/denote.el
@@ -2357,47 +2357,6 @@ files)."
'denote-change-file-type-and-front-matter
"2.1.0")
-;;;###autoload
-(defun denote-change-file-type-and-front-matter (file new-file-type)
- "Change file type of FILE and add an appropriate front matter.
-
-If in Dired, consider FILE to be the one at point, else prompt
-with minibuffer completion for one.
-
-Add a front matter in the format of the NEW-FILE-TYPE at the
-beginning of the file.
-
-Retrieve the title of FILE from a line starting with a title
-field in its front matter, depending on the previous file
-type (e.g. #+title for Org). The same process applies for
-keywords.
-
-As a final step, ask for confirmation, showing the difference
-between old and new file names.
-
-Important note: No attempt is made to modify any other elements
-of the file. This needs to be done manually."
- (interactive
- (list
- (denote--rename-dired-file-or-prompt)
- (denote--valid-file-type (or (denote-file-type-prompt) denote-file-type))))
- (let* ((dir (file-name-directory file))
- (old-file-type (denote-filetype-heuristics file))
- (id (or (denote-retrieve-filename-identifier file :no-error) ""))
- (title (denote-retrieve-title-value file old-file-type))
- (keywords (denote-retrieve-keywords-value file old-file-type))
- (old-extension (denote-get-file-extension file))
- (new-extension (denote--file-extension new-file-type))
- (new-name (denote-format-file-name
- dir id keywords (denote-sluggify title 'title)
new-extension))
- (max-mini-window-height 0.33)) ; allow minibuffer to be resized
- (when (and (not (eq old-extension new-extension))
- (denote-rename-file-prompt file new-name))
- (denote-rename-file-and-buffer file new-name)
- (denote-update-dired-buffers)
- (when (denote-file-is-writable-and-supported-p new-name)
- (denote--add-front-matter new-name title keywords id new-file-type)))))
-
;;;###autoload
(defun denote-dired-rename-marked-files (&optional skip-front-matter-prompt)
"Rename marked files in Dired to a Denote file name.
@@ -2603,6 +2562,47 @@ relevant front matter."
(denote-retrieve-filename-identifier file)
(denote-filetype-heuristics file))))
+;;;###autoload
+(defun denote-change-file-type-and-front-matter (file new-file-type)
+ "Change file type of FILE and add an appropriate front matter.
+
+If in Dired, consider FILE to be the one at point, else prompt
+with minibuffer completion for one.
+
+Add a front matter in the format of the NEW-FILE-TYPE at the
+beginning of the file.
+
+Retrieve the title of FILE from a line starting with a title
+field in its front matter, depending on the previous file
+type (e.g. #+title for Org). The same process applies for
+keywords.
+
+As a final step, ask for confirmation, showing the difference
+between old and new file names.
+
+Important note: No attempt is made to modify any other elements
+of the file. This needs to be done manually."
+ (interactive
+ (list
+ (denote--rename-dired-file-or-prompt)
+ (denote--valid-file-type (or (denote-file-type-prompt) denote-file-type))))
+ (let* ((dir (file-name-directory file))
+ (old-file-type (denote-filetype-heuristics file))
+ (id (or (denote-retrieve-filename-identifier file :no-error) ""))
+ (title (denote-retrieve-title-value file old-file-type))
+ (keywords (denote-retrieve-keywords-value file old-file-type))
+ (old-extension (denote-get-file-extension file))
+ (new-extension (denote--file-extension new-file-type))
+ (new-name (denote-format-file-name
+ dir id keywords (denote-sluggify title 'title)
new-extension))
+ (max-mini-window-height 0.33)) ; allow minibuffer to be resized
+ (when (and (not (eq old-extension new-extension))
+ (denote-rename-file-prompt file new-name))
+ (denote-rename-file-and-buffer file new-name)
+ (denote-update-dired-buffers)
+ (when (denote-file-is-writable-and-supported-p new-name)
+ (denote--add-front-matter new-name title keywords id new-file-type)))))
+
;;;; The Denote faces
(defgroup denote-faces ()
- [elpa] externals/denote updated (382cce8b9f -> baf79b494a), ELPA Syncer, 2023/10/19
- [elpa] externals/denote 2a5dfea29b 2/6: Rename denote-change-file-type to avoid confusion, ELPA Syncer, 2023/10/19
- [elpa] externals/denote f7406ef475 1/6: Refine conditionality of denote--file-with-temp-buffer-1, ELPA Syncer, 2023/10/19
- [elpa] externals/denote 36ed254aa0 3/6: Clarify the doc string of denote-after-new-note-hook, ELPA Syncer, 2023/10/19
- [elpa] externals/denote baf79b494a 6/6: Update error message of denote-dired-rename-marked-files-using-front-matter, ELPA Syncer, 2023/10/19
- [elpa] externals/denote f9fe0c374c 5/6: Renaming with front matter no longer requires buffer save, ELPA Syncer, 2023/10/19
- [elpa] externals/denote c4bbd64e2a 4/6: Reposition denote-change-file-type-and-front-matter,
ELPA Syncer <=