* mu4e: mu4e-view-fill-headers to enable/disable header filling

This commit is contained in:
djcb
2013-10-13 15:25:12 +03:00
parent fc54e4a61b
commit 44011351da

View File

@ -115,8 +115,10 @@ where:
* NAME is the name of the action (e.g. \"Count lines\") * NAME is the name of the action (e.g. \"Count lines\")
* FUNC is a function which receives two arguments: the message * FUNC is a function which receives two arguments: the message
plist and the attachment number. plist and the attachment number.
The first letter of NAME is used as a shortcut character.") The first letter of NAME is used as a shortcut character.")
(defvar mu4e-view-fill-headers t
"If non-nil, automatically fill the headers when viewing them.")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -278,13 +280,14 @@ add text-properties to VAL."
(if dont-propertize-val (if dont-propertize-val
val val
(propertize val 'face 'mu4e-view-header-value-face)) "\n") (propertize val 'face 'mu4e-view-header-value-face)) "\n")
;; temporarily set the fill column <margin> positions to the right, so (when mu4e-view-fill-headers
;; we can indent the following lines correctly ;; temporarily set the fill column <margin> positions to the right, so
(let*((margin 1) (fill-column (- fill-column margin))) ;; we can indent the following lines correctly
(fill-region (point-min) (point-max)) (let*((margin 1) (fill-column (- fill-column margin)))
(goto-char (point-min)) (fill-region (point-min) (point-max))
(while (and (zerop (forward-line 1)) (not (looking-at "^$"))) (goto-char (point-min))
(indent-to-column margin))) (while (and (zerop (forward-line 1)) (not (looking-at "^$")))
(indent-to-column margin))))
(buffer-string)) (buffer-string))
""))) "")))