* mu4e/mu4e-view.el (mu4e-mark-region-code): New function to highlight region marked with `message-mark-inserted-region'.

* mu4e/mu4e-vars.el (mu4e-region-code): New face.
This commit is contained in:
Thierry Volpiatto 2014-03-24 09:17:25 +01:00
parent 0c18a0b816
commit 8394e6069f
2 changed files with 30 additions and 1 deletions

View File

@ -524,7 +524,12 @@ mu4e-compose-mode."
"Face for the separator between headers / message in
mu4e-compose-mode."
:group 'mu4e-faces)
(defface mu4e-region-code
'((t (:background "DarkSlateGray")))
"Face for highlighting marked region in mu4e-view buffer."
:group 'mu4e-faces)
;; headers info
(defconst mu4e-header-info
'( (:attachments .

View File

@ -903,6 +903,30 @@ all messages in the subthread at point in the headers view."
(interactive)
(mu4e~view-in-headers-context (mu4e-headers-search-edit)))
(defun mu4e-mark-region-code ()
(require 'message)
(let (beg end ov-beg ov-end ov-inv)
(save-excursion
(goto-char (point-min))
(while (re-search-forward
(concat "^" message-mark-insert-begin) nil t)
(setq ov-beg (match-beginning 0)
ov-end (match-end 0)
ov-inv (make-overlay ov-beg ov-end)
beg ov-end)
(overlay-put ov-inv 'invisible t)
(when (re-search-forward
(concat "^" message-mark-insert-end) nil t)
(setq ov-beg (match-beginning 0)
ov-end (match-end 0)
ov-inv (make-overlay ov-beg ov-end)
end ov-beg)
(overlay-put ov-inv 'invisible t))
(when (and beg end)
(let ((ov (make-overlay beg end)))
(overlay-put ov 'face 'mu4e-region-code))
(setq beg nil end nil))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; attachment handling
(defun mu4e~view-get-attach-num (prompt msg &optional multi)