[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Subprojects in project.el
From: |
João Távora |
Subject: |
Re: Subprojects in project.el |
Date: |
Tue, 29 Nov 2022 10:17:59 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Dmitry Gutov <dgutov@yandex.ru> writes:
>> Hysterical raisins.
>>
>> But 'C-x p f' and 'C-x p g' call 'project-current' directly. What's
>> that about some new command?
> Don't know what you are talking aboutIt seems very reasonable to do
> this instead:
>diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
>index c7b2c386ccd..02f5d25e054 100644
>--- a/lisp/progmodes/project.el
>+++ b/lisp/progmodes/project.el
>@@ -1151,11 +1151,11 @@ project-compilation-buffer-name-function
> (function :tag "Custom function")))
>
> ;;;###autoload
>-(defun project-compile ()
>+(defun project-compile (project)
> "Run `compile' in the project root."
> (declare (interactive-only compile))
>- (interactive)
>- (let ((default-directory (project-root (project-current t)))
>+ (interactive (project-current t))
Sorry I hit "send" before I wanted to. This line of course be
(interactive (list (project-current t)))
And the docstring should be
"Run `compile' in PROJECT's root."
'project-current', when called with MAYBE-PROMPT, is running in an
interactive setting. It could then consult the value of the prefix
argument and decide to prompt the user about which project to use
(including super-projects).
You can use this technique to a add PROJECT argument to all the other
relevant project-* operations without breaking backward compatibility,
even for non-interactive Lisp uses.
In cases where a "P" prefix argument is already in use, like C-x p f,
we'd have to repurpose the "negative prefix" part to _not_ mean
INCLUDE-ALL. You'd affect only the people who are currently using M--
C-x p f instead of C-u C-x p f.
João
- Re: Subprojects in project.el, (continued)
- Re: Subprojects in project.el, João Távora, 2022/11/25
- Re: Subprojects in project.el, Dmitry Gutov, 2022/11/25
- Re: Subprojects in project.el, João Távora, 2022/11/25
- Re: Subprojects in project.el, Dmitry Gutov, 2022/11/25
- Re: Subprojects in project.el, João Távora, 2022/11/26
- Re: Subprojects in project.el, Dmitry Gutov, 2022/11/26
- Re: Subprojects in project.el, João Távora, 2022/11/29
- Re: Subprojects in project.el,
João Távora <=
- Re: Subprojects in project.el, Dmitry Gutov, 2022/11/29
- Re: Subprojects in project.el, João Távora, 2022/11/29
- Re: Subprojects in project.el, Dmitry Gutov, 2022/11/29
- Re: Subprojects in project.el, Juri Linkov, 2022/11/27
- Re: Subprojects in project.el, Dmitry Gutov, 2022/11/27
- Re: Subprojects in project.el (Was: Eglot, project.el, and python virtual environments), Tim Cross, 2022/11/24
- Re: Subprojects in project.el (Was: Eglot, project.el, and python virtual environments), Dmitry Gutov, 2022/11/24
- Re: Subprojects in project.el (Was: Eglot, project.el, and python virtual environments), Bozhidar Batsov, 2022/11/25
- Re: Subprojects in project.el, Stefan Monnier, 2022/11/25
- Re: Subprojects in project.el, Dmitry Gutov, 2022/11/25