summaryrefslogtreecommitdiff
path: root/mu4e
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2014-03-24 09:17:25 +0100
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2014-03-24 09:17:25 +0100
commit8394e6069f38259b1a6f882ed5ee954ad6130c64 (patch)
treea40188c76499a1b8568507bf529a154f796a9d94 /mu4e
parent0c18a0b816dc2eaa4bf8c282c1120662266f7364 (diff)
* 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.
Diffstat (limited to 'mu4e')
-rw-r--r--mu4e/mu4e-vars.el7
-rw-r--r--mu4e/mu4e-view.el24
2 files changed, 30 insertions, 1 deletions
diff --git a/mu4e/mu4e-vars.el b/mu4e/mu4e-vars.el
index 73c22f1..cb7006d 100644
--- a/mu4e/mu4e-vars.el
+++ b/mu4e/mu4e-vars.el
@@ -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 .
diff --git a/mu4e/mu4e-view.el b/mu4e/mu4e-view.el
index f6cf922..67248f3 100644
--- a/mu4e/mu4e-view.el
+++ b/mu4e/mu4e-view.el
@@ -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)