[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote 1386a6339c 2/2: Change the default style of the
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote 1386a6339c 2/2: Change the default style of the backlinks indicator of denote-rename-buffer-mode |
Date: |
Wed, 28 Aug 2024 06:57:46 -0400 (EDT) |
branch: externals/denote
commit 1386a6339ca696cd1bf9985e884ba04e1addd7f0
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Change the default style of the backlinks indicator of
denote-rename-buffer-mode
---
README.org | 20 +++++++++++++-------
denote-rename-buffer.el | 11 +++++++----
2 files changed, 20 insertions(+), 11 deletions(-)
diff --git a/README.org b/README.org
index 8b1783ef80..a573f7b704 100644
--- a/README.org
+++ b/README.org
@@ -3152,7 +3152,7 @@ buffer-to-be-renamed.
The value of this user option is a string. The following specifiers
are placeholders for Denote file name components
([[#h:4e9c7512-84dc-4dfb-9fa9-e15d51178e5d][The file-naming scheme]]):
-#+vindex: denote-buffer-has-backlinks-string
+#+vindex: denote-rename-buffer-backlinks-indicator
- The =%t= is the Denote =TITLE= of the file.
- The =%i= is the Denote =IDENTIFIER= of the file.
- The =%d= is the same as =%i= (=DATE= mnemonic).
@@ -3160,6 +3160,7 @@ are placeholders for Denote file name components
([[#h:4e9c7512-84dc-4dfb-9fa9-e
- The =%k= is the Denote =KEYWORDS= of the file.
- The =%b= is an indicator of whether or not the file has backlinks
pointing to it. The indicator string is defined in the user option
+ ~denote-rename-buffer-backlinks-indicator~, alias
~denote-buffer-has-backlinks-string~ [ Part of {{{development-version}}} ].
- The =%%= is a literal percent sign.
@@ -3181,16 +3182,21 @@ include some text that makes Denote buffers stand out,
such as
a =[D]= prefix. Examples:
#+begin_src emacs-lisp
-;; Use the title prefixed with the backlink indicator (default)
-(setq denote-rename-buffer-format "%b%t")
+;; Use the title prefixed with the backlink indicator (default).
+(setq denote-rename-buffer-format "%t %b")
-;; Customize what the backlink indicator looks like
-(setq denote-buffer-has-backlinks-string "!! ")
+;; Customize what the backlink indicator looks like. This two-faced
+;; arrow is the default.
+(setq denote-rename-buffer-backlinks-indicator "<-->")
-;; Use the title and keywords with some emoji in between
+;; Use just the title and keywords with some emoji in between, because
+;; why not?
(setq denote-rename-buffer-format "%t 🤨 %k")
-;; Use the title with a literal "[D]" before it
+;; Use the title with a literal "[D]" before it.
+(setq denote-rename-buffer-format "[D] %t")
+
+;; As above, but also add the `denote-rename-buffer-backlinks-indicator' at
the end.
(setq denote-rename-buffer-format "[D] %t")
#+end_src
diff --git a/denote-rename-buffer.el b/denote-rename-buffer.el
index 655528ab38..4337712f4e 100644
--- a/denote-rename-buffer.el
+++ b/denote-rename-buffer.el
@@ -38,23 +38,26 @@
:link '(info-link "(denote) Top")
:link '(url-link :tag "Homepage" "https://protesilaos.com/emacs/denote"))
-(defcustom denote-buffer-has-backlinks-string "-> "
+(defvaralias 'denote-buffer-has-backlinks-string
'denote-rename-buffer-backlinks-indicator
+ "Alias for `denote-rename-buffer-backlinks-indicator'.")
+
+(defcustom denote-rename-buffer-backlinks-indicator "<-->"
"A string used to indicate that a buffer has backlinks pointing to it."
:type 'string
:package-version '(denote . "3.1.0")
:group 'denote-rename-buffer)
-(defcustom denote-rename-buffer-format "%b%t"
+(defcustom denote-rename-buffer-format "%t %b"
"The format of the buffer name `denote-rename-buffer' should use.
Thie value is a string that treats specially the following
specifiers:
-- The %b inserts `denote-buffer-has-backlinks-string'.
- The %t is the Denote TITLE of the file.
- The %i is the Denote IDENTIFIER of the file.
- The %d is the same as %i (DATE mnemonic).
- The %s is the Denote SIGNATURE of the file.
- The %k is the Denote KEYWORDS of the file.
+- The %b inserts `denote-rename-buffer-backlinks-indicator'.
- The %% is a literal percent sign.
In addition, the following flags are available for each of the specifiers:
@@ -107,7 +110,7 @@ buffer will be used, if available."
((denote-retrieve-front-matter-title-value
file type))
((denote-retrieve-filename-title file))
(t "")))
- (cons ?b (if should-show-backlink-indicator
denote-buffer-has-backlinks-string ""))
+ (cons ?b (if should-show-backlink-indicator
denote-rename-buffer-backlinks-indicator ""))
(cons ?i (or (denote-retrieve-filename-identifier
file) ""))
(cons ?d (or (denote-retrieve-filename-identifier
file) ""))
(cons ?s (or (denote-retrieve-filename-signature
file) ""))