Merge branch 'maint'
This commit is contained in:
commit
d5c11e6b5a
16
lisp/org.el
16
lisp/org.el
|
@ -22329,7 +22329,21 @@ a footnote definition, try to fill the first paragraph within."
|
||||||
justify)))
|
justify)))
|
||||||
t)
|
t)
|
||||||
;; Fill comments.
|
;; Fill comments.
|
||||||
(comment (fill-comment-paragraph justify))
|
(comment
|
||||||
|
(let ((begin (org-element-property :post-affiliated element))
|
||||||
|
(end (save-excursion
|
||||||
|
(goto-char (org-element-property :end element))
|
||||||
|
(skip-chars-backward " \r\t\n")
|
||||||
|
(line-end-position))))
|
||||||
|
;; Do not fill comments when at a blank line or at
|
||||||
|
;; affiliated keywords.
|
||||||
|
(when (and (>= (point) begin) (<= (point) end))
|
||||||
|
(let ((fill-prefix (save-excursion
|
||||||
|
(beginning-of-line)
|
||||||
|
(looking-at "[ \t]*#")
|
||||||
|
(concat (match-string 0) " "))))
|
||||||
|
(save-excursion
|
||||||
|
(fill-region-as-paragraph begin end justify))))))
|
||||||
;; Ignore every other element.
|
;; Ignore every other element.
|
||||||
(otherwise t))))))
|
(otherwise t))))))
|
||||||
|
|
||||||
|
|
|
@ -199,6 +199,13 @@
|
||||||
(let ((fill-column 20))
|
(let ((fill-column 20))
|
||||||
(org-fill-paragraph)
|
(org-fill-paragraph)
|
||||||
(buffer-string)))))
|
(buffer-string)))))
|
||||||
|
;; Do not mix consecutive comments when filling one of them.
|
||||||
|
(should
|
||||||
|
(equal "# A B\n\n# C"
|
||||||
|
(org-test-with-temp-text "# A\n# B\n\n# C"
|
||||||
|
(let ((fill-column 20))
|
||||||
|
(org-fill-paragraph)
|
||||||
|
(buffer-string)))))
|
||||||
;; Do nothing at affiliated keywords.
|
;; Do nothing at affiliated keywords.
|
||||||
(org-test-with-temp-text "#+NAME: para\nSome\ntext."
|
(org-test-with-temp-text "#+NAME: para\nSome\ntext."
|
||||||
(let ((fill-column 20))
|
(let ((fill-column 20))
|
||||||
|
|
Loading…
Reference in New Issue