emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Re: icalendar: exporting times of day specified in heading?


From: Matthew Lundin
Subject: [Orgmode] Re: icalendar: exporting times of day specified in heading?
Date: Wed, 17 Mar 2010 22:17:46 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Hi Stephen,

Stephen Eglen <address@hidden> writes:

>> When I enter the time of day after typing "i d", the time of day is
>> added to the timestamp (as above) but is *not* removed the headline.
>> E.g.,
>> 
>> "Day entry: 9:00am go shopping [RET]" 
>> 
>> ...results in the following headline...
>> 
>> * 9:00am go shopping
>>   <2010-03-17 Wed 09:00>
>
> that's odd; I just tried that and got:
>
> ******* go shopping
>       <2010-03-17 Wed 09:00>
> which then shows in the agenda as:
>
>   agenda:      9:00...... go shopping
>
>> I'd be curious to know whether others can duplicate this bug.
> me too! 
>
> Do you get any better behaviour if you just put 9:00 or 09:00?  Would be
> good to resolve this in case there is a bug lurking elsewhere...

I believe I've pinned down the cause of the reported behavior.

My default agenda buffer is a custom agenda block, which consists of an
agenda view and a todo view. The inclusion of the todo view caused the
variable org-prefix-has-time to be set to nil, which in turn prevented
org-format-agenda-item from removing the time of day string from the
headline (see lines 4857-64 of org-agenda.el). Thus, when I called "i d"
from the block agenda, the time was not removed from the headline; when
I called "i d" from the default agenda or the calendar, it was removed.

Here's a patch that ensures the time of day is removed regardless of the
current value of org-prefix-has-time:

--8<---------------cut here---------------start------------->8---
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index a50a364..9d4a4c4 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -7107,6 +7107,7 @@ the resulting entry will not be shown.  When TEXT is 
empty, switch to
      ((eq type 'day)
       (let*
          (fmt time time2
+              (org-prefix-has-time t)
               (org-agenda-time-leading-zero t))
        (if org-agenda-insert-diary-extract-time
            ;; Use org-format-agenda-item to parse text for a time-range and
--8<---------------cut here---------------end--------------->8---

> Currently, org-agenda.el has (l 7079)
>
>       (if org-agenda-search-headline-for-time
>
> to check whether we should extract the time; how about if I replaced it
> with a variable called org-agenda-extract-time-from-entry which defaults
> to nil so this behaviour is normally off?

Many thanks for adding this new variable.

Best,
Matt




reply via email to

[Prev in Thread] Current Thread [Next in Thread]