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

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

[nongnu] elpa/denote-refs 9bca564284 7/9: Report zero references when fi


From: ELPA Syncer
Subject: [nongnu] elpa/denote-refs 9bca564284 7/9: Report zero references when file doesn't exist
Date: Mon, 19 Dec 2022 14:59:01 -0500 (EST)

branch: elpa/denote-refs
commit 9bca564284e646a9315996df812f7608f51b3544
Author: Akib Azmain Turja <akib@disroot.org>
Commit: Akib Azmain Turja <akib@disroot.org>

    Report zero references when file doesn't exist
    
    * denote-refs.el (denote-refs--fetch): Report zero references
    when buffer file doesn't exist.
---
 denote-refs.el | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/denote-refs.el b/denote-refs.el
index 76a763b791..43595cfc2c 100644
--- a/denote-refs.el
+++ b/denote-refs.el
@@ -199,18 +199,21 @@ The car is PATH relative to user option 
`denote-directory'."
 
 (defun denote-refs--fetch ()
   "Fetch reference information."
-  (when (and (buffer-file-name) (file-exists-p (buffer-file-name)))
-    (dolist (section denote-refs-sections)
-      (pcase-exhaustive section
-        ('links
-         (setq denote-refs--links
+  (dolist (section denote-refs-sections)
+    (pcase-exhaustive section
+      ('links
+       (setq denote-refs--links
+             (when (and (buffer-file-name)
+                        (file-exists-p (buffer-file-name)))
                (mapcar #'denote-refs--make-path-relative
                        (denote-link--expand-identifiers
                         (denote--link-in-context-regexp
                          (denote-filetype-heuristics
-                          (buffer-file-name)))))))
-        ('backlinks
-         (setq denote-refs--backlinks
+                          (buffer-file-name))))))))
+      ('backlinks
+       (setq denote-refs--backlinks
+             (when (and (buffer-file-name)
+                        (file-exists-p (buffer-file-name)))
                (mapcar #'denote-refs--make-path-relative
                        (delete (buffer-file-name)
                                (denote--retrieve-files-in-xrefs



reply via email to

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