Remove reference to Message mode

* lisp/org.el (org-adaptive-fill-function):
(org-fill-element): Remove reference to Message mode.  These functions
are Org mode specific.
This commit is contained in:
Nicolas Goaziou 2017-10-31 19:43:37 +01:00
parent eeb4c22090
commit 2b96b08eaf
1 changed files with 50 additions and 69 deletions

View File

@ -22047,16 +22047,6 @@ assumed to be significant there."
Return fill prefix, as a string, or nil if current line isn't Return fill prefix, as a string, or nil if current line isn't
meant to be filled. For convenience, if `adaptive-fill-regexp' meant to be filled. For convenience, if `adaptive-fill-regexp'
matches in paragraphs or comments, use it." matches in paragraphs or comments, use it."
(catch 'exit
(when (derived-mode-p 'message-mode)
(save-excursion
(beginning-of-line)
(cond ((not (message-in-body-p)) (throw 'exit nil))
((looking-at-p org-table-line-regexp) (throw 'exit nil))
((looking-at message-cite-prefix-regexp)
(throw 'exit (match-string-no-properties 0)))
((looking-at org-outline-regexp)
(throw 'exit (make-string (length (match-string 0)) ?\s))))))
(org-with-wide-buffer (org-with-wide-buffer
(unless (org-at-heading-p) (unless (org-at-heading-p)
(let* ((p (line-beginning-position)) (let* ((p (line-beginning-position))
@ -22108,7 +22098,7 @@ matches in paragraphs or comments, use it."
(when (and (>= p cbeg) (< p cend)) (when (and (>= p cbeg) (< p cend))
(if (save-excursion (beginning-of-line) (looking-at "[ \t]+")) (if (save-excursion (beginning-of-line) (looking-at "[ \t]+"))
(match-string 0) (match-string 0)
""))))))))))) ""))))))))))
(declare-function message-goto-body "message" ()) (declare-function message-goto-body "message" ())
(defvar message-cite-prefix-regexp) ; From message.el (defvar message-cite-prefix-regexp) ; From message.el
@ -22153,15 +22143,6 @@ a footnote definition, try to fill the first paragraph within."
(org-element-property :contents-end element)))) (org-element-property :contents-end element))))
;; Do nothing if point is at an affiliated keyword. ;; Do nothing if point is at an affiliated keyword.
(if (< (line-end-position) beg) t (if (< (line-end-position) beg) t
(when (derived-mode-p 'message-mode)
;; In `message-mode', do not fill following citation
;; in current paragraph nor text before message body.
(let ((body-start (save-excursion (message-goto-body))))
(when body-start (setq beg (max body-start beg))))
(when (save-excursion
(re-search-forward
(concat "^" message-cite-prefix-regexp) end t))
(setq end (match-beginning 0))))
;; Fill paragraph, taking line breaks into account. ;; Fill paragraph, taking line breaks into account.
(save-excursion (save-excursion
(goto-char beg) (goto-char beg)