[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote 303f39e150 15/27: Merge pull request #26 from gg
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote 303f39e150 15/27: Merge pull request #26 from ggjp/subdir-support |
Date: |
Sun, 3 Jul 2022 00:57:35 -0400 (EDT) |
branch: externals/denote
commit 303f39e15052f0755953b4bd50b5648dd2e06889
Merge: 53e6ca2299 66e455ef84
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: GitHub <noreply@github.com>
Merge pull request #26 from ggjp/subdir-support
Fix links in non org notes
---
denote-link.el | 14 +++++++-------
denote.el | 8 +++++++-
2 files changed, 14 insertions(+), 8 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..26f0168c34 100644
--- a/denote.el
+++ b/denote.el
@@ -327,7 +327,7 @@ FILE must be an absolute path."
"Return non-nil if current file likely is a Denote note."
(and (or (string-match-p denote--id-regexp (buffer-file-name))
(string-match-p denote--id-regexp (buffer-name)))
- (string= (expand-file-name default-directory) (denote-directory))))
+ (string-prefix-p (denote-directory) (expand-file-name
default-directory))))
;;;; Keywords
@@ -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 12008dbcbf 11/27: Untabify a line, (continued)
- [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
- [elpa] externals/denote 66e455ef84 14/27: Fix denote--current-file-is-note-p for subdirectories, ELPA Syncer, 2022/07/03
- [elpa] externals/denote 6dfb9376ca 24/27: Merge pull request #28 from ggjp/subdir-support, ELPA Syncer, 2022/07/03
- [elpa] externals/denote 25e86bf0bc 27/27: Update Acknowledgements in the manual, ELPA Syncer, 2022/07/03
- [elpa] externals/denote 303f39e150 15/27: Merge pull request #26 from ggjp/subdir-support,
ELPA Syncer <=
- [elpa] externals/denote c020d25a21 08/27: Fix denote-link--ol-resolve-link-to-target, ELPA Syncer, 2022/07/03
- [elpa] externals/denote ab2a6e538a 03/27: Use 'when' instead of 'if' for single condition, ELPA Syncer, 2022/07/03
- [elpa] externals/denote 0116edc2f8 25/27: Remove sharp quote from lambda for simplicity, ELPA Syncer, 2022/07/03
- [elpa] externals/denote c68a8e224a 17/27: Tweak denote--get-note-path-by-id for style, ELPA Syncer, 2022/07/03
- [elpa] externals/denote d2f14291bf 06/27: Move let bound filter into its own function, ELPA Syncer, 2022/07/03
- [elpa] externals/denote 2aaf0f56d1 05/27: Add regexp to match only note file names, ELPA Syncer, 2022/07/03
- [elpa] externals/denote 3934b167d2 16/27: Placate the compiler for minor warnings, ELPA Syncer, 2022/07/03
- [elpa] externals/denote fa395f7aef 02/27: Update Acknowledgements for subdir support, ELPA Syncer, 2022/07/03
- [elpa] externals/denote 554859c0c8 21/27: Keep Acknowledgements up-to-date after eb7b38f, ELPA Syncer, 2022/07/03
- [elpa] externals/denote eb7b38fe16 20/27: Merge branch 'main' into subdir-support, ELPA Syncer, 2022/07/03