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
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4