From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leo Subject: patch from master branch attached (was: C-RET errs) Date: Wed, 03 Mar 2010 16:41:54 +0000 Message-ID: References: <87pr3nd9ya.wl%maus.david@gmail.com> 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 1Nmrdv-00012p-Qb for emacs-orgmode@gnu.org; Wed, 03 Mar 2010 11:41:51 -0500 Received: from [140.186.70.92] (port=50109 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nmrdu-000122-VR for emacs-orgmode@gnu.org; Wed, 03 Mar 2010 11:41:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nmrdt-0000IR-Vi for emacs-orgmode@gnu.org; Wed, 03 Mar 2010 11:41:50 -0500 Received: from ppsw-6.csi.cam.ac.uk ([131.111.8.136]:41459) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nmrdt-0000IN-Nk for emacs-orgmode@gnu.org; Wed, 03 Mar 2010 11:41:49 -0500 In-Reply-To: (Leo's message of "Wed, 03 Mar 2010 16:24:46 +0000") 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: David Maus , Carsten Dominik Cc: emacs-orgmode@gnu.org > Only if debian fixed this bug. > > I can reproduce this bug on Gnu/Linux with these steps. > > 1. git clone --depth 1 git://repo.or.cz/org-mode.git > 2. go into the lisp dir and start emacs like this: emacs -q -L . > 3. goto the scratch buffer and 'M-x org-mode' and then 'C-RET' The following patch from the master branch should fix this bug. Carsten, would you be able to fix it in Emacs upstream? Many thanks. Leo. --- a/org.el 2010-03-03 16:36:22.000000000 +0000 +++ b/org.el 2010-03-03 16:37:09.000000000 +0000 @@ -5965,21 +5965,26 @@ (save-match-data (looking-at "[ \t]*$"))))) -(defun org-insert-heading (&optional force-heading) +(defun org-insert-heading (&optional force-heading invisible-ok) "Insert a new heading or item with same depth at point. If point is in a plain list and FORCE-HEADING is nil, create a new list item. If point is at the beginning of a headline, insert a sibling before the 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) +but create the new headline after the current line. +When INVISIBLE-OK is set, stop at invisible headlines when going back. +This is important for non-interactive uses of the command." + (interactive "P") + (if (or (= (buffer-size) 0) + (and (not (save-excursion (and (ignore-errors (org-back-to-heading invisible-ok)) + (org-on-heading-p)))) + (not (org-in-item-p)))) (insert "\n* ") (when (or force-heading (not (org-insert-item))) (let* ((empty-line-p nil) (head (save-excursion (condition-case nil (progn - (org-back-to-heading) + (org-back-to-heading invisible-ok) (setq empty-line-p (org-previous-line-empty-p)) (match-string 0)) (error "*")))) Diff finished. Wed Mar 3 16:37:49 2010 -- H A P P Y H O L I D A Y S!