[Top][All Lists]

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

Re: project-mode vs projectile (Was: How to profile restoring from .emac

From: Dmitry Gutov
Subject: Re: project-mode vs projectile (Was: How to profile restoring from .emacs.desktop)
Date: Sun, 27 Jun 2021 03:20:42 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0


Sorry for the late reply.

On 19.06.2021 12:02, Steinar Bang wrote:

And it's grown again a bit in Emacs 28, with a global keymap and a set
of project-scoped commands in it, among other things.

Most importantly, you can install the latest version of project.el
inside Emacs 26 or 27 from GNU ELPA.

Maybe it is time for me to try project-mode out again, then?

First of all, it's not a mode. A recent enough version of project.el just installs a global keymap and lets you use its bindings.

One advantage is it doesn't run any code (e.g. root-finding code) until you actually use one of the related commands.

Is there an overview on what kind of commands are available in the emacs
28 project-mode?

'C-x p C-h' should give you a reasonably complete list.

By this time I have about 6 months of actively using projectile (once I
got the startup issues cleared away and using the cache instead), and
I've quite grown to like it.

I've used it for years, it's a handy package. project.el started out as a kind of backdoor to be able to use projectile indirectly in core Emacs commands. That still hasn't panned out exactly, but I'm hopeful on that front too.

I have replaced navigating with switch-to-buffer with the
projectile-find-file file command, and switch between projects with
projectile-switch-open-project command and find a directory with the
projectile-find-dir command (the find file and find dir commands stay
within a project).

There is still no 'project-find-dir' command, but we should add one. There is a related bug report somewhere in debbugs.

Other useful commands:
  - projectile-grep which rgreps inside a project useful
  - projectile-compile-project (very useful for maven projects, where the
    mvn command must be run at the top directory of the project far from
    the file being edited)
  - projectile-find-tag (very useful, once I was able to make CTAGS
    recognize ES6 javascript)

There are counterparts to the first two, but what does the last one do? It's it basically the same as xref-find-definitions?

What I'm missing are commands that do the same thing as the project
level commands for project modules, in particular for maven multi-module

The most important command to get a module command for is the compile
command (because building a single module takes a lot less time than
building the entire reactor build), but module specific search and
navigate commands would also be useful.

Does project-mode have a concept of modules? (the maven concept of
modules is what's in my mind)

No concept of modules as such (though there is a defcustom to decide whether to treat "git submodules" as separate projects, but those are different kind of modules).

If you want some dedicated support, we'll need to clarify the requirements. For instance, would you be happy if mvn modules were treated as separate projects? I think that leaves only the "module compile command", and that seems somewhat maven-specific. You could create a new command which would look up what kind of project the current file is in, and invoke some corresponding action.

Or if you want project-compile to provide different behaviors, what would it do? Perhaps you'd want to customize compilation-read-command instead?

reply via email to

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