summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2014-02-06 09:58:17 +0100
committerBastien Guerry <bzg@altern.org>2014-02-06 09:58:17 +0100
commit323c7b3de2211a7d61bf0c71c6f5923b1ea62297 (patch)
tree58bba1134a59197661261961edadaf14987f6a2a
parentf4f3f140accee7c6b18eee806465e847b940e3d9 (diff)
downloadorg-mode-323c7b3de2211a7d61bf0c71c6f5923b1ea62297.tar.gz
org-table.el: Fix bugs about cursor repositioning
* org-table.el (org-table-copy-down) (org-table-find-dataline, org-table-move-row) (org-table-insert-hline, org-table-kill-row): Use `org-move-to-column' with the IGNORE-INVISIBLE arg set to `t', so that abbreviated rows don't interfer with setting the cursor back at the correct position. Thanks to Jason Lewis for reporting one of these bugs.
-rw-r--r--lisp/org-table.el14
1 files changed, 7 insertions, 7 deletions
diff --git a/lisp/org-table.el b/lisp/org-table.el
index c952234..4f11771 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -1136,12 +1136,12 @@ copying. In the case of a timestamp, increment by one day."
(< (string-to-number txt) 100000000))
(setq txt (format "%d" (+ (string-to-number txt) 1))))
(insert txt)
- (org-move-to-column col)
+ (org-move-to-column col nil nil t)
(if (and org-table-copy-increment (org-at-timestamp-p t))
(org-timestamp-up-day)
(org-table-maybe-recalculate-line))
(org-table-align)
- (org-move-to-column col))
+ (org-move-to-column col nil nil t))
(user-error "No non-empty field found"))))
(defun org-table-check-inside-data-field (&optional noerror)
@@ -1370,12 +1370,12 @@ However, when FORCE is non-nil, create new columns if necessary."
t
(let ((col (current-column))
(end (org-table-end)))
- (org-move-to-column col)
+ (org-move-to-column col nil nil t)
(while (and (< (point) end)
(or (not (= (current-column) col))
(org-at-table-hline-p)))
(beginning-of-line 2)
- (org-move-to-column col))
+ (org-move-to-column col nil nil t))
(if (and (org-at-table-p)
(not (org-at-table-hline-p)))
t
@@ -1524,7 +1524,7 @@ first dline below it is used. When ABOVE is non-nil, the one above is used."
(beginning-of-line tonew)
(insert txt)
(beginning-of-line 0)
- (org-move-to-column col)
+ (org-move-to-column col nil nil t)
(unless (or hline1p hline2p
(not (or (not org-table-fix-formulas-confirm)
(funcall org-table-fix-formulas-confirm
@@ -1576,7 +1576,7 @@ With prefix ABOVE, insert above the current line."
(beginning-of-line (if above 1 2))
(insert line "\n")
(beginning-of-line (if above 1 -1))
- (org-move-to-column col)
+ (org-move-to-column col nil nil t)
(and org-table-overlay-coordinates (org-table-align))))
;;;###autoload
@@ -1616,7 +1616,7 @@ In particular, this does handle wide and invisible characters."
(dline (org-table-current-dline)))
(kill-region (point-at-bol) (min (1+ (point-at-eol)) (point-max)))
(if (not (org-at-table-p)) (beginning-of-line 0))
- (org-move-to-column col)
+ (org-move-to-column col nil nil t)
(when (or (not org-table-fix-formulas-confirm)
(funcall org-table-fix-formulas-confirm "Fix formulas? "))
(org-table-fix-formulas "@" (list (cons (number-to-string dline) "INVALID"))