summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Kamat <jaygkamat@gmail.com>2018-04-09 21:47:58 -0400
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2018-04-10 20:10:24 +0200
commit1553aae9948ff8c664d20df04ff3580ecf947a42 (patch)
treedaa65fcc791eef24a7b5486b8d3fea49eca43dee
parent575d66625d13c34bbeae5f44d24235194cddd478 (diff)
downloadorg-mode-1553aae9948ff8c664d20df04ff3580ecf947a42.tar.gz
org-notify: Fix an error in `org-notify-process' when unconfigured
* contrib/lisp/org-notify.el (org-notify-todo-list): Return nil if `org-agenda-files' is nil.
-rw-r--r--contrib/lisp/org-notify.el19
1 files changed, 10 insertions, 9 deletions
diff --git a/contrib/lisp/org-notify.el b/contrib/lisp/org-notify.el
index d4ae0a4..f565d22 100644
--- a/contrib/lisp/org-notify.el
+++ b/contrib/lisp/org-notify.el
@@ -137,15 +137,16 @@ simple timestamp string."
"Create the todo-list for one org-agenda file."
(let* ((files (org-agenda-files 'unrestricted))
(max (1- (length files))))
- (setq org-notify-parse-file
- (if (or (not org-notify-parse-file) (>= org-notify-parse-file max))
- 0
- (1+ org-notify-parse-file)))
- (save-excursion
- (with-current-buffer (find-file-noselect
- (nth org-notify-parse-file files))
- (org-element-map (org-element-parse-buffer 'headline)
- 'headline 'org-notify-make-todo)))))
+ (when files
+ (setq org-notify-parse-file
+ (if (or (not org-notify-parse-file) (>= org-notify-parse-file max))
+ 0
+ (1+ org-notify-parse-file)))
+ (save-excursion
+ (with-current-buffer (find-file-noselect
+ (nth org-notify-parse-file files))
+ (org-element-map (org-element-parse-buffer 'headline)
+ 'headline 'org-notify-make-todo))))))
(defun org-notify-maybe-too-late (diff period heading)
"Print warning message, when notified significantly later than defined by