* lisp/org.el (org-return): Properly preserve list structure when calling `org-return-indent' on an item. * testing/lisp/test-org.el (test-org/return): Add test. Reported-by: Rasmus <rasmus@gmx.us> <http://permalink.gmane.org/gmane.emacs.orgmode/94977>
@@ -20993,7 +20993,7 @@ object (e.g., within a comment). In these case, you need to use
;; In a list, make sure indenting keeps trailing text within.
((and indent
(not (eolp))
- (org-element-lineage context '(item plain-list) t))
+ (org-element-lineage context '(item)))
(let ((trailing-data
(delete-and-extract-region (point) (line-end-position))))
(newline-and-indent)
@@ -861,6 +861,11 @@
(org-test-with-temp-text "- A <point>B"
(org-return t)
(buffer-string))))
+ (should
+ (equal "- A\n\n- B"
+ (org-test-with-temp-text "- A\n<point>- B"
+ (org-return t)
+ (buffer-string))))
;; Special case: on tags part of a headline, add a newline below it
;; instead of breaking it.
(should