GNU bug report logs - #41572
28.0.50; [PATCH] Support plain project marked with file .emacs-project

Previous Next

Package: emacs;

Reported by: Zhu Zihao <cjpeople2013 <at> gmail.com>

Date: Thu, 28 May 2020 04:46:02 UTC

Severity: normal

Merged with 54228

Found in versions 28.0.50, 29.0.50

Fixed in version 29.1

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#41572: closed (28.0.50; [PATCH] Support plain project marked
 with file .emacs-project)
Date: Thu, 01 Dec 2022 02:21:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Thu, 1 Dec 2022 04:19:47 +0200
with message-id <9a66f6fc-c08b-02b3-7780-e08a945a1751 <at> yandex.ru>
and subject line Re: bug#41572: 28.0.50; [PATCH] Support plain project marked with file .emacs-project
has caused the debbugs.gnu.org bug report #41572,
regarding 28.0.50; [PATCH] Support plain project marked with file .emacs-project
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
41572: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41572
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Zhu Zihao <cjpeople2013 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; [PATCH] Support plain project marked with file .emacs-project
Date: Thu, 28 May 2020 11:32:04 +0800
[Message part 3 (text/plain, inline)]
This patch add support for "plain project" in project.el. Plain project is a
kind of project without any VC backend but should be.

To mark a directoy as project, put an empty magic file .emacs-project under
the
directory, and project.el should be responsible for it.

~~~~

From cb0a67cfacf141a8b1955c08c3f459bcac801a39 Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last <at> 163.com>
Date: Thu, 28 May 2020 11:04:44 +0800
Subject: [PATCH] Support plain project marked with file .emacs-project

* lisp/progmodes/project.el (project-try-plain): New function
* lisp/progmodes/project.el (project-root): New dispatch variants
* lisp/progmodes/project.el (project-find-functions): Add project-try-plain
---
 lisp/progmodes/project.el | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 88f73e4fb31..4c1810aeb56 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -94,7 +94,7 @@

 (require 'cl-generic)

-(defvar project-find-functions (list #'project-try-vc)
+(defvar project-find-functions (list #'project-try-plain #'project-try-vc)
   "Special hook to find the project containing a given directory.
 Each functions on this hook is called in turn with one
 argument (the directory) and should return either nil to mean
@@ -194,6 +194,18 @@ project-files
    (or dirs
        (list (project-root project)))))

+(defun project-try-plain (dir)
+  "Return the plain project instance of current DIR.
+
+A directory with magic file \".emacs-project\" will be recognized as
+plain project."
+  (pcase (locate-dominating-file dir ".emacs-project")
+    (`nil nil)
+    (root (cons 'plain root))))
+
+(cl-defmethod project-root ((project (head plain)))
+  (cdr project))
+
 (defun project--files-in-directory (dir ignores &optional files)
   (require 'find-dired)
   (require 'xref)
-- 
2.26.2
[Message part 4 (text/html, inline)]
[Message part 5 (message/rfc822, inline)]
From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: philipk <at> posteo.net, rudi <at> constantly.at, eric <at> ericabrahamsen.net,
 cjpeople2013 <at> gmail.com, theo <at> thornhill.no, mardani29 <at> yahoo.es,
 joaotavora <at> gmail.com, 41572-done <at> debbugs.gnu.org, manuel.uberti <at> inventati.org,
 juri <at> linkov.net, salutis <at> me.com, arstoffel <at> gmail.com
Subject: Re: bug#41572: 28.0.50; [PATCH] Support plain project marked with
 file .emacs-project
Date: Thu, 1 Dec 2022 04:19:47 +0200
Version: 29.1

On 30/11/2022 22:43, Dmitry Gutov wrote:
>>
>> This is a significant change of the implementation of a public API.  
>> Isn't
>> it risky to make such changes on the release branch?
>>
>> But if you are okay with that, it's fine by me.
> 
> A little bit, yeah. But I've done some dogfooding, and we have a couple 
> of months before the release, right?

And now pushed to emacs-29.

Looks like time to close this bug (and the merged one). The new user 
option project-vc-extra-root-markers should cover the described use 
cases in both feature requests. The default is nil, though, so people 
will need to customize.

Not every idea from this discussion has made it in, but we can get back 
to them later.


This bug report was last modified 2 years and 170 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.