File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,16 @@ Will be matched case-insensitively."
6565 :type '(repeat regexp)
6666 :group 'mason )
6767
68+ (defcustom mason-command-overrides '()
69+ " Alist of command and its path to be used in `mason--process' .
70+ This in turn will be used instead of resolving from `exec-path' .
71+
72+ Example:
73+ ;; Use python from ~/.local/bin instead of /usr/bin.
74+ (setq mason-command-overrides `'' ((\" python\" . \" ~/.local/bin/python\" )))"
75+ :type '(alist :key-type string :value-type string)
76+ :group 'mason )
77+
6878
6979; ; Keybinds
7080
@@ -191,9 +201,11 @@ CWD is the working directory.
191201THEN is a function to call after process succeed.
192202THEN needs to accept a parameter, indicating if the process succeeded."
193203 (declare (indent defun ))
194- (let ((prog (car cmd))
195- (msg (mapconcat #'mason--quote cmd " " ))
196- (process-environment process-environment))
204+ (let* ((prog (car cmd))
205+ (prog (or (cdr (assoc-string prog mason-command-overrides)) prog))
206+ (cmd (cons prog (cdr cmd)))
207+ (msg (mapconcat #'mason--quote cmd " " ))
208+ (process-environment process-environment))
197209 (when env
198210 (dolist (e (nreverse env))
199211 (let ((k (car e)) (v (cdr e)))
You can’t perform that action at this time.
0 commit comments