emacs-devel
[Top][All Lists]
Advanced

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

Re: Unified project interface


From: Dmitry Gutov
Subject: Re: Unified project interface
Date: Sat, 11 Jul 2015 17:17:50 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0

On 07/11/2015 04:43 PM, Bozhidar Batsov wrote:
I finally took a quick look at the current code (and the discussion so
far) and I have a few remarks:

* even within source directories it's useful to be able to exclude
certain subdirs from project-level operations. How is this going to be
handled?

A new function (or two?) will be needed for that. Is there a particular reason Projectile has both ignored-directories and ignored-files?

I'm also undecided on what it (or they) should return. Should that be just a list of shell globs? That would integrate fine with grep-find.

It also has both grep-find-ignored-directories and grep-find-ignored-directories. I wonder if that was done for performance.

* it's not 100% clear to me what are major mode writes supposed to
provide as "project implementations"

major modes aren't really supposed to. Since the current project is dependent on the directory and not a specific files, it's best left to minor modes.

An implementation is a new project-find-functions element and a set of cl-defmethod forms to go with it. Maybe also a cl-struct definition for the project structure, but as you can see from the current project.el contents, you can do without it.

* In 24.4 a `vc-root-dir` was added. Seems it overlaps a bit with
`project.el`

Only if the project is based on VC. As you can see project-try-vc uses that backend action, if not the function itself.

* how can Projectile (or a similar package) leverage `project.el`?

Do something along these lines:

(defun project-try-projectile ()
  (when (projectile-project-root) 'projectile)

(add-hook 'project-find-functions #'project-try-projectile)

(cl-defmethod project-root (project (eql projectile))
  (projectile-project-root))

...and so on.

The first difficulty will be that cl-generic (and hence, cl-defmethod) are unavailable in the previous Emacs versions. Maybe put all this in a separate file and (require ...) it conditionally on the Emacs version.




reply via email to

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