From 236f6c7ff915f25ade41efc4b01033809844b74d Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Wed, 28 May 2008 14:11:33 +0200 Subject: [PATCH] Improve error message for invalid rows in org-table.el. --- lisp/ChangeLog | 5 +++++ lisp/org-table.el | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f9b359804..2fe377235 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2008-05-28 Carsten Dominik + + * org-table.el (org-table-recalculate): Improve error message if + the row number is invalid. + 2008-05-27 Carsten Dominik * org-archive.el (org-archive-save-context-info): Fix bugs in diff --git a/lisp/org-table.el b/lisp/org-table.el index 5e0c0cd27..2c8ce9843 100644 --- a/lisp/org-table.el +++ b/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)