Browse Source

Timeline: Allow the buffer to be an indirect one

* lisp/org-agenda.el (org-timeline): Allow indirect buffer.
Carsten Dominik 14 years ago
parent
commit
5188f71ee8
1 changed files with 3 additions and 3 deletions
  1. 3 3
      lisp/org-agenda.el

+ 3 - 3
lisp/org-agenda.el

@@ -3012,7 +3012,8 @@ dates."
   (let* ((dopast t)
 	 (dotodo include-all)
 	 (doclosed org-agenda-show-log)
-	 (entry buffer-file-name)
+	 (entry (buffer-file-name (or (buffer-base-buffer (current-buffer))
+				      (current-buffer))))
 	 (date (calendar-current-date))
 	 (beg (if (org-region-active-p) (region-beginning) (point-min)))
 	 (end (if (org-region-active-p) (region-end) (point-max)))
@@ -3034,8 +3035,7 @@ dates."
 	(setq day-numbers (delq nil (mapcar (lambda(x)
 					      (if (>= x today) x nil))
 					    day-numbers))))
-    (org-prepare-agenda (concat "Timeline "
-				(file-name-nondirectory buffer-file-name)))
+    (org-prepare-agenda (concat "Timeline " (file-name-nondirectory entry)))
     (if doclosed (push :closed args))
     (push :timestamp args)
     (push :deadline args)