From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: newline at start of buffer Date: Fri, 02 Oct 2009 23:33:24 -0400 Message-ID: <87hbuhp2wr.fsf@stats.ox.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MtvNK-0003rk-Ez for emacs-orgmode@gnu.org; Fri, 02 Oct 2009 23:33:38 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MtvNF-0003rR-25 for emacs-orgmode@gnu.org; Fri, 02 Oct 2009 23:33:37 -0400 Received: from [199.232.76.173] (port=47905 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MtvNE-0003rO-SR for emacs-orgmode@gnu.org; Fri, 02 Oct 2009 23:33:32 -0400 Received: from mx20.gnu.org ([199.232.41.8]:44925) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MtvNE-0005W4-GZ for emacs-orgmode@gnu.org; Fri, 02 Oct 2009 23:33:32 -0400 Received: from markov.stats.ox.ac.uk ([163.1.210.1]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MtvNC-00035I-Du for emacs-orgmode@gnu.org; Fri, 02 Oct 2009 23:33:30 -0400 Received: from blackcap.stats.ox.ac.uk (blackcap.stats [163.1.210.5]) by markov.stats.ox.ac.uk (8.13.6/8.13.6) with ESMTP id n933XQsv004888 for ; Sat, 3 Oct 2009 04:33:28 +0100 (BST) 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: emacs org-mode mailing list 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