-
Hi. The binding Is there any alternative besides simply using This is the relevant code in magit extras: ;;;###autoload
(defun magit-project-status ()
"Run `magit-status' in the current project's root."
(interactive)
(magit-status-setup-buffer (project-root (project-current t))))
(defvar magit-bind-magit-project-status t
"Whether to bind \"m\" to `magit-project-status' in `project-prefix-map'.
If so, then an entry is added to `project-switch-commands' as
well. If you want to use another key, then you must set this
to nil before loading Magit to prevent \"m\" from being bound.")
(with-eval-after-load 'project
;; Only more recent versions of project.el have `project-prefix-map' and
;; `project-switch-commands', though project.el is available in Emacs 25.
(when (and magit-bind-magit-project-status
(boundp 'project-prefix-map)
;; Only modify if it hasn't already been modified.
(equal project-switch-commands
(eval (car (get 'project-switch-commands 'standard-value))
t)))
(define-key project-prefix-map "m" #'magit-project-status)
(add-to-list 'project-switch-commands '(magit-project-status "Magit") t))) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Since the command is autoloaded you can just add |
Beta Was this translation helpful? Give feedback.
-
This is only tangentially related to this issue, but I have a question here. Would it make sense to wrap the Technically, such a change would be a change in behavior, because changing the |
Beta Was this translation helpful? Give feedback.
Since the command is autoloaded you can just add
(define-key project-prefix-map "m" #'magit-project-status)
to your init file.