From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: new list item minor bug Date: Mon, 28 Sep 2009 07:38:23 +0100 Message-ID: References: <87fxa8arm9.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 1MsAyG-0008Eb-FK for emacs-orgmode@gnu.org; Mon, 28 Sep 2009 03:48:32 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MsAyB-0008AD-CH for emacs-orgmode@gnu.org; Mon, 28 Sep 2009 03:48:31 -0400 Received: from [199.232.76.173] (port=37136 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MsAyB-0008A4-7v for emacs-orgmode@gnu.org; Mon, 28 Sep 2009 03:48:27 -0400 Received: from mx20.gnu.org ([199.232.41.8]:4339) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MsAyA-0005EA-Nt for emacs-orgmode@gnu.org; Mon, 28 Sep 2009 03:48:26 -0400 Received: from ey-out-1920.google.com ([74.125.78.149]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MsAy9-0007VZ-9E for emacs-orgmode@gnu.org; Mon, 28 Sep 2009 03:48:25 -0400 Received: by ey-out-1920.google.com with SMTP id 3so1945739eyh.34 for ; Mon, 28 Sep 2009 00:48:23 -0700 (PDT) In-Reply-To: <87fxa8arm9.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 Applied, thanks. - Carsten On Sep 28, 2009, at 12:35 AM, Dan Davison wrote: > 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.'. 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. > > --8<---------------cut here---------------start------------->8--- > 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))) > --8<---------------cut here---------------end--------------->8--- > > Dan > > > _______________________________________________ > 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