瀏覽代碼

Improve error message for invalid rows in org-table.el.

Carsten Dominik 17 年之前
父節點
當前提交
236f6c7ff9
共有 2 個文件被更改,包括 11 次插入3 次删除
  1. 5 0
      lisp/ChangeLog
  2. 6 3
      lisp/org-table.el

+ 5 - 0
lisp/ChangeLog

@@ -1,3 +1,8 @@
+2008-05-28  Carsten Dominik  <dominik@science.uva.nl>
+
+	* org-table.el (org-table-recalculate): Improve error message if
+	the row number is invalid.
+
 2008-05-27  Carsten Dominik  <dominik@science.uva.nl>
 
 	* org-archive.el (org-archive-save-context-info): Fix bugs in

+ 6 - 3
lisp/org-table.el

@@ -2376,7 +2376,7 @@ With prefix arg ALL, do this for all lines in the table."
       (goto-char beg)
       (and all (message "Re-applying formulas to full table..."))
 
-      ;; First find the named fields, and mark them untouchanble
+      ;; First find the named fields, and mark them untouchable
       (remove-text-properties beg end '(org-untouchable t))
       (while (setq eq (pop eqlname))
 	(setq name (car eq)
@@ -2384,8 +2384,11 @@ With prefix arg ALL, do this for all lines in the table."
 	(and (not a)
 	     (string-match "@\\([0-9]+\\)\\$\\([0-9]+\\)" name)
 	     (setq a (list name
-			   (aref org-table-dlines
-				 (string-to-number (match-string 1 name)))
+			   (condition-case nil
+			       (aref org-table-dlines
+				     (string-to-number (match-string 1 name)))
+			     (error (error "Invalid row number in %s"
+					   name)))
 			   (string-to-number (match-string 2 name)))))
 	(when (and a (or all (equal (nth 1 a) thisline)))
 	  (message "Re-applying formula to field: %s" name)