emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/denote d57dd28af1: Revert "Return a user-error if denot


From: ELPA Syncer
Subject: [elpa] externals/denote d57dd28af1: Revert "Return a user-error if denote-directory has no files"
Date: Sat, 11 May 2024 12:58:11 -0400 (EDT)

branch: externals/denote
commit d57dd28af12690ae7904679cace7ad7a5ac9f6a8
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    Revert "Return a user-error if denote-directory has no files"
    
    This reverts commit 3badc7f2e873ad5b683ec79036363c2450c598f3.
    
    Thanks to Kolmas for bringing this matter to my attention in issue
    345: <https://github.com/protesilaos/denote/issues/345>.
---
 denote.el | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/denote.el b/denote.el
index f238450f67..01ca4c5fd9 100644
--- a/denote.el
+++ b/denote.el
@@ -1036,19 +1036,17 @@ current Denote file in the returned list.
 
 With optional TEXT-ONLY as a non-nil value, limit the results to
 text files that satisfy `denote-file-is-note-p'."
-  (if-let ((files (denote--directory-get-files)))
-      (progn
-        (when (and omit-current buffer-file-name (denote-file-has-identifier-p 
buffer-file-name))
-          (setq files (delete buffer-file-name files)))
-        (when files-matching-regexp
-          (setq files (seq-filter
-                       (lambda (f)
-                         (string-match-p files-matching-regexp 
(denote-get-file-name-relative-to-denote-directory f)))
-                       files)))
-        (when text-only
-          (setq files (seq-filter #'denote-file-is-note-p files)))
-        files)
-    (user-error "The `denote-directory' has no files")))
+  (let ((files (denote--directory-get-files)))
+    (when (and omit-current buffer-file-name (denote-file-has-identifier-p 
buffer-file-name))
+      (setq files (delete buffer-file-name files)))
+    (when files-matching-regexp
+      (setq files (seq-filter
+                   (lambda (f)
+                     (string-match-p files-matching-regexp 
(denote-get-file-name-relative-to-denote-directory f)))
+                   files)))
+    (when text-only
+      (setq files (seq-filter #'denote-file-is-note-p files)))
+    files))
 
 ;; NOTE 2023-11-30: We are declaring `denote-directory-text-only-files'
 ;; obsolete, though we keep it around for the foreseeable future.  It



reply via email to

[Prev in Thread] Current Thread [Next in Thread]