emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#41572: closed (28.0.50; [PATCH] Support plain project marked with fi


From: GNU bug Tracking System
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

Your message dated Thu, 1 Dec 2022 04:19:47 +0200
with message-id <9a66f6fc-c08b-02b3-7780-e08a945a1751@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@gnu.org.)


-- 
41572: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41572
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: 28.0.50; [PATCH] Support plain project marked with file .emacs-project Date: Thu, 28 May 2020 11:32:04 +0800

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@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




--- End Message ---
--- Begin Message --- 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 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2
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.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]