org.el: Leave scheduled/deadline lines untouched when filling an adjacent paragraph.

* org.el (org-fill-paragraph): Leave scheduled/deadline lines
untouched when filling an adjacent paragraph.

Thanks to Stuart McLean for suggesting this.
This commit is contained in:
Bastien Guerry 2012-04-04 08:51:20 +02:00
parent ce06791334
commit 187f77a20a
1 changed files with 8 additions and 0 deletions

View File

@ -20521,6 +20521,14 @@ the functionality can be provided as a fall-back.")
(save-excursion (forward-paragraph 1) (save-excursion (forward-paragraph 1)
(point))) (point)))
(fill-paragraph justify) t))) (fill-paragraph justify) t)))
;; Don't fill schedule/deadline line before a paragraph
((save-excursion (forward-paragraph -1)
(or (looking-at (concat "^[^\n]*" org-scheduled-regexp ".*$"))
(looking-at (concat "^[^\n]*" org-deadline-regexp ".*$"))))
(save-restriction
(narrow-to-region (1+ (match-end 0))
(save-excursion (forward-paragraph 1) (point)))
(fill-paragraph justify) t))
;; Else simply call `fill-paragraph'. ;; Else simply call `fill-paragraph'.
(t nil)))) (t nil))))