From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bingo UV Subject: Re: how to add some features in a newly added headline? Date: Sat, 16 Jan 2016 22:48:58 +0530 Message-ID: <20160116224858.3fc154b8@dhcppc15> References: <20160116184412.22e45a7b@dhcppc15> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42196) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aKUVJ-0006Bm-T3 for emacs-orgmode@gnu.org; Sat, 16 Jan 2016 12:19:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aKUVG-0004Ay-Mr for emacs-orgmode@gnu.org; Sat, 16 Jan 2016 12:19:09 -0500 Received: from mail-pa0-x244.google.com ([2607:f8b0:400e:c03::244]:34165) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aKUVG-0004Au-F2 for emacs-orgmode@gnu.org; Sat, 16 Jan 2016 12:19:06 -0500 Received: by mail-pa0-x244.google.com with SMTP id yy13so30717218pab.1 for ; Sat, 16 Jan 2016 09:19:06 -0800 (PST) Received: from dhcppc15 ([122.166.95.204]) by smtp.gmail.com with ESMTPSA id v75sm23000009pfa.60.2016.01.16.09.19.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Jan 2016 09:19:05 -0800 (PST) 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: "emacs-orgmode@gnu.org" Hi John, Thanks a lot. In org 8.3, there seems to be no org-end-of-meta-data-and-drawers. If I replace it with org-end-of-meta-data, I get a PROPERTIES drawer which is open, not collapsed. Since it is a new heading, it should have no drawers, so I am guessing org-end-of-meta-data-and-drawers and org-end-of-meta-data should be identical? I don't want to sound too demanding about a collapsed PROPERTIES drawer but it is so distracting I cannot stop myself from compulsively collapsing it after adding every heading. Which is when I added the insert-char and 2 org-cycles. (sorry, meant to reply to mailing list, not personally) On Sat, 16 Jan 2016 08:59:17 -0500 John Kitchin wrote: > 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