[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote eaa00f2fd4 24/32: Make denote-link-description-w
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote eaa00f2fd4 24/32: Make denote-link-description-with-signature-and-title return the active region even if empty |
Date: |
Sat, 20 Jan 2024 00:57:43 -0500 (EST) |
branch: externals/denote
commit eaa00f2fd4596078357b34a1fa2647c5912882da
Author: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>
Commit: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>
Make denote-link-description-with-signature-and-title return the active
region even if empty
---
README.org | 11 ++++++-----
denote.el | 13 ++++++++-----
2 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/README.org b/README.org
index 2190bc6a5e..cf1c69a46d 100644
--- a/README.org
+++ b/README.org
@@ -1745,11 +1745,12 @@ When ~denote-link~ is called with a prefix argument
(=C-u= by
default), it formats links like =[[denote:IDENTIFIER]]=. The user
might prefer its simplicity.
-The description of the link is taken from the target file's front
-matter or, if that is not available, from the file name. If the
-region is active, its text is used as the link's description instead.
-If the active region has no text, the inserted link uses just the
-identifier, as with the =C-u= prefix mentioned above.
+By default, the description of the link is taken from the signature of
+the file, if present, and the target file's front matter's title or, if
+that is not available, from the file name. If the region is active, its
+text is used as the link's description instead. If the active region
+has no text, the inserted link uses just the identifier, as with the
+=C-u= prefix mentioned above.
Inserted links are automatically buttonized and remain active for as
long as the buffer is available. In Org this is handled by the major
diff --git a/denote.el b/denote.el
index 11cc23eb2d..2f962e13d0 100644
--- a/denote.el
+++ b/denote.el
@@ -3204,16 +3204,16 @@ file is returned as the description.")
(defun denote-link-description-with-signature-and-title (file region-text)
"Return description from FILE as \"signature title\".
-If REGION-TEXT is not empty (or nil), the description is the text
-of the active region instead.
+If REGION-TEXT is non-nil, the description is the text of the
+active region instead.
The format is specified in variable
-`denote--link-signature-format'. If a signature is not present,
+`denote--link-signature-format'. If a signature is not present,
only the title is returned."
(let* ((file-type (denote-filetype-heuristics file))
(signature (denote-retrieve-filename-signature file))
(title (denote--retrieve-title-or-filename file file-type)))
- (cond ((and region-text (not (string-empty-p region-text)))
+ (cond (region-text
region-text)
(signature
(format denote--link-signature-format signature title))
@@ -3257,7 +3257,10 @@ With optional ID-ONLY as a non-nil argument, such as
with a
universal prefix (\\[universal-argument]), insert links with just
the identifier and no further description. In this case, the
link format is always [[denote:IDENTIFIER]]. If the DESCRIPTION
-is empty, the link is also as if ID-ONLY were non-nil.
+is empty, the link is also as if ID-ONLY were non-nil. The
+default value of `denote-link-description-function' returns an
+empty string when the region is empty. Thus, the link will have
+no description in this case.
When called from Lisp, FILE is a string representing a full file
system path. FILE-TYPE is a symbol as described in
- [elpa] externals/denote ae11205800 01/32: Add user option and concomitant functionality to link to Org headings, (continued)
- [elpa] externals/denote ae11205800 01/32: Add user option and concomitant functionality to link to Org headings, ELPA Syncer, 2024/01/20
- [elpa] externals/denote 034427006d 03/32: Rename the function that returns an Org heading ID, ELPA Syncer, 2024/01/20
- [elpa] externals/denote 2ffc70bc29 06/32: Fix typo in the manual, ELPA Syncer, 2024/01/20
- [elpa] externals/denote c650b9901d 08/32: Add user option and concomitant functionality to link to Org headings, ELPA Syncer, 2024/01/20
- [elpa] externals/denote ad4532e2fc 09/32: Make links to Org headings only work for Org, ELPA Syncer, 2024/01/20
- [elpa] externals/denote 4651a880d6 10/32: Rename the function that returns an Org heading ID, ELPA Syncer, 2024/01/20
- [elpa] externals/denote 94168f2fd5 16/32: Add missing vindex for denote-org-store-link-to-heading, ELPA Syncer, 2024/01/20
- [elpa] externals/denote e026e60fd9 18/32: Update denote-org-store-link-to-heading doc to mention org-insert-link, ELPA Syncer, 2024/01/20
- [elpa] externals/denote 158d94735f 19/32: Expand denote-org-link-to-heading doc string to explain some technicalities, ELPA Syncer, 2024/01/20
- [elpa] externals/denote 6a1e7a11d1 22/32: Add denote--remove-dot-characters and denote--trim-right-token-characters and use them in denote-sluggify, ELPA Syncer, 2024/01/20
- [elpa] externals/denote eaa00f2fd4 24/32: Make denote-link-description-with-signature-and-title return the active region even if empty,
ELPA Syncer <=
- [elpa] externals/denote 524203e403 25/32: Make org-store-link also capture the heading text as part of the description, ELPA Syncer, 2024/01/20
- [elpa] externals/denote 0d27b6ef20 12/32: Rename user option to denote-org-store-link-to-heading and document it better, ELPA Syncer, 2024/01/20
- [elpa] externals/denote 3e6bf5be6c 21/32: Use denote-link-ol-get-heading instead of the underlying Org function, ELPA Syncer, 2024/01/20
- [elpa] externals/denote d21e5e0644 31/32: Merge pull request #227 from jeanphilippegg/fix-denote--trim-right-token-characters, ELPA Syncer, 2024/01/20
- [elpa] externals/denote 48b8abc43d 29/32: Merge pull request #226 from jeanphilippegg/empty-region-and-links, ELPA Syncer, 2024/01/20
- [elpa] externals/denote a4f11d3a77 32/32: Simplify regexp in denote--trim-right-token-characters, ELPA Syncer, 2024/01/20
- [elpa] externals/denote 3319970d08 02/32: Make links to Org headings only work for Org, ELPA Syncer, 2024/01/20
- [elpa] externals/denote 2957fe832d 04/32: Expand the documentation of user option to link to Org heading, ELPA Syncer, 2024/01/20
- [elpa] externals/denote 10b9b984e4 07/32: Add denote--completion-table-no-sort, ELPA Syncer, 2024/01/20
- [elpa] externals/denote cc393d7616 05/32: Rename user option to denote-org-store-link-to-heading and document it better, ELPA Syncer, 2024/01/20