[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote 524203e403 25/32: Make org-store-link also captu
|
From: |
ELPA Syncer |
|
Subject: |
[elpa] externals/denote 524203e403 25/32: Make org-store-link also capture the heading text as part of the description |
|
Date: |
Sat, 20 Jan 2024 00:57:43 -0500 (EST) |
branch: externals/denote
commit 524203e4035245c9ad178f5d8e71d23ffb70ce55
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Make org-store-link also capture the heading text as part of the description
This is subject to the new user option denote-org-store-link-to-heading,
which defaults to a non-nil value.
---
README.org | 5 +++--
denote.el | 30 +++++++++++++++++++-----------
2 files changed, 22 insertions(+), 13 deletions(-)
diff --git a/README.org b/README.org
index 41390661ca..316a79f623 100644
--- a/README.org
+++ b/README.org
@@ -1801,10 +1801,11 @@ pointing to the identifier of the current file, plus
the value of the
heading's =CUSTOM_ID=, such as:
- =[[denote:20240118T060608][Some test]]=
-- =[[denote:20240118T060608::#h:eed0fb8e-4cc7-478f-acb6-f0aa1a8bffcd][Some
test]]=
+- =[[denote:20240118T060608::#h:eed0fb8e-4cc7-478f-acb6-f0aa1a8bffcd][Some
test::Heading text]]=
Both lead to the same Denote file, but the latter jumps to the heading
-with the given =CUSTOM_ID=.
+with the given =CUSTOM_ID=. Notice that the link to the heading also
+has a different description, which includes the heading text.
The value of the =CUSTOM_ID= is determined by the Org user option
~org-id-method~. The sample shown above uses the default UUID
diff --git a/denote.el b/denote.el
index 96717749ac..e8b140ade2 100644
--- a/denote.el
+++ b/denote.el
@@ -375,14 +375,18 @@ pointing to the identifier of the current file, plus the
value of
the heading's CUSTOM_ID, such as:
- [[denote:20240118T060608][Some test]]
-- [[denote:20240118T060608::#h:eed0fb8e-4cc7-478f-acb6-f0aa1a8bffcd][Some
test]]
+- [[denote:20240118T060608::#h:eed0fb8e-4cc7-478f][Some test::Heading text]]
-Both lead to the same Denote file, but the latter jumps to the heading
-with the given CUSTOM_ID.
+Both lead to the same Denote file, but the latter jumps to the
+heading with the given CUSTOM_ID. Notice that the link to the
+heading also has a different description, which includes the
+heading text.
The value of the CUSTOM_ID is determined by the Org user option
`org-id-method'. The sample shown above uses the default UUID
-infrastructure.
+infrastructure (though I deleted a few characters to not get
+complaints from the byte compiler about long lines in the doc
+string...).
If this user option is set to nil, only store links to the Denote
file (using its identifier), but not to the given heading. This
@@ -4049,13 +4053,17 @@ Also see the user option
`denote-org-store-link-to-heading'."
(file-type (denote-filetype-heuristics file))
(file-id (denote-retrieve-filename-identifier file))
(file-title (denote--retrieve-title-or-filename file file-type)))
- (org-link-store-props
- :type "denote"
- :description file-title
- :link (if (and denote-org-store-link-to-heading (derived-mode-p
'org-mode))
- (format "denote:%s::#%s" file-id (denote-link-ol-get-id))
- (concat "denote:" file-id)))
- org-store-link-plist))
+ (let ((heading-links (and denote-org-store-link-to-heading (derived-mode-p
'org-mode))))
+ (org-link-store-props
+ :type "denote"
+ :description
+ (if heading-links
+ (format "%s::%s" file-title (denote-link-ol-get-heading))
+ file-title)
+ :link (if heading-links
+ (format "denote:%s::#%s" file-id (denote-link-ol-get-id))
+ (concat "denote:" file-id)))
+ org-store-link-plist)))
;;;###autoload
(defun denote-link-ol-export (link description format)
- [elpa] externals/denote 034427006d 03/32: Rename the function that returns an Org heading ID, (continued)
- [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, 2024/01/20
- [elpa] externals/denote 524203e403 25/32: Make org-store-link also capture the heading text as part of the description,
ELPA Syncer <=
- [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
- [elpa] externals/denote 10d332bb29 11/32: Expand the documentation of user option to link to Org heading, ELPA Syncer, 2024/01/20