Subject: bug#41890: 28.0.50; [PATCH]: Add bindings for project.el

From: Theodor Thornhill <[email-masked]>
Date: Tue, 16 Jun 2020 17:30:25 +0000

Hello,

"Eli Zaretskii" <[email-masked]> writes:

[...]
> I certainly would.  It is very unusual for an optional package to have
> its bindings in files that are preloaded into every Emacs session.
>

Ok! I attached a new patch with them placed in project.el. Also cc'd Dmitry so he can chime in. Maybe we should do it more customizable?

[...]
> Well, if there's no progress within a week or two, my suggestion still
> stands.
Will definitely do :)

> Thanks.
Thank you!

Theodor

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index f3df44fa7b..7bb3831647 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -107,6 +107,21 @@ project-find-functions
 (defvar project-current-inhibit-prompt nil
   "Non-nil to skip prompting the user in `project-current'.")
 
+(defvar project-prefix-map (make-sparse-keymap)
+  "Keymap for project commands.")
+
+(define-key ctl-x-map "p" project-prefix-map)
+(define-key project-prefix-map "f" 'project-find-file)
+(define-key project-prefix-map "b" 'project-switch-to-buffer)
+(define-key project-prefix-map "s" 'project-shell)
+(define-key project-prefix-map "d" 'project-dired)
+(define-key project-prefix-map "v" 'project-vc-dir)
+(define-key project-prefix-map "c" 'project-compile)
+(define-key project-prefix-map "e" 'project-eshell)
+(define-key project-prefix-map "p" 'project-switch-project)
+(define-key project-prefix-map "g" 'project-find-regexp)
+(define-key project-prefix-map "r" 'project-query-replace-regexp)
+
 ;;;###autoload
 (defun project-current (&optional maybe-prompt dir)
   "Return the project instance in DIR or `default-directory'.