[PATCH 8/8] cli: optionally restore message properties from dump file
[notmuch-archives.git] / 51 / 2b9d7253114db89ea3b75e2c4bb2383f6ef641
1 Return-Path: <awg@lagos.xvx.ca>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 4CD0A429E26\r
6         for <notmuch@notmuchmail.org>; Wed, 30 Nov 2011 08:50:09 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_NONE=-0.0001] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id QaHH3JRIKeTQ for <notmuch@notmuchmail.org>;\r
16         Wed, 30 Nov 2011 08:50:08 -0800 (PST)\r
17 X-Greylist: delayed 565 seconds by postgrey-1.32 at olra;\r
18         Wed, 30 Nov 2011 08:50:08 PST\r
19 Received: from idcmail-mo1so.shaw.ca (idcmail-mo1so.shaw.ca [24.71.223.10])\r
20         by olra.theworths.org (Postfix) with ESMTP id 9588E431FB6\r
21         for <notmuch@notmuchmail.org>; Wed, 30 Nov 2011 08:50:08 -0800 (PST)\r
22 Received: from pd2ml1so-ssvc.prod.shaw.ca ([10.0.141.139])\r
23         by pd3mo1so-svcs.prod.shaw.ca with ESMTP; 30 Nov 2011 09:40:42 -0700\r
24 X-Cloudmark-SP-Filtered: true\r
25 X-Cloudmark-SP-Result: v=1.1 cv=n2W5COKzyCYKBlY96L0A3my6r0xTlngINTUh0kppeyk=\r
26         c=1 sm=1\r
27         a=OJb4Sv6x4FoA:10 a=BLceEmwcHowA:10 a=yQp6g8lIsgqumF79BAsFDg==:17\r
28         a=2T1ejf8vMcL6zZPwiRgA:9 a=5c3mVTZLN-rKsMPNTeEA:7\r
29         a=HpAAvcLHHh0Zw7uRqdWCyQ==:117\r
30 Received: from unknown (HELO lagos.xvx.ca) ([96.52.216.56])\r
31         by pd2ml1so-dmz.prod.shaw.ca with ESMTP; 30 Nov 2011 09:40:42 -0700\r
32 Received: by lagos.xvx.ca (Postfix, from userid 1000)\r
33         id D7EF3800C2C6; Wed, 30 Nov 2011 09:40:41 -0700 (MST)\r
34 From: Adam Wolfe Gordon <awg+notmuch@xvx.ca>\r
35 To: notmuch@notmuchmail.org,\r
36         awg@xvx.ca\r
37 Subject: [RFC PATCH 3/3] emacs: Optionally quote HTML parts when replying.\r
38 Date: Wed, 30 Nov 2011 09:40:41 -0700\r
39 Message-Id: <1322671241-23438-4-git-send-email-awg+notmuch@xvx.ca>\r
40 X-Mailer: git-send-email 1.7.5.4\r
41 In-Reply-To: <1322671241-23438-1-git-send-email-awg+notmuch@xvx.ca>\r
42 References: <1322671241-23438-1-git-send-email-awg+notmuch@xvx.ca>\r
43 X-BeenThere: notmuch@notmuchmail.org\r
44 X-Mailman-Version: 2.1.13\r
45 Precedence: list\r
46 List-Id: "Use and development of the notmuch mail system."\r
47         <notmuch.notmuchmail.org>\r
48 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
49         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
50 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
51 List-Post: <mailto:notmuch@notmuchmail.org>\r
52 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
53 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
54         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
55 X-List-Received-Date: Wed, 30 Nov 2011 16:50:09 -0000\r
56 \r
57 Add support for rendering and quoting HTML parts. Adds a customize option\r
58 notmuch-mua-quote-html-parts, which when non-nil causes HTML parts to be\r
59 included in replies using notmuch reply --format=html.\r
60 ---\r
61  emacs/notmuch-mua.el |   23 +++++++++++++++++++++++\r
62  1 files changed, 23 insertions(+), 0 deletions(-)\r
63 \r
64 diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
65 index 8824b08..e7c1315 100644\r
66 --- a/emacs/notmuch-mua.el\r
67 +++ b/emacs/notmuch-mua.el\r
68 @@ -46,6 +46,14 @@ list."\r
69    :group 'notmuch\r
70    :type '(repeat string))\r
71  \r
72 +(defcustom notmuch-mua-quote-html-parts nil\r
73 +  "Quote HTML parts when replying to a message.\r
74 +\r
75 +If non-nil, notmuch will attempt to render HTML parts using w3m and insert them\r
76 +into reply buffers."\r
77 +  :group 'notmuch\r
78 +  :type 'boolean)\r
79 +\r
80  ;;\r
81  \r
82  (defun notmuch-mua-user-agent-full ()\r
83 @@ -69,10 +77,13 @@ list."\r
84             (push header message-hidden-headers)))\r
85         notmuch-mua-hidden-headers))\r
86  \r
87 +(defun w3m-region (start end)) ;; From `w3m.el'.\r
88  (defun notmuch-mua-reply (query-string &optional sender)\r
89    (let (headers\r
90         body\r
91         (args '("reply")))\r
92 +    (if notmuch-mua-quote-html-parts\r
93 +       (setq args (append args '("--format=html"))))\r
94      (if notmuch-show-process-crypto\r
95         (setq args (append args '("--decrypt"))))\r
96      (setq args (append args (list query-string)))\r
97 @@ -89,6 +100,18 @@ list."\r
98               (goto-char (point-min))\r
99               (setq headers (mail-header-extract)))))\r
100        (forward-line 1)\r
101 +      (if notmuch-mua-quote-html-parts\r
102 +         (save-excursion\r
103 +           (if (re-search-forward "<html" nil t)\r
104 +               (save-restriction\r
105 +                 (goto-char (point-at-bol))\r
106 +                 (narrow-to-region (point) (point-max))\r
107 +                 (w3m-region (point) (point-max))\r
108 +                 (goto-char (point-min))\r
109 +                 (fill-region (point) (point-max))\r
110 +                 (goto-char (point-min))\r
111 +                 (while (re-search-forward "^" nil t)\r
112 +                   (replace-match "> " nil nil))))))\r
113        (setq body (buffer-substring (point) (point-max))))\r
114      ;; If sender is non-nil, set the From: header to its value.\r
115      (when sender\r
116 -- \r
117 1.7.5.4\r
118 \r