Bläddra i källkod

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 år sedan
förälder
incheckning
323c7b3de2
1 ändrade filer med 7 tillägg och 7 borttagningar
  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))
 		   (< (string-to-number txt) 100000000))
 	      (setq txt (format "%d" (+ (string-to-number txt) 1))))
 	      (setq txt (format "%d" (+ (string-to-number txt) 1))))
 	  (insert txt)
 	  (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))
 	  (if (and org-table-copy-increment (org-at-timestamp-p t))
 	      (org-timestamp-up-day)
 	      (org-timestamp-up-day)
 	    (org-table-maybe-recalculate-line))
 	    (org-table-maybe-recalculate-line))
 	  (org-table-align)
 	  (org-table-align)
-	  (org-move-to-column col))
+	  (org-move-to-column col nil nil t))
       (user-error "No non-empty field found"))))
       (user-error "No non-empty field found"))))
 
 
 (defun org-table-check-inside-data-field (&optional noerror)
 (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
       t
     (let ((col (current-column))
     (let ((col (current-column))
 	  (end (org-table-end)))
 	  (end (org-table-end)))
-      (org-move-to-column col)
+      (org-move-to-column col nil nil t)
       (while (and (< (point) end)
       (while (and (< (point) end)
 		  (or (not (= (current-column) col))
 		  (or (not (= (current-column) col))
 		      (org-at-table-hline-p)))
 		      (org-at-table-hline-p)))
 	(beginning-of-line 2)
 	(beginning-of-line 2)
-	(org-move-to-column col))
+	(org-move-to-column col nil nil t))
       (if (and (org-at-table-p)
       (if (and (org-at-table-p)
 	       (not (org-at-table-hline-p)))
 	       (not (org-at-table-hline-p)))
 	  t
 	  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)
     (beginning-of-line tonew)
     (insert txt)
     (insert txt)
     (beginning-of-line 0)
     (beginning-of-line 0)
-    (org-move-to-column col)
+    (org-move-to-column col nil nil t)
     (unless (or hline1p hline2p
     (unless (or hline1p hline2p
 		(not (or (not org-table-fix-formulas-confirm)
 		(not (or (not org-table-fix-formulas-confirm)
 			 (funcall 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))
     (beginning-of-line (if above 1 2))
     (insert line "\n")
     (insert line "\n")
     (beginning-of-line (if above 1 -1))
     (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))))
     (and org-table-overlay-coordinates (org-table-align))))
 
 
 ;;;###autoload
 ;;;###autoload
@@ -1616,7 +1616,7 @@ In particular, this does handle wide and invisible characters."
 	(dline (org-table-current-dline)))
 	(dline (org-table-current-dline)))
     (kill-region (point-at-bol) (min (1+ (point-at-eol)) (point-max)))
     (kill-region (point-at-bol) (min (1+ (point-at-eol)) (point-max)))
     (if (not (org-at-table-p)) (beginning-of-line 0))
     (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)
     (when (or (not org-table-fix-formulas-confirm)
 	      (funcall org-table-fix-formulas-confirm "Fix formulas? "))
 	      (funcall org-table-fix-formulas-confirm "Fix formulas? "))
       (org-table-fix-formulas "@" (list (cons (number-to-string dline) "INVALID"))
       (org-table-fix-formulas "@" (list (cons (number-to-string dline) "INVALID"))