diff options
author | Nicolas Goaziou <n.goaziou@gmail.com> | 2012-08-24 12:17:22 +0200 |
---|---|---|
committer | Nicolas Goaziou <n.goaziou@gmail.com> | 2012-08-24 12:58:42 +0200 |
commit | b1223be34d183229db3f5b0625b459a2783d9ef5 (patch) | |
tree | 6b49808b16c85a5f20ccaac25c2ed1fdc0e99aba | |
parent | 4bc4e8ec1850c29a172f1f7dda4d553d826f0fdd (diff) | |
download | org-mode-b1223be34d183229db3f5b0625b459a2783d9ef5.tar.gz |
Auto-filling must not break current paragraph
* lisp/org.el (org-fill-paragraph-separate-nobreak-p): New function.
(org-set-autofill-regexps): Introduce new predicate.
(org-fill-item-nobreak-p): Remove function.
-rw-r--r-- | lisp/org.el | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/org.el b/lisp/org.el index b3ae268..d03e913 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -21000,16 +21000,17 @@ hierarchy of headlines by UP levels before marking the subtree." 'fill-nobreak-predicate (org-uniquify (append fill-nobreak-predicate - '(org-fill-item-nobreak-p org-fill-line-break-nobreak-p))))) + '(org-fill-paragraph-separate-nobreak-p + org-fill-line-break-nobreak-p))))) (org-set-local 'normal-auto-fill-function 'org-auto-fill-function) (org-set-local 'align-mode-rules-list '((org-in-buffer-settings (regexp . "^#\\+[A-Z_]+:\\(\\s-*\\)\\S-+") (modes . '(org-mode)))))) -(defun org-fill-item-nobreak-p () +(defun org-fill-paragraph-separate-nobreak-p () "Non-nil when a line break at point would insert a new item." - (and (looking-at (org-item-re)) (org-list-in-valid-context-p))) + (looking-at (substring org-element-paragraph-separate 1))) (defun org-fill-line-break-nobreak-p () "Non-nil when a line break at point would create an Org line break." |