Subject: bug#54228: closed (Re: bug#41572: 28.0.50; [PATCH] Support plain project marked with file .emacs-project)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 01 Dec 2022 02:21:03 +0000

Your bug report

#41572: 29.0.50; project.el: Support local projects

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
41572: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41572
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#41572: 28.0.50; [PATCH] Support plain project marked with file .emacs-project
From: Dmitry Gutov <[email-masked]>
To: Eli Zaretskii <[email-masked]>
Cc: [email-masked], [email-masked], [email-masked], [email-masked], [email-masked], [email-masked], [email-masked], [email-masked], [email-masked], [email-masked], [email-masked], [email-masked]
Date: Thu, 1 Dec 2022 04:19:47 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

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.

Subject: 29.0.50; project.el: Support local projects
From: Manuel Uberti <[email-masked]>
To: [email-masked]
Date: Thu, 3 Mar 2022 08:15:06 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

I attached a small patch which simply adds to project.el some code I
have been using for a while for projects that I do not intend to handle with Git.

The gist of it is that adding a `.project` (empty) file to the root
directory of your project make it possible for commands such as 'C-x p f' to 
work on it.

Is this of any interest?

-- 
Manuel Uberti
www.manueluberti.eu

From 63b29ff98c4914ab55d828146e44d318cc8c0b62 Mon Sep 17 00:00:00 2001
From: Manuel Uberti <[email-masked]>
Date: Thu, 3 Mar 2022 08:08:16 +0100
Subject: [PATCH] Support local projects

* lisp/progmodes/project.el (project-try-local):
New function.
(project-find-functions):
Use it.
---
 lisp/progmodes/project.el | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index b44f4618be..4f19e2aaf4 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -165,7 +165,8 @@ project
   :version "28.1"
   :group 'tools)
 
-(defvar project-find-functions (list #'project-try-vc)
+(defvar project-find-functions (list #'project-try-vc
+                                     #'project-try-local)
   "Special hook to find the project containing a given directory.
 Each functions on this hook is called in turn with one
 argument, the directory in which to look, and should return
@@ -680,6 +681,12 @@ project-buffers
         (push buf bufs)))
     (nreverse bufs)))
 
+(cl-defmethod project-root ((project string))
+  project)
+
+(defun project-try-local (dir)
+  (locate-dominating-file dir ".project"))
+
 
 ;;; Project commands
 
-- 
2.25.1