[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote e0f1d471d5: Define variable that can be let boun
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote e0f1d471d5: Define variable that can be let bound to limit 'denote-file-prompt' |
Date: |
Tue, 21 Jan 2025 03:57:55 -0500 (EST) |
branch: externals/denote
commit e0f1d471d561b157b64f7b2c139182fa1ee6b556
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Define variable that can be let bound to limit 'denote-file-prompt'
This is in response to a question by Alan Schmitt in issue 536:
<https://github.com/protesilaos/denote/issues/536>. Also thanks to
Jean-Philippe Gagné Guay for the comment about whether this is a
useful feature.
---
denote.el | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/denote.el b/denote.el
index 91e901faef..b22b5aa10a 100644
--- a/denote.el
+++ b/denote.el
@@ -1410,6 +1410,11 @@ The path is relative to DIRECTORY (default:
‘default-directory’)."
This is used for retrieving a value that is used to set a new default at
the title prompt of `denote-open-or-create' and related commands.")
+(defvar denote-file-prompt-use-files-matching-regexp nil
+ "The `denote-file-prompt' FILES-MATCHING-REGEXP value.
+Only ever `let' bind this, otherwise the restriction will always be
+there.")
+
(defun denote-file-prompt (&optional files-matching-regexp prompt-text
no-require-match)
"Prompt for file in variable `denote-directory'.
Files that match `denote-excluded-files-regexp' are excluded from the
@@ -1425,8 +1430,11 @@ With optional NO-REQUIRE-MATCH, accept the given input
as-is.
Return the absolute path to the matching file."
(let* ((default-directory (denote-directory))
- (relative-files (mapcar
#'denote-get-file-name-relative-to-denote-directory
- (denote-directory-files files-matching-regexp
:omit-current)))
+ (relative-files (mapcar
+ #'denote-get-file-name-relative-to-denote-directory
+ (denote-directory-files
+ (or denote-file-prompt-use-files-matching-regexp
files-matching-regexp)
+ :omit-current)))
(prompt (format "%s in %s: "
(or prompt-text "Select FILE")
(propertize (denote-directory) 'face
'denote-faces-prompt-current-name)))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] externals/denote e0f1d471d5: Define variable that can be let bound to limit 'denote-file-prompt',
ELPA Syncer <=