[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote 2e444f3f22 03/12: BREAKING make 'denote-file-pro
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote 2e444f3f22 03/12: BREAKING make 'denote-file-prompt' accept optional regexp filter |
Date: |
Mon, 25 Sep 2023 09:58:14 -0400 (EDT) |
branch: externals/denote
commit 2e444f3f224797131506ac81c0cc62728c16af0e
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
BREAKING make 'denote-file-prompt' accept optional regexp filter
---
README.org | 6 ++++--
denote.el | 13 ++++++++-----
2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/README.org b/README.org
index f1215d4ca9..c13e3f0bf6 100644
--- a/README.org
+++ b/README.org
@@ -3662,8 +3662,10 @@ might change them without further notice.
#+findex: denote-file-prompt
+ Function ~denote-file-prompt~ :: Prompt for file with identifier in
- variable ~denote-directory~. With optional =INITIAL-TEXT=, use it
- to prepopulate the minibuffer.
+ variable ~denote-directory~. With optional =FILES-MATCHING-REGEXP=,
+ filter the candidates per the given regular expression. [ Refactored
+ as part of {{{development-version}}} because the old =INITIAL-INPUT=
+ argument was not actually used anywhere. ]
#+findex: denote-keywords-prompt
+ Function ~denote-keywords-prompt~ :: Prompt for one or more
diff --git a/denote.el b/denote.el
index 61a92d956b..a36eda6189 100644
--- a/denote.el
+++ b/denote.el
@@ -888,14 +888,17 @@ The path is relative to DIRECTORY (default:
‘default-directory’)."
(defvar denote--file-history nil
"Minibuffer history of `denote-file-prompt'.")
-(defun denote-file-prompt (&optional initial-text)
+(defun denote-file-prompt (&optional files-matching-regexp)
"Prompt for file with identifier in variable `denote-directory'.
-With optional INITIAL-TEXT, use it to prepopulate the minibuffer."
- (let* ((all-files (denote-all-files))
+With optional FILES-MATCHING-REGEXP, filter the candidates per
+the given regular expression."
+ (let* ((files (if files-matching-regexp
+ (denote-directory-files-matching-regexp
files-matching-regexp)
+ (denote-all-files)))
(completion-ignore-case read-file-name-completion-ignore-case))
- (when all-files
+ (when files
(funcall project-read-file-name-function
- "Select note: " all-files nil 'denote--file-history
initial-text))))
+ "Select note: " files nil 'denote--file-history))))
(define-obsolete-function-alias
'denote--retrieve-read-file-prompt
- [elpa] externals/denote updated (7a02653305 -> ccdcbfb7b7), ELPA Syncer, 2023/09/25
- [elpa] externals/denote 1d3ced4487 01/12: Fix typos in the manual about 'denote-link', ELPA Syncer, 2023/09/25
- [elpa] externals/denote 3a9404cd37 04/12: Add new denote-link-with-signature command, ELPA Syncer, 2023/09/25
- [elpa] externals/denote 2e444f3f22 03/12: BREAKING make 'denote-file-prompt' accept optional regexp filter,
ELPA Syncer <=
- [elpa] externals/denote 15bb6fe2f8 07/12: Make 'denote-command-prompt' return symbol, ELPA Syncer, 2023/09/25
- [elpa] externals/denote cc83083117 10/12: Add FIXME to avoid duplication with "link after creating" commands, ELPA Syncer, 2023/09/25
- [elpa] externals/denote f74c6380d3 08/12: Include default value in 'denote-command-prompt', ELPA Syncer, 2023/09/25
- [elpa] externals/denote beb1fc6d98 06/12: Fix prompt text in 'denote-command-prompt', ELPA Syncer, 2023/09/25
- [elpa] externals/denote ccdcbfb7b7 12/12: Placate the compiler about double space after dots in docs, ELPA Syncer, 2023/09/25
- [elpa] externals/denote 45fe76ca24 05/12: Make denote-file-prompt record history, ELPA Syncer, 2023/09/25
- [elpa] externals/denote 3ad974396d 02/12: Make 'denote-link' more abstract to also call it from Lisp, ELPA Syncer, 2023/09/25
- [elpa] externals/denote 34c632c690 11/12: Simplify denote-dired-rename-marked-files interactive spec, ELPA Syncer, 2023/09/25
- [elpa] externals/denote 86f91ea3fa 09/12: Fix regression with how 'denote-link' was called, ELPA Syncer, 2023/09/25