From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: how to add some features in a newly added headline? Date: Sat, 16 Jan 2016 08:59:17 -0500 Message-ID: References: <20160116184412.22e45a7b@dhcppc15> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a114433ecfe5bc7052973ec72 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39230) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aKRNw-0000a2-Dq for emacs-orgmode@gnu.org; Sat, 16 Jan 2016 08:59:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aKRNv-0001AS-A6 for emacs-orgmode@gnu.org; Sat, 16 Jan 2016 08:59:20 -0500 Received: from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]:37843) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aKRNu-0001AK-VP for emacs-orgmode@gnu.org; Sat, 16 Jan 2016 08:59:19 -0500 Received: by mail-wm0-x231.google.com with SMTP id n5so3664009wmn.0 for ; Sat, 16 Jan 2016 05:59:18 -0800 (PST) In-Reply-To: <20160116184412.22e45a7b@dhcppc15> 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: Bingo UV Cc: "emacs-orgmode@gnu.org" --001a114433ecfe5bc7052973ec72 Content-Type: text/plain; charset=UTF-8 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 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 --001a114433ecfe5bc7052973ec72 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I would define a function for t= his, so you can call it only when you want. this does what you describe for= me (org 8.2.10)

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

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



On Sat, Jan 16, 2016 at 8:14 AM, Bingo UV <right.ho@gmai= l.com> wrote:
(add-hook 'org-insert-heading-hook
=C2=A0 =C2=A0 =C2=A0 '(lambda()
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(org-id-get-create) ;-> Adds ID proper= ty
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(insert-char 48) ;-> required for next= 2 org-cycles to collapse the properties drawer
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(org-cycle)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(org-cycle)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(save-excursion ;-> add time stamp
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(org-end-of-meta-data t)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(org-time-stamp-inactive '(16)= )
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(newline)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0)
=C2=A0 =C2=A0 =C2=A0 )



Jo= hn

-----------------------------------
Professor John Kitchin=C2= =A0
Doherty Hall A207F
Department of Chemical Engineering
Carnegie= Mellon University
Pittsburgh, PA 15213
412-268-7803
=
--001a114433ecfe5bc7052973ec72--