From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Lundin Subject: Re: icalendar: exporting times of day specified in heading? Date: Wed, 17 Mar 2010 22:17:46 -0400 Message-ID: <87aau6id9x.fsf@fastmail.fm> References: <15490.1263652716@cpc1-cmbg14-2-0-cust6.5-4.cable.virginmedia.com> <11681.1265116614@maps> <87ocinuljo.fsf@fastmail.fm> <5606.1268833242@maps> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ns5IU-0005qP-95 for emacs-orgmode@gnu.org; Wed, 17 Mar 2010 22:17:18 -0400 Received: from [140.186.70.92] (port=38136 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ns5IR-0005qH-SE for emacs-orgmode@gnu.org; Wed, 17 Mar 2010 22:17:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ns5IP-0002Zg-TZ for emacs-orgmode@gnu.org; Wed, 17 Mar 2010 22:17:15 -0400 Received: from out3.smtp.messagingengine.com ([66.111.4.27]:44213) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ns5IP-0002Zc-Pu for emacs-orgmode@gnu.org; Wed, 17 Mar 2010 22:17:13 -0400 In-Reply-To: <5606.1268833242@maps> (Stephen Eglen's message of "Wed, 17 Mar 2010 13:40:42 +0000") 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: Stephen Eglen Cc: emacs-orgmode@gnu.org, Carsten Dominik 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