all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Daniele Nicolodi <daniele@grinta.net>
To: emacs-orgmode@gnu.org
Subject: Re: Insert datetree entry
Date: Tue, 4 Apr 2017 12:42:24 -0600	[thread overview]
Message-ID: <92332b50-c4a8-73a3-f506-c058fb54b9de@grinta.net> (raw)
In-Reply-To: <87fuhp83ls.fsf@topd0g>

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

  reply	other threads:[~2017-04-04 18:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-03 22:40 Insert datetree entry Daniele Nicolodi
2017-04-03 23:37 ` Bruce V Chiarelli
2017-04-04 18:42   ` Daniele Nicolodi [this message]
2017-04-04 19:25     ` Bruce V Chiarelli
2017-04-04 19:50       ` Daniele Nicolodi
2017-04-04 21:18       ` Daniele Nicolodi
2017-04-05 21:40         ` Bruce V Chiarelli
2017-04-05 23:19           ` Daniele Nicolodi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=92332b50-c4a8-73a3-f506-c058fb54b9de@grinta.net \
    --to=daniele@grinta.net \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.