summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpedro <git2021@cas.cat>2024-03-25 22:34:34 +0100
committerIhor Radchenko <yantar92@posteo.net>2024-03-26 18:14:29 +0300
commite44255be733fc2adc66c5e742ce7b96e85c86d3f (patch)
tree1d38faccb66f390fad5f91c778b567845d0c88ef
parent351c71397d893d896a47ad7e280607b4d59b84e4 (diff)
lisp/org-collector.el: Add error handling in props
When a property is considered an emacs lisp expression right now it just blindly fails with (invalid-read-syntax #) that comes from the org-babel-read function. The proposed change informs the user what property is failing. * lisp/org-collector.el (org-propview-collect):
-rw-r--r--lisp/org-collector.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/org-collector.el b/lisp/org-collector.el
index 76ba7fb..cdc92ae 100644
--- a/lisp/org-collector.el
+++ b/lisp/org-collector.el
@@ -189,7 +189,11 @@ variables and values specified in props"
(mapcar (lambda (pair)
(let ((inhibit-lisp-eval (or (string= (car pair) "ITEM")
(string-match-p org-ts-regexp-inactive (cdr pair)))))
- (cons (car pair) (org-babel-read (cdr pair) inhibit-lisp-eval))))
+ (condition-case err
+ (cons (car pair) (org-babel-read (cdr pair) inhibit-lisp-eval))
+ (error
+ (error
+ (print (format "Error processing lisp on property: %S, error: %S. Remember anything that starts with a (, ', ` or [ is considered an elisp expression" pair err)))))))
props))
header-props)))
;; collect all property names