From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brady Trainor Subject: Re: New headline after no content (empty headline) Date: Fri, 28 Mar 2014 05:57:15 +0000 (UTC) Message-ID: References: <874n2xtzrv.fsf@bzg.ath.cx> <87ob0xmhzc.fsf@bzg.ath.cx> 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]:36026) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTPnZ-0001AD-FS for emacs-orgmode@gnu.org; Fri, 28 Mar 2014 01:57:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WTPnT-0004Yh-Gq for emacs-orgmode@gnu.org; Fri, 28 Mar 2014 01:57:49 -0400 Received: from plane.gmane.org ([80.91.229.3]:47018) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTPnT-0004XB-9n for emacs-orgmode@gnu.org; Fri, 28 Mar 2014 01:57:43 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WTPnQ-0005Ua-1Y for emacs-orgmode@gnu.org; Fri, 28 Mar 2014 06:57:40 +0100 Received: from 71-217-24-179.tukw.qwest.net ([71.217.24.179]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 28 Mar 2014 06:57:40 +0100 Received: from algebrat by 71-217-24-179.tukw.qwest.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 28 Mar 2014 06:57:40 +0100 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 Bastien gnu.org> writes: > ---does the Org version that comes from the maint branch > still needs a fix? If so, can you describe the problem > again? I did test the `maint` branch today. The behavior was not ideal for my funny use-case. For `org-insert-heading' (M-RET), I wanted the following action on empty headlines: "* " |--> "* \n* ", rather than "*\n* ". This patch may be suitable: (org.el) ========================== diff --git a/lisp/org.el b/lisp/org.el index 6d6fbeb..86eb347 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -7685,9 +7685,10 @@ This is important for non-interactive uses of the command." So this will delete or add empty lines." (save-excursion (goto-char (point-at-bol)) - (if (looking-back "\\s-+" nil 'greedy) - (replace-match "")) - (or (bobp) (insert "\n")) + (unless (looking-back "\* \n") + (if (looking-back "\\s-+" nil 'greedy) + (replace-match "")) + (or (bobp) (insert "\n"))) (while (> N 0) (insert "\n") (setq N (1- N))))) ========================== Thank you! Brady