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

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

[elpa] externals/denote 8ae30d4db9 19/19: Add faces for the files shown


From: ELPA Syncer
Subject: [elpa] externals/denote 8ae30d4db9 19/19: Add faces for the files shown in various rename prompts
Date: Sat, 2 Dec 2023 03:57:54 -0500 (EST)

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

    Add faces for the files shown in various rename prompts
---
 README.org | 18 ++++++++++++++++++
 denote.el  | 31 +++++++++++++++++++++++--------
 2 files changed, 41 insertions(+), 8 deletions(-)

diff --git a/README.org b/README.org
index e79bcdec0c..b717f00699 100644
--- a/README.org
+++ b/README.org
@@ -1305,6 +1305,24 @@ field in the file's front matter, depending on the 
previous file type
 As a final step, the command asks for confirmation, showing the
 difference between old and new file names.
 
+** Faces used by rename commands
+:PROPERTIES:
+:CUSTOM_ID: h:ab3f355a-f763-43ae-a4c9-179d2d9265a5
+:END:
+
+[ These faces are part of {{{development-version}}}. The styles they
+  use are the same they had before. The difference now is that themes
+  can style them as they see fit instead of having to deal with
+  hardcoded values. ]
+
+These are the faces used by the various Denote rename commands to
+style or highlight the old/new/current file shown in the relevant
+minibuffer prompts:
+
+- ~denote-faces-prompt-current-name~
+- ~denote-faces-prompt-new-name~
+- ~denote-faces-prompt-old-name~
+
 * The file-naming scheme
 :PROPERTIES:
 :CUSTOM_ID: h:4e9c7512-84dc-4dfb-9fa9-e15d51178e5d
diff --git a/denote.el b/denote.el
index 440e32c3e9..8eb0c1f550 100644
--- a/denote.el
+++ b/denote.el
@@ -2299,10 +2299,10 @@ that effect."
       (when (or no-confirm
                 (y-or-n-p (format
                            "Replace front matter?\n-%s\n+%s\n\n-%s\n+%s?"
-                           (propertize old-title-line 'face 'error)
-                           (propertize new-title-line 'face 'success)
-                           (propertize old-keywords-line 'face 'error)
-                           (propertize new-keywords-line 'face 'success))))
+                           (propertize old-title-line 'face 
'denote-faces-prompt-old-name)
+                           (propertize new-title-line 'face 
'denote-faces-prompt-new-name)
+                           (propertize old-keywords-line 'face 
'denote-faces-prompt-old-name)
+                           (propertize new-keywords-line 'face 
'denote-faces-prompt-new-name))))
         (save-excursion
           (save-restriction
             (widen)
@@ -2343,8 +2343,8 @@ Throw error if FILE is not regular, else return FILE."
   (unless (string= (expand-file-name old-name) (expand-file-name new-name))
     (y-or-n-p
      (format "Rename %s to %s?"
-             (propertize (file-name-nondirectory old-name) 'face 'error)
-             (propertize (file-name-nondirectory new-name) 'face 'success)))))
+             (propertize (file-name-nondirectory old-name) 'face 
'denote-faces-prompt-old-name)
+             (propertize (file-name-nondirectory new-name) 'face 
'denote-faces-prompt-new-name)))))
 
 ;; NOTE 2023-10-20: We do not need a user option for this, though it
 ;; can be useful to have it as a variable.
@@ -2432,7 +2432,7 @@ place."
   (interactive
    (let* ((file (denote--rename-dired-file-or-prompt))
           (file-type (denote-filetype-heuristics file))
-          (file-in-prompt (propertize file 'face 'error)))
+          (file-in-prompt (propertize file 'face 
'denote-faces-prompt-current-name)))
      (list
       file
       (denote-title-prompt
@@ -2479,7 +2479,7 @@ the changes made to the file: perform them outright."
                         (denote--get-all-used-ids))))
         (dolist (file marks)
           (let* ((file-type (denote-filetype-heuristics file))
-                 (file-in-prompt (propertize file 'face 'error))
+                 (file-in-prompt (propertize file 'face 
'denote-faces-prompt-current-name))
                  (dir (file-name-directory file))
                  (id (or (denote-retrieve-filename-identifier file :no-error)
                          (denote-create-unique-file-identifier file used-ids)))
@@ -2808,6 +2808,21 @@ and seconds."
 
 (make-obsolete-variable 'denote-faces-file-name-keywords-for-backlinks nil 
"2.2.0")
 
+(defface denote-faces-prompt-old-name '((t :inherit error))
+  "Face for the old name shown in the prompt of `denote-rename-file' etc."
+  :group 'denote-faces
+  :package-version '(denote . "2.2.0"))
+
+(defface denote-faces-prompt-new-name '((t :inherit success))
+  "Face for the new name shown in the prompt of `denote-rename-file' etc."
+  :group 'denote-faces
+  :package-version '(denote . "2.2.0"))
+
+(defface denote-faces-prompt-current-name '((t :inherit 
denote-faces-prompt-old-name))
+  "Face for the current file shown in the prompt of `denote-rename-file' etc."
+  :group 'denote-faces
+  :package-version '(denote . "2.2.0"))
+
 ;;;; Fontification in Dired
 
 (defgroup denote-dired ()



reply via email to

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