|
@@ -785,27 +785,31 @@
|
|
|
(org-test-with-temp-text "- A\n B\n\n<point>"
|
|
|
(let ((org-adapt-indentation nil)) (org-indent-line))
|
|
|
(org-get-indentation))))
|
|
|
+ (should
|
|
|
+ (= 2
|
|
|
+ (org-test-with-temp-text
|
|
|
+ "- A\n \begin{cases} 1 + 1\n \end{cases}\n\n<point>"
|
|
|
+ (let ((org-adapt-indentation nil)) (org-indent-line))
|
|
|
+ (org-get-indentation))))
|
|
|
;; Likewise, on a blank line at the end of a footnote definition,
|
|
|
;; indent at column 0 if line belongs to the definition. Otherwise,
|
|
|
;; indent like the definition itself.
|
|
|
(should
|
|
|
(zerop
|
|
|
- (org-test-with-temp-text "* H\n[fn:1] Definition\n"
|
|
|
- (goto-char (point-max))
|
|
|
+ (org-test-with-temp-text "* H\n[fn:1] Definition\n<point>"
|
|
|
(let ((org-adapt-indentation t)) (org-indent-line))
|
|
|
(org-get-indentation))))
|
|
|
(should
|
|
|
(zerop
|
|
|
- (org-test-with-temp-text "* H\n[fn:1] Definition\n\n\n\n"
|
|
|
- (goto-char (point-max))
|
|
|
+ (org-test-with-temp-text "* H\n[fn:1] Definition\n\n\n\n<point>"
|
|
|
(let ((org-adapt-indentation t)) (org-indent-line))
|
|
|
(org-get-indentation))))
|
|
|
;; After the end of the contents of a greater element, indent like
|
|
|
;; the beginning of the element.
|
|
|
(should
|
|
|
(= 1
|
|
|
- (org-test-with-temp-text " #+BEGIN_CENTER\n Contents\n#+END_CENTER"
|
|
|
- (forward-line 2)
|
|
|
+ (org-test-with-temp-text
|
|
|
+ " #+BEGIN_CENTER\n Contents\n<point>#+END_CENTER"
|
|
|
(org-indent-line)
|
|
|
(org-get-indentation))))
|
|
|
;; On blank lines after a paragraph, indent like its last non-empty
|
|
@@ -820,20 +824,18 @@
|
|
|
;; according to parent.
|
|
|
(should
|
|
|
(= 2
|
|
|
- (org-test-with-temp-text "A\n\n B\n\nC"
|
|
|
- (goto-char (point-max))
|
|
|
+ (org-test-with-temp-text "A\n\n B\n\nC<point>"
|
|
|
(org-indent-line)
|
|
|
(org-get-indentation))))
|
|
|
(should
|
|
|
(= 1
|
|
|
- (org-test-with-temp-text " A\n\n[fn:1] B\n\n\nC"
|
|
|
- (goto-char (point-max))
|
|
|
+ (org-test-with-temp-text " A\n\n[fn:1] B\n\n\nC<point>"
|
|
|
(org-indent-line)
|
|
|
(org-get-indentation))))
|
|
|
(should
|
|
|
(= 1
|
|
|
- (org-test-with-temp-text " #+BEGIN_CENTER\n Contents\n#+END_CENTER"
|
|
|
- (forward-line 1)
|
|
|
+ (org-test-with-temp-text
|
|
|
+ " #+BEGIN_CENTER\n<point> Contents\n#+END_CENTER"
|
|
|
(org-indent-line)
|
|
|
(org-get-indentation))))
|
|
|
;; Within code part of a source block, use language major mode if
|
|
@@ -841,16 +843,16 @@
|
|
|
;; according to line above.
|
|
|
(should
|
|
|
(= 6
|
|
|
- (org-test-with-temp-text "#+BEGIN_SRC emacs-lisp\n (and A\nB)\n#+END_SRC"
|
|
|
- (forward-line 2)
|
|
|
+ (org-test-with-temp-text
|
|
|
+ "#+BEGIN_SRC emacs-lisp\n (and A\n<point>B)\n#+END_SRC"
|
|
|
(let ((org-src-tab-acts-natively t)
|
|
|
(org-edit-src-content-indentation 0))
|
|
|
(org-indent-line))
|
|
|
(org-get-indentation))))
|
|
|
(should
|
|
|
(= 1
|
|
|
- (org-test-with-temp-text "#+BEGIN_SRC emacs-lisp\n (and A\nB)\n#+END_SRC"
|
|
|
- (forward-line 2)
|
|
|
+ (org-test-with-temp-text
|
|
|
+ "#+BEGIN_SRC emacs-lisp\n (and A\n<point>B)\n#+END_SRC"
|
|
|
(let ((org-src-tab-acts-natively nil)
|
|
|
(org-edit-src-content-indentation 0))
|
|
|
(org-indent-line))
|
|
@@ -858,15 +860,16 @@
|
|
|
;; Otherwise, indent like the first non-blank line above.
|
|
|
(should
|
|
|
(zerop
|
|
|
- (org-test-with-temp-text "#+BEGIN_CENTER\nline1\n\n line2\n#+END_CENTER"
|
|
|
- (forward-line 3)
|
|
|
+ (org-test-with-temp-text
|
|
|
+ "#+BEGIN_CENTER\nline1\n\n<point> line2\n#+END_CENTER"
|
|
|
(org-indent-line)
|
|
|
(org-get-indentation))))
|
|
|
;; Align node properties according to `org-property-format'. Handle
|
|
|
;; nicely empty values.
|
|
|
(should
|
|
|
(equal "* H\n:PROPERTIES:\n:key: value\n:END:"
|
|
|
- (org-test-with-temp-text "* H\n:PROPERTIES:\n<point>:key: value\n:END:"
|
|
|
+ (org-test-with-temp-text
|
|
|
+ "* H\n:PROPERTIES:\n<point>:key: value\n:END:"
|
|
|
(let ((org-property-format "%-10s %s")) (org-indent-line))
|
|
|
(buffer-string))))
|
|
|
(should
|