Browse Source

Fix org-agenda-to-appt, which got broken by sticky agenda

* lisp/org-agenda.el (org-agenda-new-marker): Check for NIL org-agenda-buffer
(org-agenda-to-appt): Bind org-agenda-buffer to NIL
Max Mikhanosha 13 years ago
parent
commit
ec7bd3b1be
1 changed files with 5 additions and 2 deletions
  1. 5 2
      lisp/org-agenda.el

+ 5 - 2
lisp/org-agenda.el

@@ -3476,7 +3476,9 @@ Org-mode keeps a list of these markers and resets them when they are
 no longer in use."
   (let ((m (copy-marker (or pos (point)))))
     (setq org-agenda-last-marker-time (org-float-time))
-    (with-current-buffer org-agenda-buffer
+    (if org-agenda-buffer 
+	(with-current-buffer org-agenda-buffer
+	  (push m org-agenda-markers))
       (push m org-agenda-markers))
     m))
 
@@ -8873,7 +8875,8 @@ details and examples."
 	 (today (org-date-to-gregorian
 		 (time-to-days (current-time))))
 	 (org-agenda-restrict nil)
-	 (files (org-agenda-files 'unrestricted)) entries file)
+	 (files (org-agenda-files 'unrestricted)) entries file
+	 (org-agenda-buffer nil))
     ;; Get all entries which may contain an appt
     (org-prepare-agenda-buffers files)
     (while (setq file (pop files))