--- /dev/null
+Return-Path: <jrollins@finestructure.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 960BE431E64\r
+ for <notmuch@notmuchmail.org>; Mon, 16 Jan 2012 11:31:21 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.29\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.29 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_MED=-2.3, T_MIME_NO_TEXT=0.01] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id Be0SH3bBE2fj for <notmuch@notmuchmail.org>;\r
+ Mon, 16 Jan 2012 11:31:21 -0800 (PST)\r
+Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu\r
+ [131.215.239.19])\r
+ by olra.theworths.org (Postfix) with ESMTP id 0AD1F431FB6\r
+ for <notmuch@notmuchmail.org>; Mon, 16 Jan 2012 11:31:21 -0800 (PST)\r
+Received: from earth-doxen.imss.caltech.edu (localhost [127.0.0.1])\r
+ by earth-doxen-postvirus (Postfix) with ESMTP id B884766E016C;\r
+ Mon, 16 Jan 2012 11:31:20 -0800 (PST)\r
+X-Spam-Scanned: at Caltech-IMSS on earth-doxen by amavisd-new\r
+Received: from finestructure.net (cpe-76-174-137-84.socal.res.rr.com\r
+ [76.174.137.84]) (Authenticated sender: jrollins)\r
+ by earth-doxen-submit (Postfix) with ESMTP id BD40F66E00F4;\r
+ Mon, 16 Jan 2012 11:31:17 -0800 (PST)\r
+Received: by finestructure.net (Postfix, from userid 1000)\r
+ id 56EB02C8; Mon, 16 Jan 2012 11:31:17 -0800 (PST)\r
+From: Jameson Graef Rollins <jrollins@finestructure.net>\r
+To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH 1/1] Make buttons for attachments allow viewing as well as\r
+ saving\r
+In-Reply-To: <1326629796-11436-2-git-send-email-markwalters1009@gmail.com>\r
+References: <1326629796-11436-1-git-send-email-markwalters1009@gmail.com>\r
+ <1326629796-11436-2-git-send-email-markwalters1009@gmail.com>\r
+User-Agent: Notmuch/0.11+63~g6965a07 (http://notmuchmail.org) Emacs/23.3.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Mon, 16 Jan 2012 11:31:16 -0800\r
+Message-ID: <87wr8r5trv.fsf@servo.finestructure.net>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/signed; boundary="=-=-=";\r
+ micalg=pgp-sha256; protocol="application/pgp-signature"\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 16 Jan 2012 19:31:21 -0000\r
+\r
+--=-=-=\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+On Sun, 15 Jan 2012 12:16:36 +0000, Mark Walters <markwalters1009@gmail.com=\r
+> wrote:\r
+> Define a keymap for attachment buttons to allow multiple actions.\r
+> Define 3 possible actions:\r
+> save attachment: exactly as currently,\r
+> view attachment: uses mailcap entry,\r
+> view attachment with user chosen program\r
+\r
+Great improvement, Mark! Thanks for this. I've been wanting this kind\r
+of functionality for a while, actually, and this is a really great\r
+implementation. It works like a charm, and the code looks good to me,\r
+modulo a couple small comments below.\r
+\r
+> Keymap on a button is: s for save, v for view and o for view with\r
+> other program. Default (i.e. enter or mouse button) is save but is\r
+> easily configurable e.g. set to view with\r
+> (setq notmuch-show-part-button-default-action 'notmuch-show-part-view-act=\r
+ion)\r
+\r
+Actually, this should really be a defcustom. Maybe something like this:\r
+\r
+(defcustom notmuch-show-part-button-default-action 'notmuch-show-part-butto=\r
+n-save\r
+ "Default part header button action (on ENTER or mouse click)."\r
+ :group 'notmuch\r
+ :type '(choice (function :tag "Save part"\r
+ :value notmuch-show-part-button-save)\r
+ (function :tag "View part"\r
+ :value notmuch-show-part-button-view)\r
+ (function :tag "View interactively"\r
+ :value notmuch-show-part-button-interactively-vie=\r
+w))\r
+\r
+Unfortunately this isn't quite working right, since it's not setting the\r
+default properly, but if someone can help me figure out what I'm doing\r
+wrong, I think this is at least the right idea.\r
+\r
+> One implementation detail: the view attachment function forces all\r
+> attachments to be "displayed" using mailcap even if emacs could\r
+> display them itself. Thus, for example, text/html appears in a browser\r
+> and text/plain asks whether to save (on a standard debian setup)\r
+\r
+I think this is good.\r
+\r
+> +(defvar notmuch-show-part-button-default-action 'notmuch-show-part-save-=\r
+action)=20\r
+\r
+There's a white space at the end of this line, which produces the\r
+following git warning:\r
+\r
+ Applying: Make buttons for attachments allow viewing as well as saving\r
+ /home/jrollins/src/notmuch/git/.git/rebase-apply/patch:96: trailing white=\r
+space.\r
+ (defvar notmuch-show-part-button-default-action 'notmuch-show-part-save-a=\r
+ction)\r
+ warning: 1 line adds whitespace errors.\r
+\r
+So if you go with (an improved version of) my defcustom suggestion above\r
+you can kill two birds with one stone:\r
+\r
+=2D(defvar notmuch-show-part-button-default-action 'notmuch-show-part-save-=\r
+action)=20\r
++(defcustom notmuch-show-part-button-default-action '(notmuch-show-part-but=\r
+=3D\r
+ton-save)\r
++ "Default part header button action (on ENTER or mouse click)."\r
++ :group 'notmuch\r
++ :type '(choice (function :tag "Save part"\r
++ :value notmuch-show-part-button-save)\r
++ (function :tag "View part"\r
++ :value notmuch-show-part-button-view)\r
++ (function :tag "View interactively"\r
++ :value notmuch-show-part-button-interactively-vi=\r
+ew))\r
+\r
+jamie.\r
+\r
+--=-=-=\r
+Content-Type: application/pgp-signature\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v1.4.11 (GNU/Linux)\r
+\r
+iQIcBAEBCAAGBQJPFHsEAAoJEO00zqvie6q8J88QAKtNikW4qQBmhYDyjLG79Wf6\r
+gs1HIiuza3DtA/Q4NKEKgZjT56Rtk9fGRwAELY1oPtkKNhoLa9QQ7qfvfGsbjEBK\r
+Iv/iOsPqsYme4vXx7pLNLkmAS4jOSK20PYGik0408h/0JxEvNkWyCU0x2hyClnGB\r
+NMKUf/J24lX76L6OlG9xtaWPWZwkHTQexoeFy9+K6eUudPFEPaIw6dt1R0m/FgES\r
+2U6HYUmM2zfw18EBJdOvYkjVUfgAdB2xi49k32y4RP+mqktUk2Z53ZlNSct1NOpe\r
+/Ev+fEqX6/3RDPTqCY7wYJPVukGruwS4n0pvjF8SCDf4LTq1Hmq/Zz7dNQoxAbxq\r
+FlZGxuMvZ03ivznNNA3tbpzt6N2fn+MLJD7czqAAZEEZYNRqIslNA2Rn1Fzuawig\r
+l9Sgt6WpspdUCXQzRUzc8WiYkzIkS23h45bKL/JQo7JzOXk1Q26P0WOsnrOkTs/e\r
+vOIa/zI+yJrcr94CLpBvKfMstZQe7LYQ81MwIRrPG84XzmRshaLluZuao2mBFE48\r
+ca2YMKhFYDitV8T1iaa/RDjLfu5XFOuU6Gacg8ggDOhIeyJZkBjncd5DgoQH0aLJ\r
+qq5wnzAaR/wo3A4DGwXShk3LaTQQ8x6PnGOp3fSFGyShxKRWGEJdPXXh/dxldDRN\r
+46ef6yYLYYZfWvGGqcmY\r
+=Vbd8\r
+-----END PGP SIGNATURE-----\r
+--=-=-=--\r