diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2015-02-14 02:07:18 +0100 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2015-02-14 02:07:18 +0100 |
commit | 55ce4b74b363a8b78542a30eb8cfd39a1757a935 (patch) | |
tree | 02d9f9395badf9428bc6745f3577804dfdbc1811 | |
parent | e50baa4cf7b97cc2e9b6991560be2bd970106e1e (diff) | |
download | org-mode-55ce4b74b363a8b78542a30eb8cfd39a1757a935.tar.gz |
Fix `org-return' on list items
* 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>
-rwxr-xr-x | lisp/org.el | 2 | ||||
-rw-r--r-- | testing/lisp/test-org.el | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/lisp/org.el b/lisp/org.el index 59b245a..4f047b2 100755 --- a/lisp/org.el +++ b/lisp/org.el @@ -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) diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el index d12fa28..4a8b4ff 100644 --- a/testing/lisp/test-org.el +++ b/testing/lisp/test-org.el @@ -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 |