mirror of
https://github.com/djcb/mu.git
synced 2024-06-29 07:51:04 +02:00
With use-hard-newlines, M-q reformat the paragraph as a single line
This commit is contained in:
parent
b6a1e1cef8
commit
d2ae534ad8
|
@ -324,8 +324,22 @@ message-thread by removing the In-Reply-To header."
|
||||||
(define-key map (kbd "C-S-u") 'mu4e-update-mail-and-index)
|
(define-key map (kbd "C-S-u") 'mu4e-update-mail-and-index)
|
||||||
(define-key map (kbd "C-c C-u") 'mu4e-update-mail-and-index)
|
(define-key map (kbd "C-c C-u") 'mu4e-update-mail-and-index)
|
||||||
(define-key map (kbd "C-c C-k") 'mu4e-message-kill-buffer)
|
(define-key map (kbd "C-c C-k") 'mu4e-message-kill-buffer)
|
||||||
|
(define-key map (kbd "M-q") 'mu4e-fill-paragraph)
|
||||||
map)))
|
map)))
|
||||||
|
|
||||||
|
(defun mu4e-fill-paragraph (&optional region)
|
||||||
|
"If `use-hard-newlines', takes a multi-line paragraph and makes
|
||||||
|
it into a single line of text. Assume paragraphs are separated
|
||||||
|
by blank lines. If `use-hard-newlines' is not enabled, this
|
||||||
|
simply executes `fill-paragraph'."
|
||||||
|
;; Inspired by https://www.emacswiki.org/emacs/UnfillParagraph
|
||||||
|
(interactive (progn (barf-if-buffer-read-only) '(t)))
|
||||||
|
(if use-hard-newlines
|
||||||
|
(let ((fill-column (point-max))
|
||||||
|
(use-hard-newlines nil)); rfill "across" hard newlines
|
||||||
|
(fill-paragraph nil region))
|
||||||
|
(fill-paragraph nil region)))
|
||||||
|
|
||||||
(define-key-after
|
(define-key-after
|
||||||
(lookup-key text-mode-map [menu-bar text])
|
(lookup-key text-mode-map [menu-bar text])
|
||||||
[mu4e-hard-newlines]
|
[mu4e-hard-newlines]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user