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

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

[elpa] scratch/org-edna d527569 48/72: Handle all errors in Edna forms


From: Ian Dunn
Subject: [elpa] scratch/org-edna d527569 48/72: Handle all errors in Edna forms
Date: Sun, 21 May 2017 21:11:26 -0400 (EDT)

branch: scratch/org-edna
commit d52756905a038b5d98ea4626335b8181a9d2ee9b
Author: Ian D <address@hidden>
Commit: Ian D <address@hidden>

    Handle all errors in Edna forms
    
    * org-edna.el (org-edna-run): Catch and report all errors.
      (org-edna-finder/match): Don't convert arguments.
---
 org-edna.el | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/org-edna.el b/org-edna.el
index 370b50a..89cda05 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -197,8 +197,13 @@ Currently, the following are handled:
           (member to (cons 'done org-done-keywords)))
          (condition-case err
              ,@body
-           (invalid-syntax-error
-            (org-edna--print-syntax-error (cdr err))))
+           (error
+            (if (eq (car err) 'invalid-syntax-error)
+                (org-edna--print-syntax-error (cdr err))
+              (message "Edna Error: %s" (error-message-string err)))
+            (setq org-block-entry-blocking (org-get-heading))
+            ;; Block
+            nil))
        ;; Return t for the blocker to let the calling function know that there
        ;; is no block here.
        t)))
@@ -239,8 +244,7 @@ SCOPE and SKIP are their counterparts in `org-map-entries', 
but
 as strings.
 
 SCOPE defaults to \"agenda\", and SKIP defaults to nil."
-  (setq scope (if scope (intern scope) 'agenda))
-  (when skip (setq skip (intern skip)))
+  (setq scope (or scope 'agenda)
   (org-map-entries
    ;; Find all entries in the agenda files that match the given tag.
    (lambda nil (point-marker))



reply via email to

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