From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: Re: new list item minor bug Date: Sun, 27 Sep 2009 19:41:19 -0400 Message-ID: <87bpkwarc0.fsf@stats.ox.ac.uk> References: <87fxa8arm9.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 1Ms3Mt-0004Wr-CJ for emacs-orgmode@gnu.org; Sun, 27 Sep 2009 19:41:27 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ms3Mo-0004VD-UU for emacs-orgmode@gnu.org; Sun, 27 Sep 2009 19:41:26 -0400 Received: from [199.232.76.173] (port=49252 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ms3Mo-0004VA-Ns for emacs-orgmode@gnu.org; Sun, 27 Sep 2009 19:41:22 -0400 Received: from markov.stats.ox.ac.uk ([163.1.210.1]:57677) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Ms3Mo-0003Ub-9g for emacs-orgmode@gnu.org; Sun, 27 Sep 2009 19:41:22 -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 n8RNfLul028403 for ; Mon, 28 Sep 2009 00:41:21 +0100 (BST) In-Reply-To: <87fxa8arm9.fsf@stats.ox.ac.uk> (Dan Davison's message of "Sun, 27 Sep 2009 19:35:10 -0400") 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 Dan Davison writes: > If you start a numbered list with > > 1. > > and hit M-RET then you get > > 2. > ^ > with a space, i.e. '2. ' > > However, when creating the 10th list item, there is no space after > '10.'. Sorry, what I meant to say is that there is a space, but that point is in front of the space. > Same for 99 -> 100. This isn't entirely trivial, because if you > start typing blindly after hitting M-RET, then the line you have created > (lacking the space) will not be recognised as a list item and so > e.g. the next M-RET will create a new heading, not a list item. [Has > this changed recently? This seems like something obvious that others > would have noticed.] > > Here's my patch. > > diff --git a/lisp/org-list.el b/lisp/org-list.el > index 2fea57b..8ece3ea 100644 > --- a/lisp/org-list.el > +++ b/lisp/org-list.el > @@ -813,7 +813,7 @@ with something like \"1.\" or \"2)\"." > (buffer-substring (point-at-bol) (match-beginning 3)))) > ;; (term (substring (match-string 3) -1)) > ind1 (n (1- arg)) > - fmt bobp old new) > + fmt bobp old new delta) > ;; find where this list begins > (org-beginning-of-item-list) > (setq bobp (bobp)) > @@ -835,7 +835,9 @@ with something like \"1.\" or \"2)\"." > (delete-region (match-beginning 2) (match-end 2)) > (goto-char (match-beginning 2)) > (insert (setq new (format fmt (setq n (1+ n))))) > - (org-shift-item-indentation (- (length new) (length old)))))) > + (setq delta (- (length new) (length old))) > + (org-shift-item-indentation delta) > + (if (= (org-current-line) line) (setq col (+ col delta)))))) > (org-goto-line line) > (org-move-to-column col))) > > Dan