diff options
author | Bastien Guerry <bzg@altern.org> | 2013-02-11 14:38:18 +0100 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2013-02-11 14:38:18 +0100 |
commit | 0b9e3b8a45244f9930f8acc01715ca046ccce642 (patch) | |
tree | e9367c1f5c74872b84ec2b41d9746788e3017ef1 | |
parent | 1056fc3f6052f36567af65568e6c306bc2a4624e (diff) | |
download | org-mode-0b9e3b8a45244f9930f8acc01715ca046ccce642.tar.gz |
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.
-rw-r--r-- | lisp/org.el | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/org.el b/lisp/org.el index bba52a8..623c374 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -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 |