Prechádzať zdrojové kódy

Merge branch 'maint'

Nicolas Goaziou 4 rokov pred
rodič
commit
e515a7cec8
2 zmenil súbory, kde vykonal 24 pridanie a 17 odobranie
  1. 2 1
      lisp/org-table.el
  2. 22 16
      testing/lisp/test-org-table.el

+ 2 - 1
lisp/org-table.el

@@ -1488,7 +1488,8 @@ Swap with anything in target cell."
   (interactive)
   (unless (org-at-table-p) (user-error "Not at a table"))
   (org-table-find-dataline)
-  (and (eolp) (looking-back "|" 1) (backward-char)) ; Snap into last column.
+  (when (save-excursion (skip-chars-forward " \t") (eolp))
+    (search-backward "|"))		;snap into last column
   (org-table-check-inside-data-field nil t)
   (let* ((col (org-table-current-column))
 	 (beg (org-table-begin))

+ 22 - 16
testing/lisp/test-org-table.el

@@ -2352,31 +2352,37 @@ See also `test-org-table/copy-field'."
   (should
    (equal "| a |\n"
 	  (org-test-with-temp-text
-	   "| <point>  | a |\n"
-	   (org-table-delete-column)
-	   (buffer-string))))
+	      "| <point>  | a |\n"
+	    (org-table-delete-column)
+	    (buffer-string))))
   ;; Delete column and check location of point.
   (should
    (= 2
       (org-test-with-temp-text
-       "| a | <point>b  | c |"
-       (org-table-delete-column)
-       (org-table-current-column))))
-  ;; Delete column when at end of line and immediately after a "|".
+	  "| a | <point>b  | c |"
+	(org-table-delete-column)
+	(org-table-current-column))))
+  ;; Delete column when at end of line and after a "|".
   (should
    (equal "| a |\n"
-      (org-test-with-temp-text
-       "| a | b |<point>\n"
-       (org-table-delete-column)
-       (buffer-string))))
+	  (org-test-with-temp-text
+	      "| a | b |<point>\n"
+	    (org-table-delete-column)
+	    (buffer-string))))
+  (should
+   (equal "| a |\n"
+	  (org-test-with-temp-text
+	      "| a | b |   <point>\n"
+	    (org-table-delete-column)
+	    (buffer-string))))
   ;; Delete two columns starting with the last column.
   (should
    (equal "| a |\n"
-      (org-test-with-temp-text
-       "| a | b  | c<point> |"
-       (org-table-delete-column)
-       (org-table-delete-column)
-       (buffer-string)))))
+	  (org-test-with-temp-text
+	      "| a | b  | c<point> |"
+	    (org-table-delete-column)
+	    (org-table-delete-column)
+	    (buffer-string)))))
 
 
 ;;; Inserting rows, inserting columns