From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: newline at start of buffer Date: Sat, 3 Oct 2009 09:24:30 +0200 Message-ID: References: <87hbuhp2wr.fsf@stats.ox.ac.uk> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mtyyw-0000gO-Fj for emacs-orgmode@gnu.org; Sat, 03 Oct 2009 03:24:42 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mtyyr-0000V3-GL for emacs-orgmode@gnu.org; Sat, 03 Oct 2009 03:24:41 -0400 Received: from [199.232.76.173] (port=50727 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mtyyr-0000Uv-EC for emacs-orgmode@gnu.org; Sat, 03 Oct 2009 03:24:37 -0400 Received: from mx20.gnu.org ([199.232.41.8]:58542) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mtyyq-0005Zc-Rj for emacs-orgmode@gnu.org; Sat, 03 Oct 2009 03:24:37 -0400 Received: from mail-ew0-f208.google.com ([209.85.219.208]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mtyyp-000725-Ty for emacs-orgmode@gnu.org; Sat, 03 Oct 2009 03:24:36 -0400 Received: by ewy4 with SMTP id 4so1430798ewy.31 for ; Sat, 03 Oct 2009 00:24:34 -0700 (PDT) In-Reply-To: <87hbuhp2wr.fsf@stats.ox.ac.uk> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Dan Davison Cc: emacs org-mode mailing list Hi Dan, this was a stupid hack to get the headline away from the first buffer line which can cause problems in Org under some circumstances which are hard to consistently remove. It looks a the empty buffer case because this is what will happen when people open a new buffer and immediately create a headline in this way. When there is already something in the buffer, even a space, I am assuming the user wants to be in control. If it is not bothering you a lot, I'd like to keep it this way. - Carsten On Oct 3, 2009, at 5:33 AM, Dan Davison wrote: > In a completely empty buffer, org-insert-heading inserts a newline > before the first heading. However, if there is (e.g.) a single space > character in the buffer (after point), the heading goes on the first > line. I admit it's trivial, but that doesn't seem right -- there > presumably isn't a reason for the newline in the first case and not in > the second, right? (My preference would be no automatic blank line.) > > Dan > > diff --git a/lisp/org.el b/lisp/org.el > index 73ef6c5..4883a2f 100644 > --- a/lisp/org.el > +++ b/lisp/org.el > @@ -5754,7 +5754,7 @@ current headline. If point is not at the > beginning, do not split the line, > but create the new headline after the current line." > (interactive "P") > (if (= (buffer-size) 0) > - (insert "\n* ") > + (insert "* ") > (when (or force-heading (not (org-insert-item))) > (let* ((empty-line-p nil) > (head (save-excursion > > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode