summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2015-08-03 22:56:22 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2015-08-03 22:58:39 +0200
commita70604eb6337464ba86d713a81297a1312bc9334 (patch)
tree88098b9c8a0df222f194f790b40b7c635d7558fa
parenta3b2b7473ecfe019134bb68759fa726040197ed1 (diff)
downloadorg-mode-a70604eb6337464ba86d713a81297a1312bc9334.tar.gz
org-table: Fix computation with backwards ranges
* lisp/org-table.el (org-table-get-range): Use correct values to extract range. This is important when range is defined backwards (e.g., @-I..@-II). Reported-by: Sebastien Vauban <http://permalink.gmane.org/gmane.emacs.orgmode/99430>
-rw-r--r--lisp/org-table.el10
1 files changed, 5 insertions, 5 deletions
diff --git a/lisp/org-table.el b/lisp/org-table.el
index 4bde140..62de402 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -2939,16 +2939,16 @@ and column2 are table column numbers."
(last-column (max c1 c2)))
(if corners-only (list first-row first-column last-row last-column)
;; Copy the range values into a list.
- (forward-line (- r1 thisline))
+ (forward-line (- first-row thisline))
(while (not (looking-at org-table-dataline-regexp))
(forward-line)
- (incf r1))
- (org-table-goto-column c1)
+ (incf first-row))
+ (org-table-goto-column first-column)
(let ((beg (point)))
- (forward-line (- r2 r1))
+ (forward-line (- last-row first-row))
(while (not (looking-at org-table-dataline-regexp))
(forward-line -1))
- (org-table-goto-column c2)
+ (org-table-goto-column last-column)
(let ((end (point)))
(when highlight
(org-table-highlight-rectangle