mirror of
https://github.com/protesilaos/denote.git
synced 2026-09-15 09:46:24 -04:00
BREAKING make 'denote-file-prompt' accept optional regexp filter
This commit is contained in:
parent
3ad974396d
commit
2e444f3f22
|
|
@ -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
|
||||
|
|
|
|||
13
denote.el
13
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue