* mu4e.el: some renaming, clean-up message texts from non-breaking spaces, \r
This commit is contained in:
@ -210,17 +210,17 @@ used when faced with html-only message."
|
|||||||
"Customizations for composing/sending messages."
|
"Customizations for composing/sending messages."
|
||||||
:group 'mu4e)
|
:group 'mu4e)
|
||||||
|
|
||||||
(defcustom mu4e-msg-citation-prefix "> "
|
(defcustom mu4e-send-citation-prefix "> "
|
||||||
"String to prefix cited message parts with."
|
"String to prefix cited message parts with."
|
||||||
:type 'string
|
:type 'string
|
||||||
:group 'mu4e-compose)
|
:group 'mu4e-compose)
|
||||||
|
|
||||||
(defcustom mu4e-msg-reply-prefix "Re: "
|
(defcustom mu4e-send-reply-prefix "Re: "
|
||||||
"String to prefix the subject of replied messages with."
|
"String to prefix the subject of replied messages with."
|
||||||
:type 'string
|
:type 'string
|
||||||
:group 'mu4e-compose)
|
:group 'mu4e-compose)
|
||||||
|
|
||||||
(defcustom mu4e-msg-forward-prefix "Fwd: "
|
(defcustom mu4e-send-forward-prefix "Fwd: "
|
||||||
"String to prefix the subject of forwarded messages with."
|
"String to prefix the subject of forwarded messages with."
|
||||||
:type 'string
|
:type 'string
|
||||||
:group 'mu4e-compose)
|
:group 'mu4e-compose)
|
||||||
@ -231,7 +231,6 @@ used when faced with html-only message."
|
|||||||
:group 'mu4e-compose)
|
:group 'mu4e-compose)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;; Faces
|
;; Faces
|
||||||
|
|
||||||
(defgroup mu4e-faces nil
|
(defgroup mu4e-faces nil
|
||||||
@ -519,19 +518,18 @@ Also see `mu/flags-to-string'.
|
|||||||
or if not available, :body-html converted to text. By default, it
|
or if not available, :body-html converted to text. By default, it
|
||||||
uses the emacs built-in `html2text'. Alternatively, if
|
uses the emacs built-in `html2text'. Alternatively, if
|
||||||
`mu4e-html2text-command' is non-nil, it will use that."
|
`mu4e-html2text-command' is non-nil, it will use that."
|
||||||
(let ((txt (plist-get msg :body-txt))
|
(let* ((txt (plist-get msg :body-txt))
|
||||||
(html (plist-get msg :body-html)))
|
(html (plist-get msg :body-html))
|
||||||
;; show the html body if there is no text, or if the text body is super
|
;; get the html body if there is no text, or if the text body is super
|
||||||
;; short compared to the html one -- ie., it's probably just some lame 'this
|
;; short compared to the html one -- ie., it's probably just some lame 'this
|
||||||
;; message requires html' message
|
;; message requires html' message
|
||||||
(if (not html)
|
(body (if (not html)
|
||||||
(if (not txt) "" txt)
|
(if (not txt) "" txt)
|
||||||
;; there's an html part
|
;; there's an html part
|
||||||
(if (or (not txt) (< (* 10 (length txt)) (length html)))
|
(if (or (not txt) (< (* 10 (length txt)) (length html)))
|
||||||
;; there's no text part, or it's very small
|
;; there's no text part, or it's very small
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(insert html) ;; FIXME somehow, the replace-regexp does not work
|
(insert html)
|
||||||
(replace-regexp "[\r ]" " " nil (point-min) (point-max))
|
|
||||||
(if mu4e-html2text-command ;; if defined, use the external tool
|
(if mu4e-html2text-command ;; if defined, use the external tool
|
||||||
(shell-command-on-region (point-min) (point-max) mu4e-html2text-command
|
(shell-command-on-region (point-min) (point-max) mu4e-html2text-command
|
||||||
nil t)
|
nil t)
|
||||||
@ -540,6 +538,9 @@ uses the emacs built-in `html2text'. Alternatively, if
|
|||||||
(buffer-string))
|
(buffer-string))
|
||||||
;; there's a normal sized text part
|
;; there's a normal sized text part
|
||||||
txt))))
|
txt))))
|
||||||
|
;; and finally, remove some crap from the remaining string.
|
||||||
|
(replace-regexp-in-string "[
|
||||||
|
]" " " body nil nil nil)))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user