Variable: project-switch-commands

project-switch-commands is a customizable variable defined in project.el.gz.

Value

((project-find-file "Find file") (project-find-regexp "Find regexp")
 (project-find-dir "Find directory") (project-vc-dir "VC-Dir")
 (project-eshell "Eshell") (project-any-command "Other")
 (magit-project-status "Magit"))

Documentation

Alist mapping commands to descriptions.

Used by project-switch-project to construct a dispatch menu of commands available upon "switching" to another project.

Each element is of the form (COMMAND LABEL &optional KEY) where COMMAND is the command to run when KEY is pressed. LABEL is used to distinguish the menu entries in the dispatch menu. If KEY is absent, COMMAND must be bound in project-prefix-map, and the key is looked up in that map.

The value can also be a symbol, the name of the command to be invoked immediately without any dispatch menu.

This variable was added, or its default value changed, in project version 0.6.0.

View in manual

Probably introduced at or before Emacs version 30.1.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/project.el.gz
;;; Project switching

(defcustom project-switch-commands
  '((project-find-file "Find file")
    (project-find-regexp "Find regexp")
    (project-find-dir "Find directory")
    (project-vc-dir "VC-Dir")
    (project-eshell "Eshell")
    (project-any-command "Other"))
  "Alist mapping commands to descriptions.
Used by `project-switch-project' to construct a dispatch menu of
commands available upon \"switching\" to another project.

Each element is of the form (COMMAND LABEL &optional KEY) where
COMMAND is the command to run when KEY is pressed.  LABEL is used
to distinguish the menu entries in the dispatch menu.  If KEY is
absent, COMMAND must be bound in `project-prefix-map', and the
key is looked up in that map.

The value can also be a symbol, the name of the command to be
invoked immediately without any dispatch menu."
  :version "28.1"
  :group 'project
  :package-version '(project . "0.6.0")
  :type '(choice
          (repeat :tag "Commands menu"
           (list
            (symbol :tag "Command")
            (string :tag "Label")
            (choice :tag "Key to press"
                    (const :tag "Infer from the keymap" nil)
                    (character :tag "Explicit key"))))
          (const :tag "Use both short keys and global bindings"
                 project-prefix-or-any-command)
          (symbol :tag "Custom command")))