Commit 76d0ca98 authored by Lars Ingebrigtsen's avatar Lars Ingebrigtsen

Fill footnotes better on `M-q'

* lisp/mail/footnote.el (footnote--fill-paragraph): New function
(bug#27775).
(footnote-mode): Use it.
parent 8b13ec1d
Pipeline #2510 failed with stage
in 90 minutes and 1 second
......@@ -695,6 +695,15 @@ footnote area, returns `point-max'."
;; If not within a footnote's text, fallback to the default.
(funcall orig-fun)))
(defun footnote--fill-paragraph (justify)
(when (footnote--text-under-cursor)
(let ((fill-paragraph-function nil)
(fill-prefix (if footnote-align-to-fn-text
(footnote--fill-prefix-string)
""))
(paragraph-start "\\["))
(fill-paragraph justify))))
;;; User functions
(defun footnote--make-hole ()
......@@ -875,6 +884,7 @@ play around with the following keys:
(make-local-variable 'adaptive-fill-function)
(add-function :around (local 'adaptive-fill-function)
#'footnote--adaptive-fill-function)
(setq-local fill-paragraph-function #'footnote--fill-paragraph)
;; Filladapt was an XEmacs package which is now in GNU ELPA.
(when (boundp 'filladapt-token-table)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment