From 4b8359a3950aec71f2190d9374ae09971d8bfede Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Sat, 28 Apr 2012 22:23:08 +0200 Subject: [PATCH] org-agenda.el: Prevent org-diary to fail. * org-agenda.el (org-diary): Prevent failure from `org-compile-prefix-format' when there is no agenda buffer. Thanks to Rafael who reported this. --- lisp/org-agenda.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 27b740a21..88ad7c060 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -4748,7 +4748,8 @@ function from a program - use `org-agenda-get-day-entries' instead." ;; I am not sure if this works with sticky agendas, because the marker ;; list is then no longer a global variable. (org-agenda-reset-markers)) - (org-compile-prefix-format 'agenda) + ;; Prevent `org-compile-prefix-format' to fail when there is no agenda + (when org-agenda-buffer (org-compile-prefix-format 'agenda)) (org-set-sorting-strategy 'agenda) (setq args (or args '(:deadline :scheduled :timestamp :sexp))) (let* ((files (if (and entry (stringp entry) (string-match "\\S-" entry)) -- 2.11.4.GIT