Pārlūkot izejas kodu

Merge branch 'maint'

Nicolas Goaziou 7 gadi atpakaļ
vecāks
revīzija
cd9cccb4b2
2 mainītis faili ar 8 papildinājumiem un 2 dzēšanām
  1. 1 2
      lisp/org.el
  2. 7 0
      testing/lisp/test-org.el

+ 1 - 2
lisp/org.el

@@ -7938,8 +7938,7 @@ unchecked check box."
     (org-insert-heading (or (and (equal arg '(16)) '(16))
     (org-insert-heading (or (and (equal arg '(16)) '(16))
 			    force-heading))
 			    force-heading))
     (save-excursion
     (save-excursion
-      (org-back-to-heading)
-      (outline-previous-heading)
+      (org-forward-heading-same-level -1)
       (let ((case-fold-search nil)) (looking-at org-todo-line-regexp)))
       (let ((case-fold-search nil)) (looking-at org-todo-line-regexp)))
     (let* ((new-mark-x
     (let* ((new-mark-x
 	    (if (or (equal arg '(4))
 	    (if (or (equal arg '(4))

+ 7 - 0
testing/lisp/test-org.el

@@ -1415,6 +1415,13 @@
     "* TODO \n"
     "* TODO \n"
     (org-test-with-temp-text "* H\n- an item\n- another one"
     (org-test-with-temp-text "* H\n- an item\n- another one"
       (search-forward "an ")
       (search-forward "an ")
+      (org-insert-todo-heading-respect-content)
+      (buffer-substring-no-properties (line-beginning-position) (point-max)))))
+  ;; Use the same TODO keyword as current heading.
+  (should
+   (equal
+    "* TODO \n"
+    (org-test-with-temp-text "* TODO\n** WAITING\n"
       (org-insert-todo-heading-respect-content)
       (org-insert-todo-heading-respect-content)
       (buffer-substring-no-properties (line-beginning-position) (point-max))))))
       (buffer-substring-no-properties (line-beginning-position) (point-max))))))