From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: icalendar: exporting times of day specified in heading? Date: Thu, 18 Mar 2010 06:37:09 +0100 Message-ID: References: <15490.1263652716@cpc1-cmbg14-2-0-cust6.5-4.cable.virginmedia.com> <11681.1265116614@maps> <87ocinuljo.fsf@fastmail.fm> <5606.1268833242@maps> <87aau6id9x.fsf@fastmail.fm> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ns9iQ-000823-4P for emacs-orgmode@gnu.org; Thu, 18 Mar 2010 03:00:22 -0400 Received: from [140.186.70.92] (port=53852 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ns9iN-00081v-PO for emacs-orgmode@gnu.org; Thu, 18 Mar 2010 03:00:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ns9iL-0002ZC-LD for emacs-orgmode@gnu.org; Thu, 18 Mar 2010 03:00:19 -0400 Received: from mail-ew0-f227.google.com ([209.85.219.227]:62046) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ns9iL-0002Yu-E3 for emacs-orgmode@gnu.org; Thu, 18 Mar 2010 03:00:17 -0400 Received: by ewy27 with SMTP id 27so1039911ewy.14 for ; Thu, 18 Mar 2010 00:00:16 -0700 (PDT) In-Reply-To: <87aau6id9x.fsf@fastmail.fm> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Matthew Lundin Cc: emacs-orgmode@gnu.org, Stephen Eglen Applied, thanks. - Carsten On Mar 18, 2010, at 3:17 AM, Matthew Lundin wrote: > Hi Stephen, > > Stephen Eglen 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 - Carsten