summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaushal Modi <kaushal.modi@gmail.com>2018-02-11 15:29:57 -0500
committerKaushal Modi <kaushal.modi@gmail.com>2018-02-11 15:29:57 -0500
commitb505a5b6ad9d12ddb3b3c9a73962eaf5e6a9fa41 (patch)
treede68a69adbe63630afb9ee52d888e606ca0ff15d
parentda78ccc6909a2fe079162e341ad4bfdba310b9b1 (diff)
parentfe7619cd184847227e9c1085b4f3c13a553f007b (diff)
downloadorg-mode-b505a5b6ad9d12ddb3b3c9a73962eaf5e6a9fa41.tar.gz
Merge branch 'maint'
-rw-r--r--lisp/org.el8
-rw-r--r--testing/lisp/test-org.el8
2 files changed, 15 insertions, 1 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 672f85c..5abf1e3 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -20459,7 +20459,13 @@ object (e.g., within a comment). In these case, you need to use
(delete-and-extract-region (point) (line-end-position))))
(newline-and-indent)
(save-excursion (insert trailing-data))))
- (t (if indent (newline-and-indent) (newline))))))
+ (t
+ ;; Do not auto-fill when point is in an Org property drawer.
+ (let ((auto-fill-function (and (not (org-at-property-p))
+ auto-fill-function)))
+ (if indent
+ (newline-and-indent)
+ (newline)))))))
(defun org-return-indent ()
"Goto next table row or insert a newline and indent.
diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index cb21cda..98f465a 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -1197,6 +1197,14 @@
(equal "| a |\n\n| b |"
(org-test-with-temp-text "| a |<point>\n| b |"
(org-return)
+ (buffer-string))))
+ ;; Do not auto-fill on hitting <RET> inside a property drawer.
+ (should
+ (equal "* Heading\n:PROPERTIES:\n:SOME_PROP: This is a very long property value that goes beyond the fill-column. But this is inside a property drawer, so the auto-filling should be disabled.\n\n:END:"
+ (org-test-with-temp-text "* Heading\n:PROPERTIES:\n:SOME_PROP: This is a very long property value that goes beyond the fill-column. But this is inside a property drawer, so the auto-filling should be disabled.<point>\n:END:"
+ (setq-local fill-column 10)
+ (auto-fill-mode 1)
+ (org-return)
(buffer-string)))))
(ert-deftest test-org/meta-return ()