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

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

[elpa] externals/denote 7de413b1ea 1/2: Make denote-link-description-fun


From: ELPA Syncer
Subject: [elpa] externals/denote 7de413b1ea 1/2: Make denote-link-description-function require a function with only one argument
Date: Sat, 24 Feb 2024 06:57:49 -0500 (EST)

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

    Make denote-link-description-function require a function with only one 
argument
---
 README.org |  8 ++++----
 denote.el  | 11 +++++------
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/README.org b/README.org
index 12c406b082..789a81bfc8 100644
--- a/README.org
+++ b/README.org
@@ -4563,12 +4563,12 @@ might change them without further notice.
 
 #+findex: denote-link-description-with-signature-and-title
 + Function ~denote-link-description-with-signature-and-title~ :: Return
-  link description for =FILE=. With optional =REGION-TEXT= as a
-  string, make that the description. Otherwise, produce a description
-  as follows:
+  link description for =FILE=.  Produce a description as follows:
+
+- If the region is active, use it as the description.
 
 - If =FILE= as a signature, then use the
-  ~denote-link-signature-format~. By default, this looks like
+  ~denote-link-signature-format~.  By default, this looks like
   "signature title".
 
 - If =FILE= does not have a signature, then use its title as the
diff --git a/denote.el b/denote.el
index ce84db8b6e..92b246d320 100644
--- a/denote.el
+++ b/denote.el
@@ -3445,14 +3445,12 @@ file is returned as the description.")
   "Return link description for FILE."
   (funcall
    (or denote-link-description-function 
#'denote-link-description-with-signature-and-title)
-   file
-   (denote--get-active-region-content)))
+   file))
 
-(defun denote-link-description-with-signature-and-title (file &optional 
region-text)
+(defun denote-link-description-with-signature-and-title (file)
   "Return link description for FILE.
 
-With optional REGION-TEXT as a string, make that the description.
-Otherwise, produce a description as follows:
+- If the region is active, use it as the description.
 
 - If FILE as a signature, then use the `denote-link-signature-format'.
   By default, this looks like \"signature   title\".
@@ -3461,7 +3459,8 @@ Otherwise, produce a description as follows:
   description."
   (let* ((file-type (denote-filetype-heuristics file))
          (signature (denote-retrieve-filename-signature file))
-         (title (denote--retrieve-title-or-filename file file-type)))
+         (title (denote--retrieve-title-or-filename file file-type))
+         (region-text (denote--get-active-region-content)))
     (cond (region-text
            region-text)
           (signature



reply via email to

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