From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Leake Newsgroups: gmane.emacs.devel Subject: Re: Project local variables. Date: Thu, 05 Nov 2020 09:37:34 -0800 Message-ID: <86k0uzvh5t.fsf@stephe-leake.org> References: <20201103194140.cyjy56zgx7757pxx.ref@Ergus> <20201103194140.cyjy56zgx7757pxx@Ergus> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9110"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (windows-nt) Cc: Emacs-Devel List To: Ergus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Nov 05 18:40:24 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kajFH-0002Ex-PN for ged-emacs-devel@m.gmane-mx.org; Thu, 05 Nov 2020 18:40:23 +0100 Original-Received: from localhost ([::1]:37078 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kajFG-0008NY-P5 for ged-emacs-devel@m.gmane-mx.org; Thu, 05 Nov 2020 12:40:22 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60314) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kajE8-0007Oc-9w for emacs-devel@gnu.org; Thu, 05 Nov 2020 12:39:12 -0500 Original-Received: from gateway20.websitewelcome.com ([192.185.46.107]:31325) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kajE6-00036f-3y for emacs-devel@gnu.org; Thu, 05 Nov 2020 12:39:11 -0500 Original-Received: from cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20]) by gateway20.websitewelcome.com (Postfix) with ESMTP id 18AFA400C647A for ; Thu, 5 Nov 2020 11:35:10 -0600 (CST) Original-Received: from host2007.hostmonster.com ([67.20.76.71]) by cmsmtp with SMTP id ajCdkbhYgAAk4ajCfkEa6H; Thu, 05 Nov 2020 11:37:42 -0600 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=stephe-leake.org; s=default; h=Content-Type:MIME-Version:Message-ID: In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=VMxDF6g8RPhruhGypJCEdyZvTgYGoilXy+xpj52FICs=; b=CgghMcRG6wWMB3bbGlMQi0dqD 1k2SfVF1OYeDJi4HYtJaCXBh/08nVqZ4eLGIV94cptPpjrtpUHXUt1Bh3Mi2h8cPeI0LE9R9LcCCI 3HJZHeQGEEePvKuJfSqZDqRLfmcvazSMEjPW9OUQMMHjVU8/o8it8CqrH3o8SoQeIbsXwQ5ELO02P Wf5jPoCEMwpu8QGt/h9Pe8/uUSZHp4h0qK8L38q0xXm0lvJCooFnFCa15iveE081wD1i8cdsgZDjl ybhoXBsfmR/tSaA0UsAoxDsoB8Ly/FZcouxy15q/drX3TCj41wTzjqrAOT8VNsESM/o2hpO2ehA4c tmWZaxpFw==; Original-Received: from [76.77.182.20] (port=52056 helo=Takver4) by host2007.hostmonster.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1kajCd-000nHW-C3; Thu, 05 Nov 2020 10:37:39 -0700 In-Reply-To: <20201103194140.cyjy56zgx7757pxx@Ergus> (Ergus's message of "Tue, 3 Nov 2020 20:41:40 +0100") X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host2007.hostmonster.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - stephe-leake.org X-BWhitelist: no X-Source-IP: 76.77.182.20 X-Source-L: No X-Exim-ID: 1kajCd-000nHW-C3 X-Source-Sender: (Takver4) [76.77.182.20]:52056 X-Source-Auth: stephen_leake@stephe-leake.org X-Email-Count: 2 X-Source-Cap: c3RlcGhlbGU7c3RlcGhlbGU7aG9zdDIwMDcuaG9zdG1vbnN0ZXIuY29t X-Local-Domain: yes Received-SPF: neutral client-ip=192.185.46.107; envelope-from=stephen_leake@stephe-leake.org; helo=gateway20.websitewelcome.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/05 12:39:01 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_NEUTRAL=0.779 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:258745 Archived-At: Ergus writes: > Looking at the evolution of project.el I want to know if there is any > sort of project local environment/namespace/scope. The idea is to > provide some variables that could be shared by all the files in the same > project but that could be modified by external-packages at the elisp > level. something like "setq-project"?? You can derive a new project type: (cl-defstruct my-prj name ;; A user-friendly string, used in menus and messages. variable-1 variable-2 ... ) add a project-find-functions for it: (defun my-prj-find (dir) ... ) (add-hook 'project-find-functions #'my-prj-find 90) and then define new project ops that use the variable for it: (cl-defgeneric my-method-1 ((_project wisi-prj)) ... ) The GNU ELPA wisi package takes this approach. But I suspect you are asking for something more lightweight. > A use case is for example when working in tramp some operations are > expensive like looking for an executable in the remote system. The > search could be made only once; but then if a local file is open the > cached value will be wrong. For this specific case, adding an optional cache to tramp seems like a better approach. Perhaps that just means creating a new file handler that wraps the tramp one with a cache? You could use the above approach to define a project whose files are in a remote directory accessed via tramp, but that doesn't work if you want all the normal emacs functions that access files via file handlers to use the cache. So I don't see how a project-local variable would help. -- -- Stephe Written from unceded ancestral homelands of the Huichiun, an Ohlone people,for which I pay Shuumi Land Tax (https://sogoreate-landtrust.com/shuumi-land-tax) as an inadequate token of reparation.