[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote b8d1ae3e68 1/3: Make denote-link--prepare-backli
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote b8d1ae3e68 1/3: Make denote-link--prepare-backlinks accept files-matching-regexp parameter |
Date: |
Sat, 11 May 2024 03:57:43 -0400 (EDT) |
branch: externals/denote
commit b8d1ae3e6805b2aea8d0e0c9be4d1c805836505a
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Make denote-link--prepare-backlinks accept files-matching-regexp parameter
---
denote.el | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/denote.el b/denote.el
index d85ab77881..01ca4c5fd9 100644
--- a/denote.el
+++ b/denote.el
@@ -4015,9 +4015,12 @@ matching identifiers."
(unless denote-backlinks-show-context
(font-lock-add-keywords nil denote-faces-file-name-keywords t)))
-(defun denote-link--prepare-backlinks (query &optional buffer-name
display-buffer-action)
+(defun denote-link--prepare-backlinks (query &optional files-matching-regexp
buffer-name display-buffer-action)
"Create backlinks' buffer called BUFFER-NAME for the current file matching
QUERY.
+With optional FILES-MATCHING-REGEXP, limit the list of files
+accordingly (per `denote-directory-files').
+
Optional DISPLAY-BUFFER-ACTION is a `display-buffer' action and
concomitant alist, such as `denote-link-backlinks-display-buffer-action'."
(let* ((inhibit-read-only t)
@@ -4028,7 +4031,10 @@ concomitant alist, such as
`denote-link-backlinks-display-buffer-action'."
;; automatically in relative form, but eventually notes may
;; not be all under a common directory (or project).
(xref-file-name-display 'abs)
- (xref-alist (xref--analyze (xref-matches-in-files query
(denote-directory-files nil :omit-current :text-only))))
+ (xref-alist (xref--analyze
+ (xref-matches-in-files
+ query
+ (denote-directory-files files-matching-regexp
:omit-current :text-only))))
(dir (denote-directory)))
(unless xref-alist
(error "No backlinks for query `%s'" query))
@@ -4083,7 +4089,7 @@ Place the buffer below the current window or wherever the
user option
(interactive)
(if-let ((file buffer-file-name))
(when-let ((id (denote-retrieve-filename-identifier-with-error file)))
- (denote-link--prepare-backlinks id (denote--backlinks-get-buffer-name
file id)))
+ (denote-link--prepare-backlinks id nil
(denote--backlinks-get-buffer-name file id)))
(user-error "Buffer `%s' is not associated with a file" (current-buffer))))
(define-obsolete-function-alias