emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: John Kitchin <jkitchin@andrew.cmu.edu>
To: Bingo UV <right.ho@gmail.com>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: how to add some features in a newly added headline?
Date: Sat, 16 Jan 2016 08:59:17 -0500	[thread overview]
Message-ID: <CAJ51ETr-mbpUHpLyg7gTbYEdOkX9x-ccK1B+_NN1E5VEK5rZpg@mail.gmail.com> (raw)
In-Reply-To: <20160116184412.22e45a7b@dhcppc15>

[-- Attachment #1: Type: text/plain, Size: 1084 bytes --]

I would define a function for this, so you can call it only when you want.
this does what you describe for me (org 8.2.10)

(defun my-heading ()
  (interactive)
  (org-insert-heading)
  (org-id-get-create)

  (save-excursion ;-> add time stamp
    (org-end-of-meta-data-and-drawers)
    (newline)
    (org-time-stamp-inactive '(16))))



On Sat, Jan 16, 2016 at 8:14 AM, Bingo UV <right.ho@gmail.com> wrote:

> (add-hook 'org-insert-heading-hook
>       '(lambda()
>          (org-id-get-create) ;-> Adds ID property
>          (insert-char 48) ;-> required for next 2 org-cycles to collapse
> the properties drawer
>          (org-cycle)
>          (org-cycle)
>          (save-excursion ;-> add time stamp
>            (org-end-of-meta-data t)
>            (org-time-stamp-inactive '(16))
>            (newline)
>            )
>          )
>       )
>



John

-----------------------------------
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu

[-- Attachment #2: Type: text/html, Size: 2342 bytes --]

  reply	other threads:[~2016-01-16 13:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-16 13:14 how to add some features in a newly added headline? Bingo UV
2016-01-16 13:59 ` John Kitchin [this message]
2016-01-16 17:18   ` Bingo UV

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

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=CAJ51ETr-mbpUHpLyg7gTbYEdOkX9x-ccK1B+_NN1E5VEK5rZpg@mail.gmail.com \
    --to=jkitchin@andrew.cmu.edu \
    --cc=emacs-orgmode@gnu.org \
    --cc=right.ho@gmail.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).