summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2013-06-02 11:12:02 +0200
committerNicolas Goaziou <n.goaziou@gmail.com>2013-06-24 08:22:49 +0200
commitf3955d5367bd44e98824e3a5bd4b36e06483f4c2 (patch)
tree33e3c36bf3fec279d0d7571150c104ea184d71e2
parent36d9a7a4e376c3add4f7c5bd70ba39fab7dbb1c5 (diff)
downloadorg-mode-f3955d5367bd44e98824e3a5bd4b36e06483f4c2.tar.gz
org.el: Slight change to filling mechanism
* lisp/org.el (org-setup-filling): Set `paragraph-start' and `paragraph-separate'. (org-fill-paragraph-separate-nobreak-p): Remove function. (org-mode): Do not set `paragraph-start'.
-rw-r--r--lisp/org.el16
1 files changed, 6 insertions, 10 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 237855d..d0dffc7 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5317,8 +5317,6 @@ The following commands are available:
(org-set-local 'outline-regexp org-outline-regexp)
(org-set-local 'outline-level 'org-outline-level)
(setq bidi-paragraph-direction 'left-to-right)
- ;; FIXME Circumvent a bug in outline.el (Emacs <24.4)
- (set (make-local-variable 'paragraph-start) " \\|[ \t]*$\\|\\*+ ")
(when (and org-ellipsis
(fboundp 'set-display-table-slot) (boundp 'buffer-display-table)
(fboundp 'make-glyph-code))
@@ -22105,28 +22103,26 @@ hierarchy of headlines by UP levels before marking the subtree."
;; `org-setup-filling' installs filling and auto-filling related
;; variables during `org-mode' initialization.
+(defvar org-element-paragraph-separate) ; org-element.el
(defun org-setup-filling ()
- (interactive)
+ (require 'org-element)
;; Prevent auto-fill from inserting unwanted new items.
(when (boundp 'fill-nobreak-predicate)
(org-set-local
'fill-nobreak-predicate
(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)))))
+ (let ((paragraph-ending (substring org-element-paragraph-separate 1)))
+ (org-set-local 'paragraph-start paragraph-ending)
+ (org-set-local 'paragraph-separate paragraph-ending))
(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)
(org-set-local 'normal-auto-fill-function 'org-auto-fill-function)
(org-set-local 'comment-line-break-function 'org-comment-line-break-function))
-(defvar org-element-paragraph-separate) ; org-element.el
-(defun org-fill-paragraph-separate-nobreak-p ()
- "Non-nil when a new line at point would end current paragraph."
- (looking-at (substring org-element-paragraph-separate 1)))
-
(defun org-fill-line-break-nobreak-p ()
"Non-nil when a new line at point would create an Org line break."
(save-excursion