diff options
| author | Lars Ingebrigtsen | 2019-07-21 16:43:07 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-07-21 16:43:11 +0200 |
| commit | 76d0ca983b7c2e0e9f0e71630d96603b04fa0148 (patch) | |
| tree | 504a29dca09dfe1a17fb116414012b485fca4712 /lisp | |
| parent | 8b13ec1d7022b05ce71982c83f320d5272b92de7 (diff) | |
| download | emacs-76d0ca983b7c2e0e9f0e71630d96603b04fa0148.tar.gz emacs-76d0ca983b7c2e0e9f0e71630d96603b04fa0148.zip | |
Fill footnotes better on `M-q'
* lisp/mail/footnote.el (footnote--fill-paragraph): New function
(bug#27775).
(footnote-mode): Use it.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/mail/footnote.el | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lisp/mail/footnote.el b/lisp/mail/footnote.el index bbc42e11f74..42ab35b6652 100644 --- a/lisp/mail/footnote.el +++ b/lisp/mail/footnote.el | |||
| @@ -695,6 +695,15 @@ footnote area, returns `point-max'." | |||
| 695 | ;; If not within a footnote's text, fallback to the default. | 695 | ;; If not within a footnote's text, fallback to the default. |
| 696 | (funcall orig-fun))) | 696 | (funcall orig-fun))) |
| 697 | 697 | ||
| 698 | (defun footnote--fill-paragraph (justify) | ||
| 699 | (when (footnote--text-under-cursor) | ||
| 700 | (let ((fill-paragraph-function nil) | ||
| 701 | (fill-prefix (if footnote-align-to-fn-text | ||
| 702 | (footnote--fill-prefix-string) | ||
| 703 | "")) | ||
| 704 | (paragraph-start "\\[")) | ||
| 705 | (fill-paragraph justify)))) | ||
| 706 | |||
| 698 | ;;; User functions | 707 | ;;; User functions |
| 699 | 708 | ||
| 700 | (defun footnote--make-hole () | 709 | (defun footnote--make-hole () |
| @@ -875,6 +884,7 @@ play around with the following keys: | |||
| 875 | (make-local-variable 'adaptive-fill-function) | 884 | (make-local-variable 'adaptive-fill-function) |
| 876 | (add-function :around (local 'adaptive-fill-function) | 885 | (add-function :around (local 'adaptive-fill-function) |
| 877 | #'footnote--adaptive-fill-function) | 886 | #'footnote--adaptive-fill-function) |
| 887 | (setq-local fill-paragraph-function #'footnote--fill-paragraph) | ||
| 878 | 888 | ||
| 879 | ;; Filladapt was an XEmacs package which is now in GNU ELPA. | 889 | ;; Filladapt was an XEmacs package which is now in GNU ELPA. |
| 880 | (when (boundp 'filladapt-token-table) | 890 | (when (boundp 'filladapt-token-table) |