[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote e5d6ad589b 13/27: Support subdirectories in deno
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote e5d6ad589b 13/27: Support subdirectories in denote--link-find-file-at-button |
Date: |
Sun, 3 Jul 2022 00:57:35 -0400 (EDT) |
branch: externals/denote
commit e5d6ad589badbc5b9f7ab23da76c68fdcdafb206
Author: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>
Commit: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>
Support subdirectories in denote--link-find-file-at-button
Clicking on a link in a non org note should work.
---
denote-link.el | 14 +++++++-------
denote.el | 6 ++++++
2 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/denote-link.el b/denote-link.el
index 3305bddfe1..d75823b15b 100644
--- a/denote-link.el
+++ b/denote-link.el
@@ -386,11 +386,12 @@ format is always [[denote:IDENTIFIER]]."
(defun denote-link--find-file-at-button (button)
"Visit file referenced by BUTTON."
- (let ((id (denote-link--id-from-string
- (buffer-substring-no-properties
- (button-start button)
- (button-end button)))))
- (funcall denote-link-buton-action (file-name-completion id
(denote-directory)))))
+ (let* ((id (denote-link--id-from-string
+ (buffer-substring-no-properties
+ (button-start button)
+ (button-end button))))
+ (file (denote--get-note-path-by-id id)))
+ (funcall denote-link-buton-action file)))
;;;###autoload
(defun denote-link-buttonize-buffer (&optional beg end)
@@ -557,8 +558,7 @@ and the identifier."
(id (if (and (stringp search) (not (string-empty-p search)))
(substring link 0 (match-beginning 0))
link))
- (path (cl-find-if (lambda (f) (string-prefix-p id
(file-name-nondirectory f)))
- (denote--directory-files :absolute))))
+ (path (denote--get-note-path-by-id id)))
(cond
(path-id
(cons (format "%s" path) (format "%s" id)))
diff --git a/denote.el b/denote.el
index f57ce463e0..21a8ce19ac 100644
--- a/denote.el
+++ b/denote.el
@@ -352,6 +352,12 @@ names that are relative to the variable
`denote-directory'."
(lambda (s) (denote--file-name-relative-to-denote-directory s))
files))))
+(defun denote--get-note-path-by-id(id)
+ "Given an ID, return the absolute path of the corresponding note
+in `denote-directory'."
+ (cl-find-if (lambda (f) (string-prefix-p id (file-name-nondirectory f)))
+ (denote--directory-files :absolute)))
+
(defun denote--directory-files-matching-regexp (regexp &optional
no-check-current)
"Return list of files matching REGEXP.
With optional NO-CHECK-CURRENT do not test if the current file is
- [elpa] externals/denote updated (2193501cef -> 25e86bf0bc), ELPA Syncer, 2022/07/03
- [elpa] externals/denote e5d6ad589b 13/27: Support subdirectories in denote--link-find-file-at-button,
ELPA Syncer <=
- [elpa] externals/denote 53e6ca2299 12/27: Tweak filename fontification to work with subdirs, ELPA Syncer, 2022/07/03
- [elpa] externals/denote 58637a0035 04/27: Tweak doc string, ELPA Syncer, 2022/07/03
- [elpa] externals/denote 8c724d54cf 01/27: Support subdirectories, ELPA Syncer, 2022/07/03
- [elpa] externals/denote 12008dbcbf 11/27: Untabify a line, ELPA Syncer, 2022/07/03
- [elpa] externals/denote 01618516ff 07/27: Refine denote--file-name-relative-to-denote-directory, ELPA Syncer, 2022/07/03
- [elpa] externals/denote 070d4412ee 23/27: Set org-id-extra-files to all files in all subdirectories., ELPA Syncer, 2022/07/03
- [elpa] externals/denote add8f657bb 09/27: Merge pull request #25 from ggjp/subdir-support, ELPA Syncer, 2022/07/03
- [elpa] externals/denote 5f8b585349 22/27: Merge branch 'main' into subdir-support, ELPA Syncer, 2022/07/03
- [elpa] externals/denote e1aeb459ea 19/27: Refine how faces are applied (extends 123fb2b), ELPA Syncer, 2022/07/03
- [elpa] externals/denote 123fb2b670 18/27: Put all faces in denote-faces.el, ELPA Syncer, 2022/07/03