emacs-devel
[Top][All Lists]
Advanced

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

Re: Unified project interface


From: Bozhidar Batsov
Subject: Re: Unified project interface
Date: Mon, 13 Jul 2015 11:49:21 +0300

On 11 July 2015 at 17:17, Dmitry Gutov <address@hidden> wrote:
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.

Might have been an oversight on my part. Right now nothing comes to mind and I'll have to consult the source to remember. Originally there was only
the option to ignore folders, this much I remember. 
 


* 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.

e.g. Rails mode or something like this?
 

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.'

Yeah, backward compatibility is problematic. I guess those can't be backported to the `cl-lib` package in ELPA? 


reply via email to

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