From: Tomi Ollila Date: Mon, 9 Nov 2015 20:52:39 +0000 (+0200) Subject: Re: [PATCH] emacs: Fix regression in (notmuch-)message-mode initialization X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=96a9f3ce0b014f38182a44410139832161069364;p=notmuch-archives.git Re: [PATCH] emacs: Fix regression in (notmuch-)message-mode initialization --- diff --git a/60/d849d5ac6d40ec7bd131d565e885906f1ed95b b/60/d849d5ac6d40ec7bd131d565e885906f1ed95b new file mode 100644 index 000000000..d34eb095c --- /dev/null +++ b/60/d849d5ac6d40ec7bd131d565e885906f1ed95b @@ -0,0 +1,103 @@ +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 305346DE1601 + for ; Mon, 9 Nov 2015 12:52:46 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: 0.727 +X-Spam-Level: +X-Spam-Status: No, score=0.727 tagged_above=-999 required=5 tests=[AWL=0.075, + SPF_NEUTRAL=0.652] 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 ZitdA9P0dI1F for ; + Mon, 9 Nov 2015 12:52:43 -0800 (PST) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by arlo.cworth.org (Postfix) with ESMTP id E845B6DE158D + for ; Mon, 9 Nov 2015 12:52:42 -0800 (PST) +Received: from guru.guru-group.fi (localhost [IPv6:::1]) + by guru.guru-group.fi (Postfix) with ESMTP id 1C85510007F; + Mon, 9 Nov 2015 22:52:40 +0200 (EET) +From: Tomi Ollila +To: Michal Sojka , David Bremner , + notmuch@notmuchmail.org +Subject: Re: [PATCH] emacs: Fix regression in (notmuch-)message-mode + initialization +In-Reply-To: <87bnb38hg3.fsf@steelpick.2x.cz> +References: <1446573161-28068-1-git-send-email-sojkam1@fel.cvut.cz> + <87d1vj4b9z.fsf@zancas.localnet> <87bnb38hg3.fsf@steelpick.2x.cz> +User-Agent: Notmuch/0.21+14~g053baf4 (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-unknown-linux-gnu) +X-Face: HhBM'cA~ +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 20:52:46 -0000 + +On Mon, Nov 09 2015, Michal Sojka wrote: + +> On Mon, Nov 09 2015, David Bremner wrote: +>> 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. +> +> OK. I'll try implement notmuch-message-mail as a simpler alternative to +> message-mail. Let's see how it will look like. + +that might be better than my vague thought of let-binding that particular +hook (to nil) and run-hooks it later... + +Tomi (sending from my N9) + +> +>> +>>> 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. +> +> Hopefully, advises won't be needed then. +> +> Thanks, +> -Michal +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> https://notmuchmail.org/mailman/listinfo/notmuch