Closed codesections closed 4 years ago
Er, actually, after a bit more testing, that modified function does not work. Here's a version that does:
(defun mu4e-view-fill-long-lines ()
"Fill lines that are wider than the window width or `fill-column'."
(interactive)
(with-current-buffer (mu4e-get-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) fill-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)
(if (and
(string-match "^\s" (thing-at-point 'line t)) ; initial whitespace
(string-match "\[^\s]" (thing-at-point 'line t))) ; line has text
(newline))
(forward-line -1))
(forward-line 1)))))))
We're slowly moving to the gnus-based view, so want to avoid making changes to the mu4e-view code.
Makes sense. Given that, I'll close this issue.
A newsletter I subscribe to sends paragraphs consisting of unwrapped lines with each paragraph indicated by indentation (rather than a newline between paragraphs).
For instance, text might look like
I use
(mu4e-view-fill-long-lines)
to wrap these paragraphs. However, this results in the text being collapsed into a single paragraph for the length of the article. To get around that, I have modifiedmu4e-view-fill-long-lines
as shown below. I'm not sure if anyone else would be interested in the fix, but thought I would include it here in case it seems worth upstreaming. (This may not be the best way to solve the issue – this works, but I suspect a more robust solution might involveparagraph-indent-minor-mode
or something similar).Note: the only change from the current version is the addition of