forked from mirrors/org-mode
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.
This commit is contained in:
parent
4bc4e8ec18
commit
b1223be34d
|
@ -21000,16 +21000,17 @@ hierarchy of headlines by UP levels before marking the subtree."
|
||||||
'fill-nobreak-predicate
|
'fill-nobreak-predicate
|
||||||
(org-uniquify
|
(org-uniquify
|
||||||
(append fill-nobreak-predicate
|
(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 'normal-auto-fill-function 'org-auto-fill-function)
|
||||||
(org-set-local 'align-mode-rules-list
|
(org-set-local 'align-mode-rules-list
|
||||||
'((org-in-buffer-settings
|
'((org-in-buffer-settings
|
||||||
(regexp . "^#\\+[A-Z_]+:\\(\\s-*\\)\\S-+")
|
(regexp . "^#\\+[A-Z_]+:\\(\\s-*\\)\\S-+")
|
||||||
(modes . '(org-mode))))))
|
(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."
|
"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 ()
|
(defun org-fill-line-break-nobreak-p ()
|
||||||
"Non-nil when a line break at point would create an Org line break."
|
"Non-nil when a line break at point would create an Org line break."
|
||||||
|
|
Loading…
Reference in a new issue