Browse Source

org-agenda.el: Fix bug in `org-agenda-get-day-entries'

* org-agenda.el (org-agenda-get-day-entries): Set the agenda
buffer inconditionnally.

For example, when `org-agenda-get-day-entries' is called
through ̀org-diary', we need to make sure `org-agenda-buffer'
is set, otherwise org-diary triggers an error.
Bastien Guerry 12 years ago
parent
commit
92f2e9efb2
1 changed files with 1 additions and 0 deletions
  1. 1 0
      lisp/org-agenda.el

+ 1 - 0
lisp/org-agenda.el

@@ -4929,6 +4929,7 @@ the documentation of `org-diary'."
       (with-current-buffer buffer
 	(unless (derived-mode-p 'org-mode)
 	  (error "Agenda file %s is not in `org-mode'" file))
+	(setq org-agenda-buffer (or org-agenda-buffer buffer))
 	(let ((case-fold-search nil))
 	  (save-excursion
 	    (save-restriction