Merge branch 'bugfix'

This commit is contained in:
Ihor Radchenko 2023-08-19 10:55:08 +03:00
commit 54f8b0bfd0
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
2 changed files with 20 additions and 3 deletions

View File

@ -6372,7 +6372,10 @@ unconditionally."
(if (not level) (outline-next-heading) ;before first headline
(org-back-to-heading invisible-ok)
(when (equal arg '(16)) (org-up-heading-safe))
(org-end-of-subtree)))
(org-end-of-subtree invisible-ok 'to-heading)))
;; At `point-max', if the file does not have ending newline,
;; create one, so that we are not appending stars at non-empty
;; line.
(unless (bolp) (insert "\n"))
(when (and blank? (save-excursion
(backward-char)

View File

@ -2035,7 +2035,21 @@ CLOCK: [2022-09-17 sam. 11:00]--[2022-09-17 sam. 11:46] => 0:46"
(org-test-with-temp-text "* H1\n\n* H<point>"
(let ((org-blank-before-new-entry '((heading . t))))
(org-insert-heading '(4))
(buffer-string))))))
(buffer-string)))))
;; Do not include potentially folded empty lines.
(org-test-with-temp-text "
<point>* Sec1
** SubSec1
text
** SubSec2
text
"
(org-content)
(org-insert-heading '(4))
(should-not (org-fold-folded-p))))
(ert-deftest test-org/insert-todo-heading-respect-content ()
"Test `org-insert-todo-heading-respect-content' specifications."
@ -2062,7 +2076,7 @@ CLOCK: [2022-09-17 sam. 11:00]--[2022-09-17 sam. 11:46] => 0:46"
;; Use the same TODO keyword as current heading.
(should
(equal
"* TODO \n"
"* TODO "
(org-test-with-temp-text "* TODO\n** WAITING\n"
(org-insert-todo-heading-respect-content)
(buffer-substring-no-properties (line-beginning-position) (point-max)))))