org.el: Fix bugs in `org-indent-line' and `org-fill-paragraph'

* org.el (org-fill-paragraph): Correctly fill paragraph in
message-mode.
(org-indent-line): Correctly indent according to mode when
`orgstruct++-mode' is on.
(orgstruct++-mode): Add `fill-prefix' to the variable temporarily
stored in `org-fb-vars'.
This commit is contained in:
Bastien Guerry 2012-08-13 09:18:11 +02:00
parent 396e413f6b
commit 3496df0b4d
1 changed files with 104 additions and 103 deletions

View File

@ -8469,7 +8469,7 @@ buffer. It will also recognize item context in multiline items."
(mapc
(lambda (x)
(when (string-match
"^\\(paragraph-\\|auto-fill\\|normal-auto-fill\\|fill-paragraph\\|indent-\\)"
"^\\(paragraph-\\|auto-fill\\|normal-auto-fill\\|fill-paragraph\\|fill-prefix\\|indent-\\)"
(symbol-name (car x)))
(setq var (car x) val (nth 1 x))
(push (list var `(quote ,(eval var))) org-fb-vars)
@ -20732,6 +20732,9 @@ hierarchy of headlines by UP levels before marking the subtree."
(inline-re (and inline-task-p
(org-inlinetask-outline-regexp)))
column)
(if (and orgstruct-is-++ (eq pos (point)))
(let ((indent-line-function (cadadr (assoc 'indent-line-function org-fb-vars))))
(indent-according-to-mode))
(beginning-of-line 1)
(cond
;; Headings
@ -20827,10 +20830,7 @@ hierarchy of headlines by UP levels before marking the subtree."
(format org-property-format
(match-string 2) (match-string 3)))
t t))
(org-move-to-column column)
(when (and orgstruct-is-++ (eq pos (point)))
(org-let org-fb-vars
(indent-according-to-mode)))))
(org-move-to-column column))))
(defun org-indent-drawer ()
"Indent the drawer at point."
@ -20987,11 +20987,12 @@ a footnote definition, try to fill the first paragraph within."
(if (and (derived-mode-p 'message-mode)
(or (not (message-in-body-p))
(save-excursion (move-beginning-of-line 1)
(looking-at "> "))))
(org-let org-fb-vars
(or (and (message-point-in-header-p) (message-fill-field))
(and (save-excursion (move-beginning-of-line 1) (looking-at "> "))
(fill-comment-paragraph))))
(looking-at "^>+ "))))
(let ((fill-paragraph-function (cadadr (assoc 'fill-paragraph-function org-fb-vars)))
(fill-prefix (cadadr (assoc 'fill-prefix org-fb-vars)))
(paragraph-start (cadadr (assoc 'paragraph-start org-fb-vars)))
(paragraph-separate (cadadr (assoc 'paragraph-separate org-fb-vars))))
(fill-paragraph))
(save-excursion
;; Move to end of line in order to get the first paragraph within
;; a plain list or a footnote definition.