[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote 890a335092 149/355: Add denote-dired-rename-expe
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote 890a335092 149/355: Add denote-dired-rename-expert user option |
Date: |
Sun, 26 Jun 2022 23:58:16 -0400 (EDT) |
branch: externals/denote
commit 890a3350927559608936344191117ff9a9b6779e
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Add denote-dired-rename-expert user option
---
README.org | 5 +++++
denote-dired.el | 29 ++++++++++++++++++++++-------
2 files changed, 27 insertions(+), 7 deletions(-)
diff --git a/README.org b/README.org
index 6feb5359f4..0b6989b37f 100644
--- a/README.org
+++ b/README.org
@@ -300,6 +300,10 @@ before renaming the file at point, showing a message like:
Rename sample.pdf to 20220612T052900--my-sample-title__testing.pdf? (y or n)
#+end_example
+#+vindex: denote-dired-rename-expert
+However, if the user option ~denote-dired-rename-expert~ is non-nil,
+conduct the renaming operation outright---no questions asked.
+
When operating on a file that has no identifier, such as =sample.pdf=,
Denote reads the file properties to retrieve its last modification time.
If the file was from a past date like 2000-11-31 it will get an
@@ -802,6 +806,7 @@ Everything is in place to set up the package.
(require 'denote-link)
(require 'denote-dired)
+(setq denote-dired-rename-expert nil)
;; We use different ways to specify a path for demo purposes.
(setq denote-dired-directories
diff --git a/denote-dired.el b/denote-dired.el
index 1856e9e37c..cee702cff7 100644
--- a/denote-dired.el
+++ b/denote-dired.el
@@ -78,6 +78,13 @@
:type '(repeat directory)
:group 'denote-dired)
+(defcustom denote-dired-rename-expert nil
+ "If t, `denote-dired-rename-file' doesn't ask for confirmation.
+The confiration is asked via a `y-or-n-p' prompt which shows the
+old name followed by the new one."
+ :type 'boolean
+ :group 'denote-dired)
+
;;;; Commands
(defun denote-dired--file-attributes-time (file)
@@ -97,16 +104,24 @@
;;;###autoload
(defun denote-dired-rename-file (file title keywords)
"Rename FILE to include TITLE and KEYWORDS.
-If in Dired consider FILE the one at point, else prompt with
-completion.
-If FILE has a Denote-style identifier, retain it while updating
-the TITLE and KEYWORDS fields. Else create an identifier,
-replacing the whole name.
+If in Dired, consider FILE to be the one at point, else prompt
+with completion.
+
+If FILE has a Denote-compliant identifier, retain it while
+updating the TITLE and KEYWORDS fields of the file name. Else
+create an identifier based on the file's attribute of last
+modification time. If such attribute cannot be found, the
+identifier falls back to the current time.
+
+As a final step, prompt for confirmation, showing the difference
+between old and new file names. If `denote-dired-rename-expert'
+is non-nil, conduct the renaming operation outright---no
+questions asked!
The file type extension (e.g. .pdf) is read from the underlying
-file and is preserved in the renaming process. Files that have
-no extension are simply left without one.
+file and is preserved through the renaming process. Files that
+have no extension are simply left without one.
Renaming only occurs relative to the current directory. Files
are not moved between directories.
- [elpa] externals/denote 8a35382067 126/355: Rename internal variable for clarity, (continued)
- [elpa] externals/denote 8a35382067 126/355: Rename internal variable for clarity, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 308322afab 108/355: Fix markdown-toml identifier value, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 11be1d6b40 123/355: Change "tml" to "toml" in denote-toml-front-matter, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 6000313eec 118/355: Enforce sluggification of keywords; document it, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 82eeb381dc 110/355: Make all front matter abstractions consistent, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 73dc07ac00 113/355: Make front matter variables "public", ELPA Syncer, 2022/06/27
- [elpa] externals/denote 21e415e2e7 111/355: Remove obsolete symbol of command, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 60d64ca07c 117/355: Document ways to change the front matter, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 28518416f3 131/355: Name the faces in the manual, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 0bda79ef19 139/355: Move heading further up in the manual, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 890a335092 149/355: Add denote-dired-rename-expert user option,
ELPA Syncer <=
- [elpa] externals/denote 5977a9bc7b 164/355: Add warning about likely changes to denote-link.el, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 3f768cc438 168/355: Remove commented-out 'require', ELPA Syncer, 2022/06/27
- [elpa] externals/denote d6285c8c5a 182/355: Omit current file from backlinks, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 02507c6f0d 171/355: Rename private variable, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 340f9103fd 175/355: Fix typo in manual, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 5c400d80d9 191/355: Document regexp example for file extension, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 8a33364dc6 188/355: Add helper fn to filter files matching regexp, ELPA Syncer, 2022/06/27
- [elpa] externals/denote f2cfcd26ea 205/355: Refine denote-retrieve regular expressions, ELPA Syncer, 2022/06/27
- [elpa] externals/denote d46c8fec55 239/355: Add "Contributing" section to the manual, ELPA Syncer, 2022/06/27
- [elpa] externals/denote bcbd52a784 200/355: Use format specifiers for denote-link-add-links, ELPA Syncer, 2022/06/27