1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-12-28 10:56:57 +00:00

Fix display problem of clocked time in agenda

* lisp/org-agenda.el (org-agenda-get-progress): Avoid reusing previous
value of EXTRA.

Sebastien Vauban writes:

> Finally reporting the following bug. Has been there for as long as I can
> remember, but never did report it when seeing it. And kept forgetting.
>
> So, now...
>
> --8<---------------cut here---------------start------------->8---
> * 2010
>
> ** 2010-06 June
>
> *** Admin
>
> **** Organization
>     :LOGBOOK:
>     CLOCK: [2010-06-30 Wed 13:30]--[2010-06-30 Wed 17:50] =>  4:20
>     - DUPLICATED TeXt.
>     :END:
>
> **** Emails and News
>     :LOGBOOK:
>     CLOCK: [2010-06-28 Mon 09:10]--[2010-06-28 Mon 10:40] =>  1:30
>     CLOCK: [2010-06-30 Wed 10:30]--[2010-06-30 Wed 12:30] =>  2:00
>     :END:
>
> *** ABC
>    :LOGBOOK:
>    CLOCK: [2010-06-30 Wed 09:30]--[2010-06-30 Wed 10:30] =>  1:00
>    - Transfer of files to ABC.
>    :END:
> --8<---------------cut here---------------end--------------->8---
>
> generates the following timeline:
>
> --8<---------------cut here---------------start------------->8---
> Timeline of file /home/sva/Projects/ecm.org
>
> 2010-06-28 Mon _________________________________
>  Clocked:   (1:30) Emails and News
>
> 2010-06-29 Tue _________________________________
>
> 2010-06-30 Wed _________________________________
>  Clocked:   (1:00) ABC - Transfer of files to ABC.
>  Clocked:   (2:00) Emails and News - DUPLICATED TeXt.
>  Clocked:   (4:20) Organization - DUPLICATED TeXt.
> --8<---------------cut here---------------end--------------->8---
>
> As you can see, the fact that I never put a descriptive text for "reading
> emails" is wrongly reported: previous text is used in the timeline, instead.
This commit is contained in:
Carsten Dominik 2010-07-01 14:00:58 +02:00
parent 48730be21f
commit c74ecf4387

View File

@ -4502,15 +4502,15 @@ be skipped."
(setq clocked (match-string 2 rest)))
(setq clocked "-")))
(save-excursion
(setq extra nil)
(cond
((not org-agenda-log-mode-add-notes) (setq extra nil))
((not org-agenda-log-mode-add-notes))
(statep
(and (looking-at ".*\n[ \t]*\\([^-\n \t].*?\\)[ \t]*$")
(setq extra (match-string 1))))
(clockp
(and (looking-at ".*\n[ \t]*-[ \t]+\\([^-\n \t].*?\\)[ \t]*$")
(setq extra (match-string 1))))
(t (setq extra nil)))
(setq extra (match-string 1)))))
(if (not (re-search-backward "^\\*+ " nil t))
(setq txt org-agenda-no-heading-message)
(goto-char (match-beginning 0))