From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Steinar Bang Newsgroups: gmane.emacs.help Subject: Re: project-mode vs projectile Date: Sun, 05 Sep 2021 13:35:49 +0200 Message-ID: <86sfyjl0fe.fsf@dod.no> References: <864kj2nw2s.fsf@dod.no> <86v9bhlzky.fsf@dod.no> <86o8h8n165.fsf@dod.no> <865yyady70.fsf_-_@dod.no> <2d559b9c-8466-a3d9-bd24-78e2a64c03ca@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35152"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (windows-nt) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 05 13:36:28 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mMqRn-0008sN-6v for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 05 Sep 2021 13:36:27 +0200 Original-Received: from localhost ([::1]:50550 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMqRl-0000ZR-Kd for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 05 Sep 2021 07:36:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57072) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMqRK-0000ZI-Rl for help-gnu-emacs@gnu.org; Sun, 05 Sep 2021 07:35:58 -0400 Original-Received: from cadalora.default.sbang.uk0.bigv.io ([2001:41c9:1:424::90]:39968) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMqRI-00027A-OB for help-gnu-emacs@gnu.org; Sun, 05 Sep 2021 07:35:58 -0400 Original-Received: from mccoy (unknown [84.210.87.211]) by cadalora.default.sbang.uk0.bigv.io (Postfix) with ESMTPSA id 6ABD8CD3BD for ; Sun, 5 Sep 2021 12:35:53 +0100 (BST) In-Reply-To: <2d559b9c-8466-a3d9-bd24-78e2a64c03ca@yandex.ru> (Dmitry Gutov's message of "Sun, 27 Jun 2021 03:20:42 +0300") Received-SPF: none client-ip=2001:41c9:1:424::90; envelope-from=sb@dod.no; helo=cadalora.default.sbang.uk0.bigv.io X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:132895 Archived-At: >>>>> Dmitry Gutov : > 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. Hm... ok. I've seen some bindings mentioned in a google hit, but when I tried using them on emacs 27 (I don't have a reference to the google hit handy). Is this for emacsen newer than 27.1? > One advantage is it doesn't run any code (e.g. root-finding code) > until you actually use one of the related commands. An advantage in performance? I don't know what projectile does here, but I suspect that, with the correct configuration (which is *not*, as I found, "scan everything on startup"...), projectile doesn't do much either, until the commands are used. >> 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. I get "C-x p is undefined" on emacs 27.1, so I guess I need something newer than that? > 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. Hm... are you saying project.el and projectile are releated somehow? Up until reading the above I had been thinking they were two implementations of similar functionality, with project.el being the native emacs version? [snip!] >> 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? I've never used xref-find-definitions, but from the description it looks to be the same. [snip1] >> 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 Ok. > (though there is a defcustom to decide whether to treat "git > submodules" as separate projects, but those are different kind of > modules). Yes. Maven modules have the same form as the entire maven project they are part of. And they can be run separately by cd'ing into the module diretory and running the mvn build command (if their dependencies are fulfilled). > 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? Ideally I would like the project level commands to remain as they are. But I would like to have a similar set of commands that operate on the specified module only (search, replace, build, at least). And maybe a simple way to navigate to a specified module. > 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. What I currently do, is have a text file in each project, not commited to git, and containing canned commands for building each project. And then I just go to that file, copy them, and then feed them to "M-x compile" to build a specific project. But this is cumbersome, and error prone (I have may times built the wrong module and not understood why my changes weren't showing up) and cd followed by a command, doesn't work on windows emacs. Here's an example of such a text file: cd ~/workspaces/sampleapp/sampleapp.web.frontend/; mvn -B install -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true cd ~/workspaces/sampleapp/sampleapp.db.liquibase.test/; mvn -B install -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true cd ~/workspaces/sampleapp/sampleapp.backend/; mvn -B install -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true cd ~/workspaces/sampleapp/sampleapp.web.api/; mvn -B install -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true > Or if you want project-compile to provide different behaviors, what > would it do? Perhaps you'd want to customize compilation-read-command > instead? No, I think what I would like to see, is a concept of "current-module" (e.g. based on the currently visisted file or directory) and then a module-compile command Thanks for responding! :-) - Steinar