--- /dev/null
+Return-Path: <stlman@poczta.fm>\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 333FC431FD7\r
+ for <notmuch@notmuchmail.org>; Fri, 12 Dec 2014 11:10:06 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.001\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.001 tagged_above=-999 required=5\r
+ tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001,\r
+ RCVD_IN_DNSWL_NONE=-0.0001] 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 8+72mp1DlgnN for <notmuch@notmuchmail.org>;\r
+ Fri, 12 Dec 2014 11:10:02 -0800 (PST)\r
+X-Greylist: delayed 920 seconds by postgrey-1.32 at olra;\r
+ Fri, 12 Dec 2014 11:10:02 PST\r
+Received: from smtpo.poczta.interia.pl (smtpo.poczta.interia.pl\r
+ [217.74.65.154])\r
+ (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id B837C431FBC\r
+ for <notmuch@notmuchmail.org>; Fri, 12 Dec 2014 11:10:02 -0800 (PST)\r
+X-Interia-R: Interia\r
+X-Interia-R-IP: 89.65.17.18\r
+X-Interia-R-Helo: <localhost>\r
+Received: from localhost (89-65-17-18.dynamic.chello.pl [89.65.17.18])\r
+ (using TLSv1 with cipher AES128-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by www.poczta.fm (INTERIA.PL) with ESMTPSA;\r
+ Fri, 12 Dec 2014 19:54:36 +0100 (CET)\r
+From: =?UTF-8?q?=C5=81ukasz=20Stelmach?= <stlman@poczta.fm>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] emacs: do not change users' mail agent configuration\r
+Date: Fri, 12 Dec 2014 19:54:26 +0100\r
+Message-Id: <1418410466-26604-1-git-send-email-stlman@poczta.fm>\r
+X-Mailer: git-send-email 2.0.4\r
+X-Interia-Antivirus: OK\r
+X-IPL-SAS-SPAS: -4.4\r
+X-IPL-SAS-UREP: 0\r
+X-IPL-Envelope-To: stlman@poczta.fm\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=interia.pl;\r
+ s=biztos; t=1418410479;\r
+ bh=L1FgsJxwDdqUKfuvGPJU7YVZWscisuvHX8Vf67dpuBY=;\r
+ h=X-Interia-R:X-Interia-R-IP:X-Interia-R-Helo:From:To:Cc:Subject:\r
+ Date:Message-Id:X-Mailer:X-Interia-Antivirus:X-IPL-SAS-SPAS:\r
+ X-IPL-SAS-UREP:X-IPL-Envelope-To;\r
+ b=j/6ja8Y4CZMGsKIgeI3SJ3uHtyeHAZDvLbbkwGMHZIAnfimYdvUzuJC61p2UEzJWc\r
+ JxSPT50vH/1QSqwz+65kgZmYZ2seGCj1qQA7728nVeJsKyekZBCEQa2lTSZRSHP32z\r
+ QgSrNELkiKeRA/mJYEfaGf4fuS2JlEaZ/yRgjlHg=\r
+X-Mailman-Approved-At: Sat, 13 Dec 2014 12:46:16 -0800\r
+Cc: =?UTF-8?q?=C5=81ukasz=20Stelmach?= <stlman@poczta.fm>\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: Fri, 12 Dec 2014 19:10:06 -0000\r
+\r
+`mail-user-agent' is defined with defcustom and may be customised\r
+by users. It should not be set to arbitrary values in modules.\r
+\r
+To make use of that configuration value call `compose-mail' which\r
+starts user's preferred mail composition package as selected with\r
+the variable `mail-user-agent' instead of notmuch's hardcoded\r
+`message-mail'.\r
+---\r
+ NEWS | 10 ++++++++++\r
+ emacs/notmuch-mua.el | 2 +-\r
+ emacs/notmuch.el | 2 --\r
+ 3 files changed, 11 insertions(+), 3 deletions(-)\r
+\r
+diff --git a/NEWS b/NEWS\r
+index 44e8d05..cf5b3c3 100644\r
+--- a/NEWS\r
++++ b/NEWS\r
+@@ -64,6 +64,16 @@ Added `notmuch address` subcommand\r
+ Emacs Interface\r
+ ---------------\r
+ \r
++Fixed `mail-user-agent` handling\r
++\r
++ The value of the mail-user-agent variable is not forcibly set to\r
++ `notmuch-user-agent`, regardles of how a user has customised it,\r
++ everytime notmuch.el is loaded. This way, someone who used for example\r
++ Gnus has her MUA and notmuch just as a search engine, doesn't have her\r
++ configuration broken everytime notmuch.el is loaded. The user can now\r
++ use her favourite mail composing package when replying messages in\r
++ notmuch too.\r
++\r
+ Use the `j` key to access saved searches from anywhere in notmuch\r
+ \r
+ `j` is now globally bound to `notmuch-jump`, which provides fast,\r
+diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
+index 2c58886..f02c7b5 100644\r
+--- a/emacs/notmuch-mua.el\r
++++ b/emacs/notmuch-mua.el\r
+@@ -263,7 +263,7 @@ OTHER-ARGS are passed through to `message-mail'."\r
+ (push (cons 'From (concat\r
+ (notmuch-user-name) " <" (notmuch-user-primary-email) ">")) other-headers))\r
+ \r
+- (apply #'message-mail to subject other-headers other-args)\r
++ (apply #'compose-mail to subject other-headers other-args)\r
+ (message-sort-headers)\r
+ (message-hide-headers)\r
+ (set-buffer-modified-p nil)\r
+diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
+index 218486a..80cab57 100644\r
+--- a/emacs/notmuch.el\r
++++ b/emacs/notmuch.el\r
+@@ -1037,8 +1037,6 @@ notmuch buffers exist, run `notmuch'."\r
+ (switch-to-buffer first))\r
+ (notmuch))))\r
+ \r
+-(setq mail-user-agent 'notmuch-user-agent)\r
+-\r
+ (provide 'notmuch)\r
+ \r
+ ;; After provide to avoid loops if notmuch was require'd via notmuch-init-file.\r
+-- \r
+2.0.4\r
+\r