diff options
| author | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2014-06-27 10:00:24 +0200 |
|---|---|---|
| committer | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2014-06-27 10:00:24 +0200 |
| commit | 6319a5d53d251fdeba96ace825e6478c0b788714 (patch) | |
| tree | de6c5b149dde5964e322cacc7b7ffae6a4878128 /mu4e | |
| parent | c2021811239cffbf39ded63a714dbec9a0b33be0 (diff) | |
| parent | bbfb81d73edbfb9c01e91add662b5ec228bcaa7c (diff) | |
Merge remote-tracking branch 'refs/remotes/upstream/master'
Diffstat (limited to 'mu4e')
| -rw-r--r-- | mu4e/mu4e-view.el | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/mu4e/mu4e-view.el b/mu4e/mu4e-view.el index 7db8d9b..5d86706 100644 --- a/mu4e/mu4e-view.el +++ b/mu4e/mu4e-view.el @@ -597,6 +597,7 @@ FUNC should be a function taking two arguments: ;; misc (define-key map "w" 'visual-line-mode) (define-key map "h" 'mu4e-view-toggle-hide-cited) + (define-key map (kbd "M-q") 'mu4e-view-fill-long-lines) ;; next 3 only warn user when attempt in the message view (define-key map "u" 'mu4e-view-unmark) @@ -910,6 +911,28 @@ Add this function to `mu4e-view-mode-hook' to enable this feature." (setq beg nil end nil)))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Wash functions +(defun mu4e-view-fill-long-lines () + "Fill lines that are wider than the window width or `fill-column'." + (interactive) + (with-current-buffer mu4e~view-buffer + (save-excursion + (let ((inhibit-read-only t) + (width (window-width (get-buffer-window (current-buffer))))) + (save-restriction + (message-goto-body) + (while (not (eobp)) + (end-of-line) + (when (>= (current-column) (min fill-column width)) + (narrow-to-region (min (1+ (point)) (point-max)) + (point-at-bol)) + (let ((goback (point-marker))) + (fill-paragraph nil) + (goto-char (marker-position goback))) + (widen)) + (forward-line 1))))))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; attachment handling (defun mu4e~view-get-attach-num (prompt msg &optional multi) "Ask the user with PROMPT for an attachment number for MSG, and |
