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 506EF6DE0F35 for ; Thu, 21 Nov 2019 04:16:05 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.062 X-Spam-Level: X-Spam-Status: No, score=-0.062 tagged_above=-999 required=5 tests=[AWL=-0.061, 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 gTevn9ebl17Z for ; Thu, 21 Nov 2019 04:16:04 -0800 (PST) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 8043B6DE0A43 for ; Thu, 21 Nov 2019 04:16:04 -0800 (PST) Received: from remotemail by fethera.tethera.net with local (Exim 4.89) (envelope-from ) id 1iXlNT-0004UT-HO; Thu, 21 Nov 2019 07:16:03 -0500 Received: (nullmailer pid 335986 invoked by uid 1000); Thu, 21 Nov 2019 12:16:02 -0000 From: David Bremner To: Daniel Kahn Gillmor , Johan Parin , notmuch@notmuchmail.org Cc: Johan Parin Subject: Re: [PATCH] Display extra headers for emacs-mua - db config option In-Reply-To: <87imnej66q.fsf@fifthhorseman.net> References: <20191116162723.18343-1-johan.parin@gmail.com> <87imnej66q.fsf@fifthhorseman.net> Date: Thu, 21 Nov 2019 08:16:02 -0400 Message-ID: <878so98lx9.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, 21 Nov 2019 12:16:05 -0000 Daniel Kahn Gillmor writes: > > I'm a little weirded out by the move to a static notmuch_database_t > *notmuch object. Are we doing this because we don't want to pass around > the database to internal functions? I know that the scope of > nomtuch-show.c is basically "global scope", but i worry that it makes > the code more difficult to read and maintain. I had a similar reaction. > > It's also not a common idiom in the rest of the codebase (at least not > one that i've seen). > > Is it that much worse to pass around the notmuch_database_t *? There are some call chains 3 or 4 deep that would need to be modified. I _think_ that there is always a notmuch_config_t available, so one option would be to stash the headers or the database there. We do have the convention other places (mainly in lib/) of objects having a pointer to their "parent" database.