0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-29 20:37:51 +00:00

org.el (org-follow-timestamp-link): Fix bug when using sticky agenda

* org.el (org-follow-timestamp-link): Fix bug when using
sticky agenda.  Add a docstring.

Thanks to Christoph Lange for reporting this.
This commit is contained in:
Bastien Guerry 2012-09-28 16:51:21 +02:00
parent b56acb69ff
commit 807137acdd

View file

@ -10377,18 +10377,24 @@ onto the ring."
;;; Following specific links
(defun org-follow-timestamp-link ()
"Open an agenda view for the time-stamp date/range at point."
(cond
((org-at-date-range-p t)
(let ((org-agenda-start-on-weekday)
(t1 (match-string 1))
(t2 (match-string 2)))
(setq t1 (time-to-days (org-time-string-to-time t1))
t2 (time-to-days (org-time-string-to-time t2)))
(org-agenda-list nil t1 (1+ (- t2 t1)))))
(t2 (match-string 2)) tt1 tt2)
(setq tt1 (time-to-days (org-time-string-to-time t1))
tt2 (time-to-days (org-time-string-to-time t2)))
(let ((org-agenda-buffer-tmp-name
(format "*Org Agenda(a:%s)"
(concat (substring t1 0 10) "--" (substring t2 0 10)))))
(org-agenda-list nil tt1 (1+ (- tt2 tt1))))))
((org-at-timestamp-p t)
(org-agenda-list nil (time-to-days (org-time-string-to-time
(substring (match-string 1) 0 10)))
1))
(let ((org-agenda-buffer-tmp-name
(format "*Org Agenda(a:%s)" (substring (match-string 1) 0 10))))
(org-agenda-list nil (time-to-days (org-time-string-to-time
(substring (match-string 1) 0 10)))
1)))
(t (error "This should not happen"))))