From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bake Timmons Subject: [PATCH]: Fix to spreadsheet ranges in A1 style Date: Sun, 19 Aug 2007 22:46:01 -0400 Message-ID: <871wdyq5xy.fsf@freed.localdomain> 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 1IMxHT-0004jd-0m for emacs-orgmode@gnu.org; Sun, 19 Aug 2007 22:46:15 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IMxHR-0004hK-Ih for emacs-orgmode@gnu.org; Sun, 19 Aug 2007 22:46:14 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IMxHR-0004h9-G2 for emacs-orgmode@gnu.org; Sun, 19 Aug 2007 22:46:13 -0400 Received: from smtp103.vzn.mail.dcn.yahoo.com ([209.73.179.141]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1IMxHR-0008CP-A1 for emacs-orgmode@gnu.org; Sun, 19 Aug 2007 22:46:13 -0400 Received: from b3po by freed.localdomain with local (Exim 4.60) (envelope-from ) id 1IMxHF-00061n-Bi for emacs-orgmode@gnu.org; Sun, 19 Aug 2007 22:46:01 -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-orgmode@gnu.org 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 " ") (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