From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 115F46DE0C32 for ; Thu, 28 Mar 2019 10:58:05 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.02 X-Spam-Level: X-Spam-Status: No, score=-0.02 tagged_above=-999 required=5 tests=[AWL=-0.019, SPF_PASS=-0.001] 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 QwttvXzMm8LW for ; Thu, 28 Mar 2019 10:58:04 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id E0C206DE0262 for ; Thu, 28 Mar 2019 10:58:03 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.89) (envelope-from ) id 1h9ZHu-0005rf-KK; Thu, 28 Mar 2019 13:58:02 -0400 Received: (nullmailer pid 30054 invoked by uid 1000); Thu, 28 Mar 2019 17:58:00 -0000 From: David Bremner To: David Edmondson , notmuch@notmuchmail.org Subject: Re: [PATCH v2 2/3] emacs: Pass the part to text/plain hook functions In-Reply-To: <20181222121058.5892-3-dme@dme.org> References: <20181222121058.5892-1-dme@dme.org> <20181222121058.5892-3-dme@dme.org> Date: Thu, 28 Mar 2019 14:58:00 -0300 Message-ID: <875zs29907.fsf@tethera.net> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 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: Thu, 28 Mar 2019 17:58:05 -0000 David Edmondson writes: > Some text/plain hook functions may wish to access the details of the > part that is being manipulated. > --- > emacs/notmuch-show.el | 2 +- > emacs/notmuch-wash.el | 10 +++++----- > 2 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el > index 78f1af47..b3cefcd9 100644 > --- a/emacs/notmuch-show.el > +++ b/emacs/notmuch-show.el > @@ -744,7 +744,7 @@ will return nil if the CID is unknown or cannot be retrieved." > (save-excursion > (save-restriction > (narrow-to-region start (point-max)) > - (run-hook-with-args 'notmuch-show-insert-text/plain-hook msg depth)))) > + (run-hook-with-args 'notmuch-show-insert-text/plain-hook msg part depth)))) > t) > I wonder if it would be better to have depth last as an optional parameter, so that existing user written hooks don't break. I don't know if 1) that works in practice 2) there are a non-trivial number of user written text/plain hooks