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

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

[elpa] externals/denote 74962d17f2 217/355: Improve denote-retrieve erro


From: ELPA Syncer
Subject: [elpa] externals/denote 74962d17f2 217/355: Improve denote-retrieve error handling
Date: Sun, 26 Jun 2022 23:58:26 -0400 (EDT)

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

    Improve denote-retrieve error handling
    
    Basically, we do not want to do anything in files that have no front
    matter.
---
 denote-retrieve.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/denote-retrieve.el b/denote-retrieve.el
index c7f93a29f2..89e7e5d10f 100644
--- a/denote-retrieve.el
+++ b/denote-retrieve.el
@@ -64,7 +64,8 @@ With optional GROUP match it, else match group 1."
       (widen)
       (goto-char (point-min))
       (re-search-forward regexp nil t 1)
-      (match-string-no-properties (or group 1)))))
+      (unless (eq (point) (point-min))
+        (match-string-no-properties (or group 1))))))
 
 (defun denote-retrieve--value (file regexp &optional group)
   "Return REGEXP value from FILE.
@@ -76,7 +77,7 @@ Optional GROUP is a regexp construct for
     (with-temp-buffer
       (insert-file-contents-literally file)
       (or (denote-retrieve--search regexp group)
-          (user-error "Cannot retrieve %s in %s" regexp file)))))
+          nil))))
 
 (defun denote-retrieve--value-title (file &optional group)
   "Return title from FILE, optionally matching regexp GROUP."



reply via email to

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