Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 65AF9431FBC for ; Wed, 14 Nov 2012 01:48:24 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7Qiht1yZ7aBS for ; Wed, 14 Nov 2012 01:48:23 -0800 (PST) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by olra.theworths.org (Postfix) with ESMTP id 54436431FAF for ; Wed, 14 Nov 2012 01:48:23 -0800 (PST) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id 1948D1000E2; Wed, 14 Nov 2012 11:48:23 +0200 (EET) From: Tomi Ollila To: Adam Wolfe Gordon , Damien Cassou Subject: Re: emacs: Handling external dependencies In-Reply-To: References: User-Agent: Notmuch/0.14+84~g8a199bf (http://notmuchmail.org) Emacs/24.2.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain Cc: notmuch mailing list X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 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: Wed, 14 Nov 2012 09:48:24 -0000 On Wed, Nov 14 2012, Adam Wolfe Gordon wrote: > Hi Damien, > > On Sat, Nov 10, 2012 at 8:58 AM, Damien Cassou wrote: >> I recently sent a patch for notmuch emacs that depends on a particular >> library. What is the best way to deal with such dependencies? > > First off, what's the library, and what is it used for? > > I believe that currently the notmuch emacs interface only depends on > stuff that's included with emacs, which is a nice way to be. There are > some packages that can improve the notmuch emacs experience if they > are installed, like w3m. If possible, I'd encourage you to make the > new library recommended, rather than required. > >> I can see different solutions: >> >> 1) distribute a rewritten version of the dependency so that the code >> now belongs to notmuch (e.g., replace the name of the library by >> 'notmuch'). This has the disadvantage of requiring maintenance when a >> new version of the library is released and can also be considered >> 'stealing' by some authors. >> >> 2) use a package manager to load the library. This has the >> disadvantage that the now standard package manager is not in >> widespread use yet and is not compatible with other OS-based package >> managers (such as apt-get in Debian). >> >> 3) distribute the dependency with the rest of notmuch and load this >> one. This has the disadvantage of possibly shadowing an already >> existing version of this library installed through a different means. >> >> 4) distribute the dependency with the rest of notmuch (in a separate >> "fallback-libs/" directory) and load it only when requiring the >> library with the standard load-path does not work. Jonas Bernoulli >> gave me a way to do that: >> >> ,---- >> | (or (require 'THE-LIB nil t) >> | (let ((load-path >> | (cons (expand-file-name >> | "fallback-libs" >> | (file-name-directory (or load-file-name buffer-file-name))) >> | load-path))) >> | (require 'THE-LIB))) >> `---- >> >> What do you think? > > I'm not big on any of these solutions. I'd suggest just using the > package, documenting it as a dependency, and letting users install it > however they like. This means adding it as a dependency to the > distro-specific packaging (easy for Debian and friends, not sure about > others). Now that Adam said it I have to agree. IMO design the feature so that it is disabled unless `header-button` is available. > Just my thoughts - offering them mostly since no one else has replied. > > -- Adam Tomi