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

From: "Basil L. Contovounesios" <[email-masked]>
Date: Tue, 16 Jun 2020 19:14:37 +0100

Theodor Thornhill <[email-masked]> writes:

> +(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)

This should be:

  (defvar project-prefix-map
    (let ((map (make-sparse-keymap)))
      (define-key map ...)
      ...
      map)
    "...")

  (define-key ctl-x-map "p" project-prefix-map)

See the end of (info "(elisp) Tips for Defining").

Maybe it should also be autoloaded.

Thanks,
      
-- 
Basil