From mboxrd@z Thu Jan 1 00:00:00 1970 From: c b <24x7x366@gmail.com> Subject: Re: Alternate format for datetree Date: Wed, 5 Sep 2012 22:42:18 -0700 Message-ID: References: <20532.1346040247@alphaville> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=e89a8f5034fe54ad1604c901f40f Return-path: Received: from eggs.gnu.org ([208.118.235.92]:37155) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <24x7x366@gmail.com>) id 1T9Ur7-0004Dz-Bp for emacs-orgmode@gnu.org; Thu, 06 Sep 2012 01:42:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <24x7x366@gmail.com>) id 1T9Ur5-0006BH-Cb for emacs-orgmode@gnu.org; Thu, 06 Sep 2012 01:42:21 -0400 Received: from mail-ie0-f169.google.com ([209.85.223.169]:47668) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <24x7x366@gmail.com>) id 1T9Ur5-0006B6-4q for emacs-orgmode@gnu.org; Thu, 06 Sep 2012 01:42:19 -0400 Received: by iec9 with SMTP id 9so2770728iec.0 for ; Wed, 05 Sep 2012 22:42:18 -0700 (PDT) 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: John Hendy , nicholas.dokos@hp.com, emacs-orgmode --e89a8f5034fe54ad1604c901f40f Content-Type: text/plain; charset=ISO-8859-1 Hi John and Nick, Thank a lot for your suggestions. I finally got it working. It took a while to figure out that the back-tick is different from the quote. I am an elisp newbie. Is there an easy explanation of why we need a back-tick vs. quote? Also, I found that while the template works, it creates a new tree every time I capture an entry as follows * 09 ** 05 *** 2012 - Wednesday **** [2012-09-05 Wed 22:31] My first working month tree note * 09 ** 05 *** 2012 - Wednesday **** [2012-09-05 Wed 22:31] My second month tree note #1. Is there any way to consolidate this like the following? * 09 ** 05 *** 2012 - Wednesday **** [2012-09-05 Wed 22:31] My first working month tree note **** [2012-09-05 Wed 22:3*5*] My first working month tree note #2 The time always is reported as 22:31 (I guess that's the time I launched emacs). Is there a way for the time stamp to be corrected based on the current time? I generally leave emacs running for days together, so the time it's launched doesn't really work for me. Once again, thanks a lot for your help! -c. b. On Sun, Aug 26, 2012 at 11:08 PM, John Hendy wrote: > On Sun, Aug 26, 2012 at 11:04 PM, Nick Dokos > wrote: > > John Hendy wrote: > > > >> On Sun, Aug 26, 2012 at 3:11 PM, c b <24x7x366@gmail.com> wrote: > >> > Hi, > >> > > >> > I have been using org-mode for about 18 months now and love it. I > recently > >> > came across the org-capture file+datetree format and it is just what > I am > >> > looking for, except that I need a slightly different format described > as > >> > below > >> > > >> > Currently format is > >> > > >> > * 2012 > >> > ** 2012-08 > >> > *** 2012-08-26 Sunday > >> > **** [2012-08-26 Sun 13:00] My note for this Sunday afternoon > >> > > >> > Needed format is > >> > > >> > * 08 > >> > ** 26 > >> > *** 2012 Sunday > >> > **** [2012-08-26 Sun 13:00] My note for this Sunday afternoon > >> > > >> > Basically, I need to have the "root" of the date tree on the month, > followed > >> > by date and then Year, so that for a particular date, I can see all > yearly > >> > activity. > >> > > >> > Is there currently a way to alter this? > >> > > >> > If not, how would I go about adding a file+monthtree format for > org-capture? > >> > > >> > Any suggestions would be appreciated > >> > >> I was looking for something similar and someone provided a custom > >> capture template that allowed for using inactive timestamps vs. the > >> default datetree format. > >> > >> See the example provided here: > >> - http://osdir.com/ml/emacs-orgmode-gnu/2012-08/msg00396.html > >> > >> I fiddled with this a bit, not really being familiar and learned a > >> good bit in the process to achieve your desired format. Give this a > >> try: > >> > >> #+begin_src .emacs > >> (setq org-capture-templates > >> `(("t" "test" entry > >> (file+headline "~/file.org" > >> ,(format "%s" > >> (format-time-string "%m"))) > >> ,(format "** %s \n*** %s-%s \n**** [%s-%s-%s %s %s:%s] " > >> (format-time-string "%d") > >> (format-time-string "%Y") > >> (format-time-string "%A") > >> (format-time-string "%Y") > >> (format-time-string "%m") > >> (format-time-string "%d") > >> (format-time-string "%a") > >> (format-time-string "%H") > >> (format-time-string "%M")) > >> ))) > >> #+end_src > >> > >> One thing I couldn't figure out was how to insert a %? after that > >> second long format option. If I just put in %?, loading .emacs caused > >> the error "Not enough arguments to format" or something like that. I'm > >> sure there's some secret elisp escape syntax I just don't know. I > >> tried various combinations of \ and '("") with no success. > >> > > > > Try > > > > --8<---------------cut here---------------start------------->8--- > > ,(format "** %s \n*** %s-%s \n**** [%s-%s-%s %s %s:%s] %%?" > > --8<---------------cut here---------------end--------------->8--- > > > > You basically need to escape the % from being interpreted by format. > > C-h f format RET says > > > > ,---- > > | ... > > | Use %% to put a single % into the output. > > | ... > > `---- > > Perfect -- thanks! > John > > > > > Nick > > > >> That'd put the finishing touch on things so your cursor was where you > wanted it. > >> > >> Also, for those seeing this... is this how you would accomplish c.b's > >> goal? I just used the sample provided to me in the earlier mailing > >> list email to see if I was up for the challenge, but I have no basis > >> for knowing whether it's a good solution. > >> > >> > >> Hope that helps! > >> John > >> > >> > > >> > Kindly copy me on the response as I am not subscribed to this mailing > list. > >> > > >> > Thanks, > >> > c.b. > >> > --e89a8f5034fe54ad1604c901f40f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi John and Nick,

Thank a lot for your suggestions. I fi= nally got it working. It took a while to figure out that the back-tick is d= ifferent from the quote.
I am an elisp newbie. Is there an easy e= xplanation of why we need a back-tick vs. quote?

Also, I found that while the template works, it creates= a new tree every time I capture an entry as follows

* 09
** 05
*** 2012 - Wednesday
**** [2012= -09-05 Wed 22:31] My first working month tree note

* 09
** 05
*** 2012 - Wednesda= y
**** [2012-09-05 Wed 22:31] My second month tree note

#1. Is there any way to consolidate this like the fol= lowing?

* 09
** 05
*** 2012 - Wednesda= y
**** [2012-09-05 Wed 22:31] My first working month tree note
**** [2012-09-05 Wed 22:35] My first working month tre= e note

#2 The time always is reported as 22:31 (I guess that&#= 39;s the time I launched emacs). Is there a way for the time stamp to be co= rrected based on the current time? I generally leave emacs running for days= together, so the time it's launched doesn't really work for me.

Once again, thanks a lot for your help!

<= /div>
-c. b.

On Sun, Aug 26, 2= 012 at 11:08 PM, John Hendy <jw.hendy@gmail.com> wrote:
On S= un, Aug 26, 2012 at 11:04 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
> John Hendy <jw.hendy@gmail.co= m> wrote:
>
>> On Sun, Aug 26, 2012 at 3:11 PM, c b <24x7x366@gmail.com> wrote:
>> > Hi,
>> >
>> > I have been using org-mode for about 18 months now and love i= t. I recently
>> > came across the org-capture file+datetree format and it is ju= st what I am
>> > looking for, except that I need a slightly different format d= escribed as
>> > below
>> >
>> > Currently format is
>> >
>> > * 2012
>> > ** 2012-08
>> > *** 2012-08-26 Sunday
>> > **** [2012-08-26 Sun 13:00] My note for this Sunday afternoon=
>> >
>> > Needed format is
>> >
>> > * 08
>> > ** 26
>> > *** 2012 Sunday
>> > **** [2012-08-26 Sun 13:00] My note for this Sunday afternoon=
>> >
>> > Basically, I need to have the "root" of the date tr= ee on the month, followed
>> > by date and then Year, so that for a particular date, I can s= ee all yearly
>> > activity.
>> >
>> > Is there currently a way to alter this?
>> >
>> > If not, how would I go about adding a file+monthtree format f= or org-capture?
>> >
>> > Any suggestions would be appreciated
>>
>> I was looking for something similar and someone provided a custom<= br> >> capture template that allowed for using inactive timestamps vs. th= e
>> default datetree format.
>>
>> See the example provided here:
>> - http://osdir.com/ml/emacs-orgmode-gnu/2012-08/msg= 00396.html
>>
>> I fiddled with this a bit, not really being familiar and learned a=
>> good bit in the process to achieve your desired format. Give this = a
>> try:
>>
>> #+begin_src .emacs
>> (setq org-capture-templates
>> `(("t" "test" entry
>> (file+headline "~/file.org"
>> ,(format "%s"
>> (format-time-string "%m")))
>> ,(format "** %s \n*** %s-%s \n**** [%s-%s-%s %s %s:%s] "=
>> (format-time-string "%d")
>> (format-time-string "%Y")
>> (format-time-string "%A")
>> (format-time-string "%Y")
>> (format-time-string "%m")
>> (format-time-string "%d")
>> (format-time-string "%a")
>> (format-time-string "%H")
>> (format-time-string "%M"))
>> )))
>> #+end_src
>>
>> One thing I couldn't figure out was how to insert a %? after t= hat
>> second long format option. If I just put in %?, loading .emacs cau= sed
>> the error "Not enough arguments to format" or something = like that. I'm
>> sure there's some secret elisp escape syntax I just don't = know. I
>> tried various combinations of \ and '("") with no su= ccess.
>>
>
> Try
>
> --8<---------------cut here---------------start------------->8--= -
> ,(format "** %s \n*** %s-%s \n**** [%s-%s-%s %s %s:%s] %%?"<= br> > --8<---------------cut here---------------end--------------->8--= -
>
> You basically need to escape the % from being interpreted by format. > C-h f format RET says
>
> ,----
> | ...
> | Use %% to put a single % into the output.
> | ...
> `----

Perfect -- thanks!
John

>
> Nick
>
>> That'd put the finishing touch on things so your cursor was wh= ere you wanted it.
>>
>> Also, for those seeing this... is this how you would accomplish c.= b's
>> goal? I just used the sample provided to me in the earlier mailing=
>> list email to see if I was up for the challenge, but I have no bas= is
>> for knowing whether it's a good solution.
>>
>>
>> Hope that helps!
>> John
>>
>> >
>> > Kindly copy me on the response as I am not subscribed to this= mailing list.
>> >
>> > Thanks,
>> > c.b.
>>

--e89a8f5034fe54ad1604c901f40f--