From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: [PATCH]: Fix to spreadsheet ranges in A1 style Date: Mon, 20 Aug 2007 07:42:49 +0200 Message-ID: <6795ad47e5dc3272587340097756a1e8@science.uva.nl> References: <871wdyq5xy.fsf@freed.localdomain> Mime-Version: 1.0 (Apple Message framework v624) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IN02N-00062g-BK for emacs-orgmode@gnu.org; Mon, 20 Aug 2007 01:42:51 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IN02M-00061k-RE for emacs-orgmode@gnu.org; Mon, 20 Aug 2007 01:42:50 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IN02M-00061J-EP for emacs-orgmode@gnu.org; Mon, 20 Aug 2007 01:42:50 -0400 Received: from korteweg.uva.nl ([146.50.98.70]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IN02M-0006I1-87 for emacs-orgmode@gnu.org; Mon, 20 Aug 2007 01:42:50 -0400 In-Reply-To: <871wdyq5xy.fsf@freed.localdomain> 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: Bake Timmons Cc: emacs-orgmode@gnu.org On Aug 20, 2007, at 4:46, Bake Timmons wrote: > A simple elisp formula in the spreadsheet indicated a couple of errors > in the handling of ranges: > > '(car '(A4..C4)) > > This was using org.el from the latest Emacs cvs MAIN branch. I have > appended a patch against this as one possible fix. Thanks. > > --- src/emacs/lisp/textmodes/org.el 2007-08-18 20:37:11.000000000 -0400 > +++ build/emacs/lisp/textmodes/org.el 2007-08-19 22:27:06.000000000 > -0400 > @@ -8839,6 +8839,7 @@ > (if (eq lispp 'literal) > x > (prin1-to-string (if numbers (string-to-number x) x)))) > + elements > " ") Yes, this was a bug. > (concat "[" (mapconcat > (lambda (x) > @@ -9131,8 +9132,11 @@ > ((match-end 3) > ;; format match, just advance > (setq start (match-end 0))) > - ((and (> (match-beginning 0) 0) > - (equal ?. (aref s (max (1- (match-beginning 0)) 0)))) > + ((let ((pos (match-beginning 0))) > + (and (> pos 0) > + (equal ?. (aref s (1- pos))) > + ;; not using .. for a range reference > + (or (< pos 2) (not (equal ?. (aref s (1- pos))))))) > ;; 3.e5 or something like this. FIXME: is this ok???? > (setq start (match-end 0))) > (t Could you please explain this part of the patch to me? Thanks. - Carsten