From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Theodor Thornhill Newsgroups: gmane.emacs.bugs Subject: bug#41572: 28.0.50; [PATCH] Support plain project marked with file .emacs-project Date: Fri, 05 Jun 2020 19:22:21 +0000 Message-ID: <87ftb92u8q.fsf@thornhill.no> References: <5f584d83-ef45-9912-bfbc-d2f00b24b9fd@yandex.ru> <87pnahjgdr.fsf@linkov.net> Reply-To: Theodor Thornhill Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="33360"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Zhu Zihao , 41572@debbugs.gnu.org To: Dmitry Gutov , Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 05 21:48:32 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1jhIKN-0008ZP-NI for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Jun 2020 21:48:31 +0200 Original-Received: from localhost ([::1]:48908 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhIKM-0002QS-LG for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Jun 2020 15:48:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35096) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhIJu-0002LC-RL for bug-gnu-emacs@gnu.org; Fri, 05 Jun 2020 15:48:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38467) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jhIJu-0000jW-Iy for bug-gnu-emacs@gnu.org; Fri, 05 Jun 2020 15:48:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jhIJu-0002oG-HY for bug-gnu-emacs@gnu.org; Fri, 05 Jun 2020 15:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 05 Jun 2020 19:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41572 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 41572-submit@debbugs.gnu.org id=B41572.159138644910744 (code B ref 41572); Fri, 05 Jun 2020 19:48:02 +0000 Original-Received: (at 41572) by debbugs.gnu.org; 5 Jun 2020 19:47:29 +0000 Original-Received: from localhost ([127.0.0.1]:50011 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jhIJM-0002n8-Ur for submit@debbugs.gnu.org; Fri, 05 Jun 2020 15:47:29 -0400 Original-Received: from mail2.protonmail.ch ([185.70.40.22]:60042) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jhHvE-00029F-81 for 41572@debbugs.gnu.org; Fri, 05 Jun 2020 15:22:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=protonmail; t=1591384945; bh=i9v6NjKsWKtbmtfWD3azQlOI3b+ytwwKmZ9yI2O9Jt0=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=q9PsAt9L3k/+tJIfm0IOc9bmdcb6ymrSKFg2MJwLBlWWGqNbPOBU28h2AhpGtEqvi +HhbUEslg6OVJ8q5zLotl4+fZMFCCzgBzZyI9SOgyOB19pI9AbUf93wrbyhphnZCKL 8K/Vv6GwuaxA+Z+aY4urZYoUGXUHmLDLJOeRrl8tb9kRYKjWQoFTMbFWOmypkGng1m frNO5gqllYTwLePuGUgTo9cCx01C6cPds4lInbQAaA1GCJzMCR9IngfxQUgVmdOx28 ttpbWB5PE5mq70dPzMsCL3DHYa1yFZX2QoGpRGHy+K+BLFpvXUymGf4lmtO4+rnqy5 1NS7s1xAAIXRQ== In-Reply-To: X-Mailman-Approved-At: Fri, 05 Jun 2020 15:47:26 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:181582 Archived-At: =20 Hello, =20 =20 "Dmitry Gutov" writes: > I like this suggestion better (no "special" files), but would we be able > to avoid scope creep? Wouldn't users then expect being able to specify > ignored directories in such projects? And then faster indexing (e.g. > using caching), compared to the VC backend? Isn't this already supported? In a major mode I'm making right now I believe I have covered both options: (defcustom elm-root-file "elm.json" "...") =20 =20 (defun elm-project-root (dir) "Create the cons cell `project-root' needs to discover root." (let ((root (locate-dominating-file dir elm-root-file))) (when root (cons 'elm root)))) =20 (cl-defmethod project-root ((project (head elm))) (cdr project)) (cl-defmethod project-ignores ((project (head elm)) dir) (append vc-directory-exclusion-list ;; This could also be a defcustom ofc (list "./elm-stuff/"))) (add-hook 'project-find-functions #'elm-project-root) - This will add both the option to not execute git init, but still find roo= t. - Also grepping will ignore the "node-modulesy" "elm-stuff". - In addition, the vc-directory-exclusion-list can be edited to support arb= itrary patterns, at least with my limited testing. - It should be no problem to add a ".emacs-project" there in your own confi= g? =20 Am I missing something, or is this already available? This of course depend= s on major modes supporting this integration? =20 Theodor =20 =20 > > Projectile uses the "special file" for the former, and I'm not really > fond of its solution for the latter.