org.el (org-fill-paragraph-with-timestamp-nobreak-p): New function

* org.el (org-fill-paragraph-with-timestamp-nobreak-p): New
function.
(org-setup-filling): Use it to prevent breaking a timestamp
when filling a paragraph.

Thanks to William for requesting this.
This commit is contained in:
Bastien Guerry 2013-02-11 14:38:18 +01:00
parent 1056fc3f60
commit 0b9e3b8a45

View file

@ -20970,7 +20970,8 @@ hierarchy of headlines by UP levels before marking the subtree."
(org-uniquify
(append fill-nobreak-predicate
'(org-fill-paragraph-separate-nobreak-p
org-fill-line-break-nobreak-p)))))
org-fill-line-break-nobreak-p
org-fill-paragraph-with-timestamp-nobreak-p)))))
(org-set-local 'fill-paragraph-function 'org-fill-paragraph)
(org-set-local 'auto-fill-inhibit-regexp nil)
(org-set-local 'adaptive-fill-function 'org-adaptive-fill-function)
@ -20989,6 +20990,11 @@ hierarchy of headlines by UP levels before marking the subtree."
(skip-chars-backward "\\\\")
(looking-at "\\\\\\\\\\($\\|[^\\\\]\\)")))
(defun org-fill-paragraph-with-timestamp-nobreak-p ()
"Non-nil when a line break at point would insert a new item."
(and (org-at-timestamp-p t)
(not (looking-at org-ts-regexp-both))))
(declare-function message-in-body-p "message" ())
(defvar org-element--affiliated-re) ; From org-element.el
(defvar orgtbl-line-start-regexp) ; From org-table.el