Browse Source

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.
Bastien Guerry 11 years ago
parent
commit
323c7b3de2
1 changed files with 7 additions and 7 deletions
  1. 7 7
      lisp/org-table.el

+ 7 - 7
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"))