[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote 71051c85f2 2/8: Make denote--link-get-descriptio
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote 71051c85f2 2/8: Make denote--link-get-description-with-signature work with selected region |
Date: |
Mon, 16 Oct 2023 09:57:52 -0400 (EDT) |
branch: externals/denote
commit 71051c85f23577db7bf3f0b368ca43e87f8dbabb
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Make denote--link-get-description-with-signature work with selected region
---
denote.el | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/denote.el b/denote.el
index 670ad11193..85c6fa1581 100644
--- a/denote.el
+++ b/denote.el
@@ -2856,7 +2856,9 @@ retrieved from the FILE, unless the FORMAT is
"Return description for `denote-link'.
If the region is active, make the description the text within the
region's boundaries. Else retrieve the title from FILE, given
-FILE-TYPE."
+FILE-TYPE.
+
+Also see `denote--link-get-description-with-signature'."
(if-let (((region-active-p))
(beg (region-beginning))
(end (region-end))
@@ -2916,14 +2918,19 @@ treats the active region specially, is up to it."
(defun denote--link-get-description-with-signature (file file-type)
"Return `denote-link-with-signature' description.
-Retrieve the title and signature from FILE with FILE-TYPE."
+Retrieve the title and signature from FILE with FILE-TYPE. If
+the region is active, use it to describe the link instead of the
+file's title. Make the signature a prefix. If there is no title
+or text in the active region, return the signature on its own.
+
+Also see `denote--link-get-description'."
(let* ((signature (denote-retrieve-filename-signature file))
- (title (denote-retrieve-title-value file file-type))
- (specifiers (if (and title
- (not (string-empty-p title)))
+ (text (denote--link-get-description file file-type))
+ (specifiers (if (and text
+ (not (string-empty-p text)))
"%s %s"
"%s")))
- (format specifiers signature title)))
+ (format specifiers signature text)))
;;;###autoload
(defun denote-link-with-signature ()
- [elpa] externals/denote updated (7caf1a62db -> 0eacf6673f), ELPA Syncer, 2023/10/16
- [elpa] externals/denote 8b467e7d6e 4/8: Remove last asterisk from 'when-let' (same as e1fe14d), ELPA Syncer, 2023/10/16
- [elpa] externals/denote 71051c85f2 2/8: Make denote--link-get-description-with-signature work with selected region,
ELPA Syncer <=
- [elpa] externals/denote 5d274c825d 1/8: Fix error with denote-journal-extras-title-format=nil, ELPA Syncer, 2023/10/16
- [elpa] externals/denote e1fe14d447 3/8: Remove the needless asterisk from 'if-let' and 'when-let', ELPA Syncer, 2023/10/16
- [elpa] externals/denote c3530e1a5e 6/8: Make backlinks motions return user-error outside their buffer, ELPA Syncer, 2023/10/16
- [elpa] externals/denote b3e500926f 5/8: Remove two very old 'make-obsolete-variable', ELPA Syncer, 2023/10/16
- [elpa] externals/denote 0eacf6673f 8/8: Clarify the documentation of 'denote-backlinks-{next, prev}', ELPA Syncer, 2023/10/16
- [elpa] externals/denote f71762a2d7 7/8: Remove needless &optional from 'denote-backlinks-{next, prev}', ELPA Syncer, 2023/10/16