From 861026ed2818a085a23bdedfd54b6531e770e271 Mon Sep 17 00:00:00 2001 From: Adam Wolfe Gordon Date: Wed, 14 Nov 2012 18:32:07 +1700 Subject: [PATCH] Re: emacs: Handling external dependencies --- 0f/2c0bb1aaeda86dd49a1d97f84edd2c76cc21b9 | 127 ++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 0f/2c0bb1aaeda86dd49a1d97f84edd2c76cc21b9 diff --git a/0f/2c0bb1aaeda86dd49a1d97f84edd2c76cc21b9 b/0f/2c0bb1aaeda86dd49a1d97f84edd2c76cc21b9 new file mode 100644 index 000000000..742b7787c --- /dev/null +++ b/0f/2c0bb1aaeda86dd49a1d97f84edd2c76cc21b9 @@ -0,0 +1,127 @@ +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 28F4A431FBC + for ; Tue, 13 Nov 2012 17:32:12 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 9j9wxiggbBaw for ; + Tue, 13 Nov 2012 17:32:10 -0800 (PST) +Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com + [209.85.220.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id EFA13431FAF + for ; Tue, 13 Nov 2012 17:32:09 -0800 (PST) +Received: by mail-vc0-f181.google.com with SMTP id n11so8726834vch.26 + for ; Tue, 13 Nov 2012 17:32:09 -0800 (PST) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=google.com; s=20120113; + h=mime-version:sender:x-originating-ip:in-reply-to:references:date + :x-google-sender-auth:message-id:subject:from:to:cc:content-type + :x-gm-message-state; + bh=mT1uRdNnU60xLNn1DLxzh18dE5d/I7SIQtH1ToZL0l4=; + b=nepm+ii5oY/av3VPNL6cLg3//2EQX41/h8tOOCY9z2wWCJ1TieWMHXf1J6sFTPl1Jd + T6/ny2DH+xd2YJmqqi76IeuSWQsf+eHk9sDeRRunuI2WtVaFfYUPSZxgqk54FkgK78j1 + uIezzNOlmhLLNNuhDd5fDWga8ug3n1Z3ch7VrUnVYLhB8ToKY1HpbrwAOKw+rBoEdNjd + 9Zr0LLQmkSyxZaIXwikeTutCNVPf0/j6jBbfh392gknovixOIH+r+dfkdllolltVcWMn + 7eFOQuV7t46CRrtF7Z6U01bhfUk/yInW18bXlqA7itKokoojkGtpYB1/00pUF9Ac7WPJ + +QbQ== +MIME-Version: 1.0 +Received: by 10.220.8.195 with SMTP id i3mr8955455vci.44.1352856727937; Tue, + 13 Nov 2012 17:32:07 -0800 (PST) +Sender: awg@xvx.ca +Received: by 10.220.154.205 with HTTP; Tue, 13 Nov 2012 17:32:07 -0800 (PST) +X-Originating-IP: [2001:470:b:2bb::2] +In-Reply-To: + +References: + +Date: Tue, 13 Nov 2012 18:32:07 -0700 +X-Google-Sender-Auth: goF1VI5xbuUNQLdXQf7EUWJIZPw +Message-ID: + +Subject: Re: emacs: Handling external dependencies +From: Adam Wolfe Gordon +To: Damien Cassou +Content-Type: text/plain; charset=ISO-8859-1 +X-Gm-Message-State: + ALoCoQlpcLorx081vLaz+ef7gikgg5jbGhcaFlD2W5R5eLlRv0Gefy61kiBp6m6Khp3c0OhhhC2P +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 01:32:12 -0000 + +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). + +Just my thoughts - offering them mostly since no one else has replied. + +-- Adam -- 2.26.2