emacs-devel
[Top][All Lists]
Advanced

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

Re: A project-files implementation for Git projects


From: Stefan Monnier
Subject: Re: A project-files implementation for Git projects
Date: Fri, 06 Sep 2019 08:52:50 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> (cl-defmethod project-files ((project (head vc)) &optional dirs)
>   "Implementation of `project-files' for Git projects."
>   (cl-mapcan
>    (lambda (dir)
>      (if-let ((git (and (file-exists-p
>                          (expand-file-name ".git/config" dir))
>                         (executable-find "git"))))

Since it's a handler for `vc` it should handle all VC backends.  To do
that, it can simply use the `vc-call-backend` mechanism, so the
Git-specific code can be put inside vc-git and you can have a generic
implementation that does just the `cl-call-next-method`.


        Stefan




reply via email to

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