summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2013-08-22 19:55:51 (GMT)
committer Nicolas Goaziou <n.goaziou@gmail.com>2013-08-22 19:55:51 (GMT)
commit54431e2a5b1a1e4e4ab52bf01525bc985bb82304 (patch)
tree5e59569cd23eb37a30aa41680575c0bb429ae04b
parent6fdc2361c93d2f77bcc81b479b6d68d57bd268a2 (diff)
parent9e51049b22c90df349ae914d8142362b5bf22090 (diff)
downloadorg-mode-54431e2a5b1a1e4e4ab52bf01525bc985bb82304.zip
org-mode-54431e2a5b1a1e4e4ab52bf01525bc985bb82304.tar.gz
Merge branch 'maint'
-rw-r--r--lisp/org.el10
-rw-r--r--testing/lisp/test-org.el23
2 files changed, 29 insertions, 4 deletions
diff --git a/lisp/org.el b/lisp/org.el
index e13c2b8..572b797 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -22192,7 +22192,15 @@ matches in paragraphs or comments, use it."
(make-string (org-list-item-body-column
(org-element-property :begin parent))
? ))
- ((looking-at adaptive-fill-regexp) (match-string 0))
+ ((and adaptive-fill-regexp
+ ;; Locally disable
+ ;; `adaptive-fill-function' to let
+ ;; `fill-context-prefix' handle
+ ;; `adaptive-fill-regexp' variable.
+ (let (adaptive-fill-function)
+ (fill-context-prefix
+ post-affiliated
+ (org-element-property :end element)))))
((looking-at "[ \t]+") (match-string 0))
(t "")))))
(comment-block
diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index 517d0d1..ef5e60e 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -273,13 +273,30 @@
(buffer-string)))))
;; Auto fill paragraph when `adaptive-fill-regexp' matches.
(should
- (equal "> 12345\n> 7890"
+ (equal "> 12345\n 7890"
(org-test-with-temp-text "> 12345 7890"
- (let ((fill-column 5)
- (adaptive-fill-regexp "[ \t]*>+[ \t]*"))
+ (let ((fill-column 10)
+ (adaptive-fill-regexp "[ \t]*>+[ \t]*")
+ (adaptive-fill-first-line-regexp "\\`[ ]*\\'"))
(end-of-line)
(org-auto-fill-function)
(buffer-string)))))
+ (should
+ (equal "> 12345\n> 12345\n> 7890"
+ (org-test-with-temp-text "> 12345\n> 12345 7890"
+ (let ((fill-column 10)
+ (adaptive-fill-regexp "[ \t]*>+[ \t]*"))
+ (goto-char (point-max))
+ (org-auto-fill-function)
+ (buffer-string)))))
+ (should-not
+ (equal " 12345\n *12345\n *12345"
+ (org-test-with-temp-text " 12345\n *12345 12345"
+ (let ((fill-column 10)
+ (adaptive-fill-regexp "[ \t]*>+[ \t]*"))
+ (goto-char (point-max))
+ (org-auto-fill-function)
+ (buffer-string)))))
;; Auto fill comments.
(should
(equal " # 12345\n # 7890"