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

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

[elpa] externals/denote 84f2f28764 07/10: Add documentation for a global


From: ELPA Syncer
Subject: [elpa] externals/denote 84f2f28764 07/10: Add documentation for a global denote-link
Date: Mon, 20 May 2024 00:57:53 -0400 (EDT)

branch: externals/denote
commit 84f2f287643c883f1c839d053f490578107f6d52
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    Add documentation for a global denote-link
    
    Thanks to Alexis Purslane for suggesting this idea in issue 364:
    <https://github.com/protesilaos/denote/issues/364>.
---
 README.org | 50 ++++++++++++++++++++++++++++++++++++--------------
 1 file changed, 36 insertions(+), 14 deletions(-)

diff --git a/README.org b/README.org
index 9b859594b8..2cf0475b54 100644
--- a/README.org
+++ b/README.org
@@ -2155,7 +2155,28 @@ The ~denote-link-buttonize-buffer~ is also an 
interactive function in
 case the user needs it.
 
 Links are created only for files which qualify as a "note" for our
-purposes ([[#h:fc913d54-26c8-4c41-be86-999839e8ad31][Linking notes]]).
+purposes ([[#h:fc913d54-26c8-4c41-be86-999839e8ad31][Linking notes]]). Users 
who need to link to Denote files from
+anywhere, can write a simple command to that effect:
+
+#+begin_src emacs-lisp
+(defun my-denote-link-global (file file-type description &optional id-only)
+  "Like the `denote-link', but works in any buffer.
+The FILE, FILE-TYPE, DESCRIPTION, and ID-ONLY have the same meaning as
+in `denote-link'."
+  (interactive
+   (let* ((file (denote-file-prompt nil "Link to FILE"))
+          (file-type (denote-filetype-heuristics buffer-file-name))
+          (description (when (file-exists-p file)
+                         (denote--link-get-description file))))
+     (list file file-type description current-prefix-arg)))
+  (unless (file-exists-p file)
+    (user-error "The linked file does not exists"))
+  (let ((beg (point)))
+    (denote--delete-active-region-content)
+    (insert (denote-format-link file description file-type id-only))
+    (unless (derived-mode-p 'org-mode)
+      (make-button beg (point) 'type 'denote-link-button))))
+#+end_src
 
 #+vindex: denote-faces-link
 Links are styled with the ~denote-faces-link~ face, which looks exactly
@@ -5483,19 +5504,20 @@ Denote is meant to be a collective effort.  Every bit 
of help matters.
   mentalisttraceur, pmenair, relict007.
 
 + Ideas and/or user feedback :: Abin Simon, Aditya Yadav, Alan
-  Schmitt, Aleksandr Vityazev, Alex Hirschfeld, Alfredo Borrás, Ashton
-  Wiersdorf, Benjamin Kästner, Claudiu Tănăselia, Colin McLear, Damien
-  Cassou, Elias Storms, Federico Stilman, Florian, Frédéric Willem
-  Frank Ehmsen, Glenna D., Guo Yong, Hanspeter Gisler Harold Ollivier,
-  Jack Baty, Jay Rajput, Jean-Charles Bagneris, Jens Östlund, Jeremy
-  Friesen, Jonathan Sahar, Johan Bolmsjö, Jousimies, Juanjo Presa,
-  Julian Hoch, Kai von Fintel, Kaushal Modi, Kolmas, M. Hadi Timachi,
-  Maikol Solis, Mark Olson, Mirko Hernandez, Niall Dooley, Paul van
-  Gelder, Peter Prevos, Peter Smith, Suhail Singh, Shreyas Ragavan,
-  Stefan Thesing, Summer Emacs, Sven Seebeck, Taoufik, TJ Stankus,
-  Vick (VicZz), Viktor Haag, Wade Mealing, Yi Liu, Ypot, atanasj,
-  babusri, doolio, duli, drcxd, fingerknight, hpgisler,
-  mentalisttraceur, pRot0ta1p, rbenit68, relict007, sienic, sundar bp.
+  Schmitt, Aleksandr Vityazev, Alex Hirschfeld, Alexis Purslane,
+  Alfredo Borrás, Ashton Wiersdorf, Benjamin Kästner, Claudiu
+  Tănăselia, Colin McLear, Damien Cassou, Elias Storms, Federico
+  Stilman, Florian, Frédéric Willem Frank Ehmsen, Glenna D., Guo Yong,
+  Hanspeter Gisler Harold Ollivier, Jack Baty, Jay Rajput,
+  Jean-Charles Bagneris, Jens Östlund, Jeremy Friesen, Jonathan Sahar,
+  Johan Bolmsjö, Jousimies, Juanjo Presa, Julian Hoch, Kai von Fintel,
+  Kaushal Modi, Kolmas, M. Hadi Timachi, Maikol Solis, Mark Olson,
+  Mirko Hernandez, Niall Dooley, Paul van Gelder, Peter Prevos, Peter
+  Smith, Suhail Singh, Shreyas Ragavan, Stefan Thesing, Summer Emacs,
+  Sven Seebeck, Taoufik, TJ Stankus, Vick (VicZz), Viktor Haag, Wade
+  Mealing, Yi Liu, Ypot, atanasj, babusri, doolio, duli, drcxd,
+  fingerknight, hpgisler, mentalisttraceur, pRot0ta1p, rbenit68,
+  relict007, sienic, sundar bp.
 
 Special thanks to Peter Povinec who helped refine the file-naming
 scheme, which is the cornerstone of this project.



reply via email to

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