Преглед изворни кода

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.
Bastien Guerry пре 13 година
родитељ
комит
4b8359a395
1 измењених фајлова са 2 додато и 1 уклоњено
  1. 2 1
      lisp/org-agenda.el

+ 2 - 1
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))