From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: patch from master branch attached (was: C-RET errs) Date: Wed, 3 Mar 2010 18:29:34 +0100 Message-ID: References: <87pr3nd9ya.wl%maus.david@gmail.com> 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 1NmsOD-0004jW-8g for emacs-orgmode@gnu.org; Wed, 03 Mar 2010 12:29:41 -0500 Received: from [140.186.70.92] (port=53097 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NmsOC-0004jM-BT for emacs-orgmode@gnu.org; Wed, 03 Mar 2010 12:29:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NmsOB-0005fq-KI for emacs-orgmode@gnu.org; Wed, 03 Mar 2010 12:29:40 -0500 Received: from mail-ew0-f222.google.com ([209.85.219.222]:46884) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NmsOB-0005fm-C3 for emacs-orgmode@gnu.org; Wed, 03 Mar 2010 12:29:39 -0500 Received: by ewy22 with SMTP id 22so1279786ewy.26 for ; Wed, 03 Mar 2010 09:29:37 -0800 (PST) In-Reply-To: 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: Leo Cc: emacs-orgmode@gnu.org Hi Leo, feel free to fix this in Emacs - I will update Emacs only after the next Emacs release - it is too much work for me to make partial fixes. - Carsten On Mar 3, 2010, at 5:41 PM, Leo wrote: >> 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! - Carsten