unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#54228: 29.0.50; project.el: Support local projects
@ 2022-03-03  7:15 Manuel Uberti via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-03-03 12:36 ` Rudolf Schlatte
  2022-03-04 17:48 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 2 replies; 7+ messages in thread
From: Manuel Uberti via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-03-03  7:15 UTC (permalink / raw)
  To: 54228

[-- Attachment #1: Type: text/plain, Size: 379 bytes --]

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

[-- Attachment #2: 0001-Support-local-projects.patch --]
[-- Type: text/x-patch, Size: 1245 bytes --]

From 63b29ff98c4914ab55d828146e44d318cc8c0b62 Mon Sep 17 00:00:00 2001
From: Manuel Uberti <manuel.uberti@inventati.org>
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"))
+
 \f
 ;;; Project commands
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-03-05 16:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-03  7:15 bug#54228: 29.0.50; project.el: Support local projects Manuel Uberti via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-03-03 12:36 ` Rudolf Schlatte
2022-03-04 17:48 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-03-04 18:15   ` Manuel Uberti via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-03-05  1:31     ` Dmitry Gutov
2022-03-05  7:42       ` Manuel Uberti via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-03-05 16:15   ` Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).