From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shankar Rao Subject: org-capture-template: file+datetree+prompt not using prompted date in template Date: Wed, 4 Nov 2015 13:22:25 -0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e013a18a25b515a0523bd9b10 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50426) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zu5Vj-00072l-O4 for emacs-orgmode@gnu.org; Wed, 04 Nov 2015 16:22:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zu5Vi-0006HS-Q4 for emacs-orgmode@gnu.org; Wed, 04 Nov 2015 16:22:27 -0500 Received: from mail-ob0-x232.google.com ([2607:f8b0:4003:c01::232]:32921) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zu5Vi-0006HN-Lo for emacs-orgmode@gnu.org; Wed, 04 Nov 2015 16:22:26 -0500 Received: by obbww6 with SMTP id ww6so24159451obb.0 for ; Wed, 04 Nov 2015 13:22:26 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode --089e013a18a25b515a0523bd9b10 Content-Type: text/plain; charset=UTF-8 For the following org capture template: (setq org-capture-templates '(("d" "Date Tree Test" plain (file+datetree+prompt "~/org/testdt.org") "This date should be the date i picked: %<%y%m%d>"))) Though this is filed under the correct date in the datetree, no matter what date I select in the prompt, the date displayed in the template is the current date. Is this a bug or a feature? How do I use the prompt-selected date in the template? Shankar --089e013a18a25b515a0523bd9b10 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
For the following org capture template:

(setq org-capture-templates
=C2=A0 =C2=A0 =C2=A0 '(= ("d" "= ;Date Tree Test" plain
(file+datetree+pr= ompt "~/org/testdt.org")=
"This date should be the date i picked: %<%= y%m%d>")))

Though= this is filed under the correct date in the datetree, no matter what date = I select in the prompt, the date displayed in the template is the current d= ate. Is this a bug or a feature?

How do I use the prompt-selected date in the template?=C2=A0

<= div>Shankar
--089e013a18a25b515a0523bd9b10-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: org-capture-template: file+datetree+prompt not using prompted date in template Date: Wed, 04 Nov 2015 17:15:39 -0500 Message-ID: <87pozpifcb.fsf@alphaville.usersys.redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35948) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zu6LV-0006DL-A0 for emacs-orgmode@gnu.org; Wed, 04 Nov 2015 17:15:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zu6LR-00043S-6j for emacs-orgmode@gnu.org; Wed, 04 Nov 2015 17:15:57 -0500 Received: from plane.gmane.org ([80.91.229.3]:53057) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zu6LR-00043D-0H for emacs-orgmode@gnu.org; Wed, 04 Nov 2015 17:15:53 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Zu6LN-0000be-Gn for emacs-orgmode@gnu.org; Wed, 04 Nov 2015 23:15:49 +0100 Received: from nat-pool-bos-t.redhat.com ([66.187.233.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 04 Nov 2015 23:15:49 +0100 Received: from ndokos by nat-pool-bos-t.redhat.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 04 Nov 2015 23:15:49 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Shankar Rao writes: > For the following org capture template: > > (setq org-capture-templates >       '(("d" "Date Tree Test" plain > (file+datetree+prompt "~/org/testdt.org") > "This date should be the date i picked: %<%y%m%d>"))) > > Though this is filed under the correct date in the datetree, no matter what date I select in the prompt, > the date displayed in the template is the current date. Is this a bug or a feature? > It's a feature I guess - org-capture.el says: ;; The current time (goto-char (point-min)) (while (re-search-forward "%<\\([^>\n]+\\)>" nil t) (replace-match (format-time-string (match-string 1)) t t)) and there is no provision for another time to be given here. I don't think there is any provision in the template for a time other than the current time: at least I can't see a %-escape that takes a different time. -- Nick From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shankar Rao Subject: Re: org-capture-template: file+datetree+prompt not using prompted date in template Date: Wed, 4 Nov 2015 14:54:34 -0800 Message-ID: References: <87pozpifcb.fsf@alphaville.usersys.redhat.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113e5068e417750523bee432 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44914) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zu6wu-0008TE-9s for emacs-orgmode@gnu.org; Wed, 04 Nov 2015 17:54:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zu6wt-0006g2-1k for emacs-orgmode@gnu.org; Wed, 04 Nov 2015 17:54:36 -0500 Received: from mail-oi0-x22d.google.com ([2607:f8b0:4003:c06::22d]:34582) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zu6ws-0006fy-RR for emacs-orgmode@gnu.org; Wed, 04 Nov 2015 17:54:34 -0500 Received: by oies66 with SMTP id s66so37116090oie.1 for ; Wed, 04 Nov 2015 14:54:34 -0800 (PST) In-Reply-To: <87pozpifcb.fsf@alphaville.usersys.redhat.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nick Dokos Cc: emacs-orgmode@gnu.org --001a113e5068e417750523bee432 Content-Type: text/plain; charset=UTF-8 Earlier in org-capture-fill-template, there is the following: (let* (... (ct (org-capture-get :default-time)) ... The property :default-time defaults to the current time and is overwritten by file+datetree+prompt, If ct was passed as a 2nd argument to format-time-string in your code snippet: ;; The current time (goto-char (point-min)) (while (re-search-forward "%<\\([^>\n]+\\)>" nil t) (replace-match (format-time-string (match-string 1) ct) t t)) this should provide the behavior I'm looking for with file+datetree+prompt, but still use the current time for other capture types. Will this solution break anything? Shankar On Wed, Nov 4, 2015 at 2:15 PM, Nick Dokos wrote: > Shankar Rao writes: > > > For the following org capture template: > > > > (setq org-capture-templates > > '(("d" "Date Tree Test" plain > > (file+datetree+prompt "~/org/testdt.org") > > "This date should be the date i picked: %<%y%m%d>"))) > > > > Though this is filed under the correct date in the datetree, no matter > what date I select in the prompt, > > the date displayed in the template is the current date. Is this a bug or > a feature? > > > > It's a feature I guess - org-capture.el says: > > ;; The current time > (goto-char (point-min)) > (while (re-search-forward "%<\\([^>\n]+\\)>" nil t) > (replace-match (format-time-string (match-string 1)) t t)) > > and there is no provision for another time to be given here. I don't > think there is any provision in the template for a time other than the > current time: at least I can't see a %-escape that takes a different > time. > > -- > Nick > > > --001a113e5068e417750523bee432 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Earlier in org-capture-fill-template, there is the followi= ng:

(let* (...
=C2=A0 = =C2=A0 =C2=A0 =C2=A0(ct (org-capture-get :default-time))
=C2=A0 =C2=A0 = =C2=A0 =C2=A0...

The property :defau= lt-time defaults to the current time and is overwritten by file+datetree+pr= ompt,=C2=A0
If ct was p= assed as a 2nd argument to format-time-string in your code snippet:<= /div>

=C2= =A0 =C2=A0 =C2=A0 ;; The current time
= =C2=A0 =C2=A0 =C2=A0 (goto-char (point-min= ))
= =C2=A0 =C2=A0 =C2=A0 (while (re-search-forward "%<\\([^>\n]+\\)&= gt;" nil t)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (replace-match (format-time-string = (match-string 1) ct) t t))


<= span style=3D"font-size:12.8px">this should provide the behavior I'm lo= oking for with file+datetree+prompt, but still use the current time for oth= er capture types. Will this solution break anything?

Shankar

On Wed, Nov 4, 2015 at 2= :15 PM, Nick Dokos <ndokos@gmail.com> wrote:
Shankar Rao <shankar.rao@gmail.com> writes:

> For the following org capture template:
>
> (setq org-capture-templates
> =C2=A0 =C2=A0 =C2=A0 '(("d" "Date Tree Test" p= lain
> (file+datetree+prompt "~/org/testdt.org")
> "This date should be the date i picked: %<%y%m%d>")))<= br> >
> Though this is filed under the correct date in the datetree, no matter= what date I select in the prompt,
> the date displayed in the template is the current date. Is this a bug = or a feature?
>

It's a feature I guess - org-capture.el says:

=C2=A0 =C2=A0 =C2=A0 ;; The current time
=C2=A0 =C2=A0 =C2=A0 (goto-char (point-min))
=C2=A0 =C2=A0 =C2=A0 (while (re-search-forward "%<\\([^>\n]+\\)&= gt;" nil t)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (replace-match (format-time-string (match-strin= g 1)) t t))

and there is no provision for another time to be given here. I don't think there is any provision in the template for a time other than the
current time: at least I can't see a %-escape that takes a different time.

--
Nick



--001a113e5068e417750523bee432-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shankar Rao Subject: Re: org-capture-template: file+datetree+prompt not using prompted date in template Date: Wed, 4 Nov 2015 17:39:17 -0800 Message-ID: References: <87pozpifcb.fsf@alphaville.usersys.redhat.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c2ef10f55adb0523c13125 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57770) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zu9WJ-0002N4-Ld for emacs-orgmode@gnu.org; Wed, 04 Nov 2015 20:39:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zu9WI-0008KZ-2V for emacs-orgmode@gnu.org; Wed, 04 Nov 2015 20:39:19 -0500 Received: from mail-ob0-x231.google.com ([2607:f8b0:4003:c01::231]:33295) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zu9WH-0008KR-Rg for emacs-orgmode@gnu.org; Wed, 04 Nov 2015 20:39:17 -0500 Received: by obbww6 with SMTP id ww6so28585659obb.0 for ; Wed, 04 Nov 2015 17:39:17 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nick Dokos Cc: emacs-orgmode@gnu.org --001a11c2ef10f55adb0523c13125 Content-Type: text/plain; charset=UTF-8 Looks like a similar issue was addressed earlier here: http://sachachua.com/blog/2015/02/org-mode-reusing-date-file-datetree-prompt/ Shankar On Wed, Nov 4, 2015 at 2:54 PM, Shankar Rao wrote: > Earlier in org-capture-fill-template, there is the following: > > (let* (... > (ct (org-capture-get :default-time)) > ... > > The property :default-time defaults to the current time and is overwritten > by file+datetree+prompt, > > If ct was passed as a 2nd argument to format-time-string in your code > snippet: > > ;; The current time > (goto-char (point-min)) > (while (re-search-forward "%<\\([^>\n]+\\)>" nil t) > (replace-match (format-time-string (match-string 1) ct) t t)) > > this should provide the behavior I'm looking for with > file+datetree+prompt, but still use the current time for other capture > types. Will this solution break anything? > > Shankar > > On Wed, Nov 4, 2015 at 2:15 PM, Nick Dokos wrote: > >> Shankar Rao writes: >> >> > For the following org capture template: >> > >> > (setq org-capture-templates >> > '(("d" "Date Tree Test" plain >> > (file+datetree+prompt "~/org/testdt.org") >> > "This date should be the date i picked: %<%y%m%d>"))) >> > >> > Though this is filed under the correct date in the datetree, no matter >> what date I select in the prompt, >> > the date displayed in the template is the current date. Is this a bug >> or a feature? >> > >> >> It's a feature I guess - org-capture.el says: >> >> ;; The current time >> (goto-char (point-min)) >> (while (re-search-forward "%<\\([^>\n]+\\)>" nil t) >> (replace-match (format-time-string (match-string 1)) t t)) >> >> and there is no provision for another time to be given here. I don't >> think there is any provision in the template for a time other than the >> current time: at least I can't see a %-escape that takes a different >> time. >> >> -- >> Nick >> >> >> > --001a11c2ef10f55adb0523c13125 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Looks like a similar issue was addressed earlier here:

Shankar<= /div>

On Wed= , Nov 4, 2015 at 2:54 PM, Shankar Rao <shankar.rao@gmail.com> wrote:
Earlier in = org-capture-fill-template, there is the following:

(let* (...
=C2=A0 =C2=A0 =C2=A0 =C2=A0(ct (org= -capture-get :default-time))
=C2=A0 =C2=A0 =C2=A0 =C2=A0...
=
The property :default-time defaults to the curre= nt time and is overwritten by file+datetree+prompt,=C2=A0
=
If ct was passed as a 2nd argument to fo= rmat-time-string in your code snippet:

=C2=A0 =C2=A0 =C2= =A0 ;; The current time
=C2=A0 =C2=A0 =C2=A0 (goto-char (point-min))
=C2=A0 =C2=A0 = =C2=A0 (while (re-search-forward "%<\\([^>\n]+\\)>" nil = t)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (replace-match (format-time-string (match-= string 1) ct) t t))

=
this should provide the behavior I'm looking f= or with file+datetree+prompt, but still use the current time for other capt= ure types. Will this solution break anything?

= Shankar

On We= d, Nov 4, 2015 at 2:15 PM, Nick Dokos <ndokos@gmail.com> wrot= e:
Shankar Rao <shankar.rao@gmail.com> wr= ites:

> For the following org capture template:
>
> (setq org-capture-templates
> =C2=A0 =C2=A0 =C2=A0 '(("d" "Date Tree Test" p= lain
> (file+datetree+prompt "~/org/testdt.org")
> "This date should be the date i picked: %<%y%m%d>")))<= br> >
> Though this is filed under the correct date in the datetree, no matter= what date I select in the prompt,
> the date displayed in the template is the current date. Is this a bug = or a feature?
>

It's a feature I guess - org-capture.el says:

=C2=A0 =C2=A0 =C2=A0 ;; The current time
=C2=A0 =C2=A0 =C2=A0 (goto-char (point-min))
=C2=A0 =C2=A0 =C2=A0 (while (re-search-forward "%<\\([^>\n]+\\)&= gt;" nil t)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (replace-match (format-time-string (match-strin= g 1)) t t))

and there is no provision for another time to be given here. I don't think there is any provision in the template for a time other than the
current time: at least I can't see a %-escape that takes a different time.

--
Nick




--001a11c2ef10f55adb0523c13125--