From: David Bremner Date: Mon, 9 Nov 2015 12:17:44 +0000 (+2000) Subject: Re: [PATCH] emacs: Fix regression in (notmuch-)message-mode initialization X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c271d363f49c858d79dd58a248e00f7df71d9b99;p=notmuch-archives.git Re: [PATCH] emacs: Fix regression in (notmuch-)message-mode initialization --- diff --git a/e5/608751fcf9e9569441e6e80f47783a7dc93d13 b/e5/608751fcf9e9569441e6e80f47783a7dc93d13 new file mode 100644 index 000000000..cbcdf5e40 --- /dev/null +++ b/e5/608751fcf9e9569441e6e80f47783a7dc93d13 @@ -0,0 +1,81 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by arlo.cworth.org (Postfix) with ESMTP id 8B4AD6DE1104 + for ; Mon, 9 Nov 2015 04:18:53 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: 0.095 +X-Spam-Level: +X-Spam-Status: No, score=0.095 tagged_above=-999 required=5 tests=[AWL=0.095] + autolearn=disabled +Received: from arlo.cworth.org ([127.0.0.1]) + by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id uJrmbH8EZxv4 for ; + Mon, 9 Nov 2015 04:18:51 -0800 (PST) +Received: from gitolite.debian.net (gitolite.debian.net [87.98.215.224]) + by arlo.cworth.org (Postfix) with ESMTPS id 0703C6DE103A + for ; Mon, 9 Nov 2015 04:18:51 -0800 (PST) +Received: from remotemail by gitolite.debian.net with local (Exim 4.80) + (envelope-from ) + id 1ZvlOd-0005o5-83; Mon, 09 Nov 2015 12:18:03 +0000 +Received: (nullmailer pid 22982 invoked by uid 1000); Mon, 09 Nov 2015 + 12:17:44 -0000 +From: David Bremner +To: Michal Sojka , notmuch@notmuchmail.org +Subject: Re: [PATCH] emacs: Fix regression in (notmuch-)message-mode + initialization +In-Reply-To: <1446573161-28068-1-git-send-email-sojkam1@fel.cvut.cz> +References: <1446573161-28068-1-git-send-email-sojkam1@fel.cvut.cz> +User-Agent: Notmuch/0.21~rc3+7~g10e933a (http://notmuchmail.org) Emacs/24.5.1 + (x86_64-pc-linux-gnu) +Date: Mon, 09 Nov 2015 08:17:44 -0400 +Message-ID: <87d1vj4b9z.fsf@zancas.localnet> +MIME-Version: 1.0 +Content-Type: text/plain +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.20 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Mon, 09 Nov 2015 12:18:53 -0000 + +Michal Sojka writes: + +> This commit uses advice mechanism to call notmuch-message-mode instead +> of message-mode. This way, a call to message-mail initializes directly +> notmuch-message-mode rather than message-mode which is later changed +> to notmuch-message-mode. The advice is constructed in such a way, that +> it is effective only once and when called by notmuch. The second call +> to message-mode (from notmuch-message-mode) calls the original +> message-mode. + +I wanted to answer this with an alternative patch, but I haven't had +time. + +I admit to being somewhat prejudiced against shipping code with advice +in it (IMHO it's fine for user specific customization, but not very +maintainable). + +I think we might be better off in the long run replacing the call to +message-mail. Code duplication is obviously not great, but perhaps some +of the complexity of message-mail / message-pop-to-buffer can be +eliminated, since we don't need to support all of the use cases of +message-mail. + +> This implementation uses the new advice mechanism introduced in Emacs +> 24.4. If we want to support older version, this must be changed. + +We do try to support Emacs 23 still (except for some optional +features). Unfortunately old advice is even nastier. + +d +