branch: externals/org
commit a96a6762a2c8c1c3af27f183e07ae30d543ea322
Author: Morgan Smith <[email protected]>
Commit: Ihor Radchenko <[email protected]>

    Testing: Test inserting a heading with a "Local Variables" block
    
    * testing/lisp/test-org.el (test-org/insert-heading): Test inserting a
    heading with a "Local Variables" block.
---
 testing/lisp/test-org.el | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index d4ac16f01e..84bad0d525 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -1889,6 +1889,20 @@ CLOCK: [2022-09-17 sam. 11:00]--[2022-09-17 sam. 11:46] 
=>  0:46"
          (org-test-with-temp-text "<point>P"
            (org-insert-heading)
            (buffer-string))))
+  ;; Move local variable string to end when we respect the content
+  (let ((local-variable-string "# Local Variables:
+# fill-column: 120
+# End:\n"))
+    (should
+     (equal (concat "* \n" local-variable-string)
+            (org-test-with-temp-text local-variable-string
+              (org-insert-heading-respect-content)
+              (buffer-string))))
+    (should
+     (equal (concat "* H\n* \n" local-variable-string)
+            (org-test-with-temp-text (concat "* H<point>\n" 
local-variable-string)
+              (org-insert-heading-respect-content)
+              (buffer-string)))))
   ;; In the middle of a line, split the line if allowed, otherwise,
   ;; insert the headline at its end.
   (should

Reply via email to