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

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

[elpa] externals/denote b7eb017b02 1/5: Update docstrings and README.org


From: ELPA Syncer
Subject: [elpa] externals/denote b7eb017b02 1/5: Update docstrings and README.org about link descriptions
Date: Sat, 27 Jan 2024 00:57:38 -0500 (EST)

branch: externals/denote
commit b7eb017b02f36196999243af642efae4ab37f589
Author: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>
Commit: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>

    Update docstrings and README.org about link descriptions
---
 README.org           | 6 +++---
 denote-org-extras.el | 7 ++-----
 denote.el            | 7 +++----
 3 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/README.org b/README.org
index fc85dee467..734742a8cf 100644
--- a/README.org
+++ b/README.org
@@ -1820,8 +1820,8 @@ The ~denote-link~ command inserts a link at point to a 
file specified
 at the minibuffer prompt ([[#h:d99de1fb-b1b7-4a74-8667-575636a4d6a4][The 
~denote-org-store-link-to-heading~ user option]]).
 Links are formatted depending on the file type of the current note. In
 Org and plain text buffers, links are formatted thus:
-=[[denote:IDENTIFIER][TITLE]]=. While in Markdown they are expressed
-as =[TITLE](denote:IDENTIFIER)=.
+=[[denote:IDENTIFIER][DESCRIPTION]]=. While in Markdown they are expressed
+as =[DESCRIPTION](denote:IDENTIFIER)=.
 
 When ~denote-link~ is called with a prefix argument (=C-u= by
 default), it formats links like =[[denote:IDENTIFIER]]=.  The user
@@ -1920,7 +1920,7 @@ As part of the optional =denote-org-extras.el= extension, 
the command
 ~denote-org-extras-link-to-heading~ prompts for a link to an Org file
 and then asks for a heading therein, using minibuffer completion. Once
 the user provides input at the two prompts, the command inserts a link
-at point which has the following pattern: 
=[[denote:IDENTIFIER::#ORG-HEADING-CUSTOM-ID]][File title::Heading text]]=.
+at point which has the following pattern: 
=[[denote:IDENTIFIER::#ORG-HEADING-CUSTOM-ID]][Description::Heading text]]=.
 
 Because only Org files can have links to individual headings, the
 command ~denote-org-extras-link-to-heading~ prompts only for Org files
diff --git a/denote-org-extras.el b/denote-org-extras.el
index 260973e46d..e0f1eb90e2 100644
--- a/denote-org-extras.el
+++ b/denote-org-extras.el
@@ -77,10 +77,7 @@ the current file."
       (cons (denote-link-ol-get-heading) (denote-link-ol-get-id)))))
 
 (defun denote-org-extras-format-link-with-heading (file heading-id description)
-  "Prepare link to FILE with HEADING-ID using DESCRIPTION.
-
-FILE-TYPE and ID-ONLY are used to get the format of the link.
-See the `:link' property of `denote-file-types'."
+  "Prepare link to FILE with HEADING-ID using DESCRIPTION."
   (format "[[denote:%s::#%s][%s]]"
           (denote-retrieve-filename-identifier file)
           heading-id
@@ -92,7 +89,7 @@ See the `:link' property of `denote-file-types'."
 
 The resulting link has the following pattern:
 
-[[denote:IDENTIFIER::#ORG-HEADING-CUSTOM-ID]][File title::Heading text]].
+[[denote:IDENTIFIER::#ORG-HEADING-CUSTOM-ID]][Description::Heading text]].
 
 Because only Org files can have links to individual headings,
 limit the list of possible files to those which include the .org
diff --git a/denote.el b/denote.el
index f2263c4ff8..1f0841cddc 100644
--- a/denote.el
+++ b/denote.el
@@ -4118,17 +4118,16 @@ create a new one."
 Also see the user option `denote-org-store-link-to-heading'."
   (when-let ((file (buffer-file-name))
              ((denote-file-is-note-p file))
-             (file-type (denote-filetype-heuristics file))
              (file-id (denote-retrieve-filename-identifier file))
-             (file-title (denote--link-get-description file)))
+             (description (denote--link-get-description file)))
     (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
                         (denote-link-format-heading-description
-                         (denote--link-get-description file)
+                         description
                          (denote-link-ol-get-heading))
-                      file-title)
+                      description)
        :link (if heading-links
                  (format "denote:%s::#%s" file-id (denote-link-ol-get-id))
                (concat "denote:" file-id)))



reply via email to

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