Parcourir la source

org-table.el: Fix bug: make sure references to $0 are correctly handled.

* org-table.el (org-table-get-range): Fix bug: make sure
references to $0 are correctly handled.

Thanks to Nick Dokos for the suggestion.

This fixes the computation of values in this table:

| Record   |        Slope |    ConfLower |    ConfUpper |
|----------+--------------+--------------+--------------|
| GISTEMP  | 0.0173837600 | 0.0133209130 | 0.0214466060 |
| HadCrut3 | 0.0158602890 | 0.0118664610 | 0.0198541180 |

See this message/thread:
http://article.gmane.org/gmane.emacs.orgmode/54341
Bastien Guerry il y a 13 ans
Parent
commit
bf4d38b1fb
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      lisp/org-table.el

+ 2 - 2
lisp/org-table.el

@@ -2663,8 +2663,8 @@ in the buffer and column1 and column2 are table column numbers."
 ;      (setq r2 (or r2 r1) c2 (or c2 c1))
 ;      (setq r2 (or r2 r1) c2 (or c2 c1))
       (if (not r1) (setq r1 thisline))
       (if (not r1) (setq r1 thisline))
       (if (not r2) (setq r2 thisline))
       (if (not r2) (setq r2 thisline))
-      (if (not c1) (setq c1 col))
-      (if (not c2) (setq c2 col))
+      (if (or (not c1) (= 0 c1)) (setq c1 col))
+      (if (or (not c2) (= 0 c2)) (setq c2 col))
       (if (and (not corners-only)
       (if (and (not corners-only)
 	       (or (not rangep) (and (= r1 r2) (= c1 c2))))
 	       (or (not rangep) (and (= r1 r2) (= c1 c2))))
 	  ;; just one field
 	  ;; just one field