[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote d0a174082a 06/11: Remove the absolute parameter
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote d0a174082a 06/11: Remove the absolute parameter from denote--directory-files and delete denote--directory-files-recursively |
Date: |
Mon, 8 Aug 2022 23:57:31 -0400 (EDT) |
branch: externals/denote
commit d0a174082a69e5d314ceb7ebfea92b1a3056f189
Author: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>
Commit: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>
Remove the absolute parameter from denote--directory-files and delete
denote--directory-files-recursively
- Adjust denote-link--find-file-prompt to have the file names relative to
denote-directory.
---
denote.el | 36 ++++++++++++++----------------------
1 file changed, 14 insertions(+), 22 deletions(-)
diff --git a/denote.el b/denote.el
index df37644b2c..c5da6cbe5b 100644
--- a/denote.el
+++ b/denote.el
@@ -454,32 +454,21 @@ FILE must be an absolute path."
(string-match-p denote--id-regexp (buffer-name)))
(string-prefix-p (denote-directory) (expand-file-name
default-directory))))
-(defun denote--directory-files-recursively (directory)
- "Return expanded files in DIRECTORY recursively."
+(defun denote--directory-files ()
+ "List expanded note files."
(mapcar
(lambda (s) (expand-file-name s))
(seq-remove
(lambda (f)
(not (denote--only-note-p f)))
- (directory-files-recursively directory directory-files-no-dot-files-regexp
t))))
-
-(defun denote--directory-files (&optional absolute)
- "List note files.
-If optional ABSOLUTE, show full paths, else only show base file
-names that are relative to the variable `denote-directory'."
- (let ((files (denote--directory-files-recursively (denote-directory))))
- (if absolute
- files
- (mapcar
- (lambda (s) (denote--file-name-relative-to-denote-directory s))
- files))))
+ (directory-files-recursively (denote-directory)
directory-files-no-dot-files-regexp t))))
(defun denote--get-note-path-by-id (id)
"Return the absolute path of ID note in variable `denote-directory'."
(seq-find
(lambda (f)
(string-prefix-p id (file-name-nondirectory f)))
- (denote--directory-files :absolute)))
+ (denote--directory-files)))
(defun denote--directory-files-matching-regexp (regexp)
"Return list of files matching REGEXP.
@@ -489,7 +478,7 @@ variable `denote-directory'."
(lambda (f)
(and (denote--only-note-p f)
(string-match-p regexp
(denote--file-name-relative-to-denote-directory f))))
- (denote--directory-files :absolute)))
+ (denote--directory-files)))
;;;; Keywords
@@ -620,7 +609,7 @@ If optional KEY is non-nil, return the key instead."
"Return xrefs of IDENTIFIER in variable `denote-directory'.
The xrefs are returned as an alist."
(xref--alistify
- (xref-matches-in-files identifier (denote--directory-files :absolute))
+ (xref-matches-in-files identifier (denote--directory-files))
(lambda (x)
(xref-location-group (xref-item-location x)))))
@@ -897,7 +886,7 @@ where the former does not read dates without a time
component."
"Return non-nil if IDENTIFIER already exists."
(seq-some (lambda (file)
(string-prefix-p identifier (file-name-nondirectory file)))
- (concat (denote--directory-files :absolute)
+ (concat (denote--directory-files)
(denote--buffer-file-names))))
(defun denote--barf-duplicate-id (identifier)
@@ -1805,10 +1794,13 @@ format is always [[denote:IDENTIFIER]]."
(defun denote-link--find-file-prompt (files)
"Prompt for linked file among FILES."
- (completing-read "Find linked file "
- (denote--completion-table 'file files)
- nil t
- nil 'denote-link--find-file-history))
+ (let ((file-names (mapcar
+ (lambda (f)
(denote--file-name-relative-to-denote-directory f))
+ files)))
+ (completing-read "Find linked file "
+ (denote--completion-table 'file file-names)
+ nil t
+ nil 'denote-link--find-file-history)))
;; TODO 2022-06-14: Do we need to add any sort of extension to better
;; integrate with Embark? For the minibuffer interaction it is not
- [elpa] externals/denote updated (22bb68b86c -> 065a10fc60), ELPA Syncer, 2022/08/08
- [elpa] externals/denote 5d7f4f3cfc 01/11: Remove let-bindings of default-directory, ELPA Syncer, 2022/08/08
- [elpa] externals/denote 9b4310779f 09/11: Use absolute paths in denote--retrieve-files-in-xrefs and denote--retrieve-proces-grep, ELPA Syncer, 2022/08/08
- [elpa] externals/denote 2c00c3ed44 10/11: Fix backlinks buffer, ELPA Syncer, 2022/08/08
- [elpa] externals/denote 6793a4319d 02/11: Delete variable denote-link--links-to-files, ELPA Syncer, 2022/08/08
- [elpa] externals/denote 2d12ec7457 05/11: Refactor denote--id-exists-p, ELPA Syncer, 2022/08/08
- [elpa] externals/denote d0a174082a 06/11: Remove the absolute parameter from denote--directory-files and delete denote--directory-files-recursively,
ELPA Syncer <=
- [elpa] externals/denote 1e8b1b62b4 07/11: Refactor denote--buffer-file-names, ELPA Syncer, 2022/08/08
- [elpa] externals/denote 065a10fc60 11/11: Merge pull request #80 from jeanphilippegg/cleanup, ELPA Syncer, 2022/08/08
- [elpa] externals/denote 8a25727777 03/11: Remove check of current buffer in denote--id-exists-p, ELPA Syncer, 2022/08/08
- [elpa] externals/denote c925928795 04/11: Refactor denote--directory-files-matching-regexp, ELPA Syncer, 2022/08/08
- [elpa] externals/denote 769f497f17 08/11: Ignore hidden directories in denote--subdirs, ELPA Syncer, 2022/08/08