From 63b29ff98c4914ab55d828146e44d318cc8c0b62 Mon Sep 17 00:00:00 2001 From: Manuel Uberti 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