[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Insert datetree entry
From: |
Daniele Nicolodi |
Subject: |
Re: [O] Insert datetree entry |
Date: |
Tue, 4 Apr 2017 12:42:24 -0600 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 |
On 4/3/17 5:37 PM, Bruce V Chiarelli wrote:
>
> Daniele Nicolodi writes:
>
>> Hello,
>>
>> there is a way in org-mode to insert a datetree entry without going
>> through the org-capture? Ideally the function would jump to the
>> datetree and inser an headline for the current day if one is not
>> present, or move to the end of it if one is present.
>>
>> I haven't found anything like this in the manual. I'm now digging in the
>> code. Hopefully it is not something too hard to implement with my
>> lacking elisp knowledge.
>
> I don't believe there really is one, but I've had to do it a couple of
> times myself. This is my solution (I'm not a lisp expert either, but it
> did the job):
>
> (defun bc/org-new-datetree-at-point
> (interactive)
> (org-up-heading-safe)
> (org-datetree-find-date-create
> (calendar-gregorian-from-absolute (org-today))
> 'subtree-at-point))
>
> This will make the datetree as a subheading of the current heading (or
> find it if it already exists). Getting rid of 'subtree-at-point will
> make the year a level 1 heading at the end of the file, like with
> org-capture.
Hi Bruce,
thanks for the hint, but I don't understand what `subtree-at-point` is
in your code, it does not seem to be defined in my emacs and
`org-datetree-find-date-create` has a third parameter that is
interpreted as a boolean. I'm confused.
Cheers,
Daniele
- [O] Insert datetree entry, Daniele Nicolodi, 2017/04/03
- Re: [O] Insert datetree entry, Bruce V Chiarelli, 2017/04/03
- Re: [O] Insert datetree entry,
Daniele Nicolodi <=
- Re: [O] Insert datetree entry, Bruce V Chiarelli, 2017/04/04
- Re: [O] Insert datetree entry, Daniele Nicolodi, 2017/04/04
- Re: [O] Insert datetree entry, Daniele Nicolodi, 2017/04/04
- Re: [O] Insert datetree entry, Bruce V Chiarelli, 2017/04/05
- Re: [O] Insert datetree entry, Daniele Nicolodi, 2017/04/05