This commit is contained in:
Clay 2025-07-19 18:13:06 +00:00 committed by GitHub
commit 8d78ba7f7d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -49,7 +49,7 @@
"Micromamba (environment manager) integration for Emacs." "Micromamba (environment manager) integration for Emacs."
:group 'python) :group 'python)
(defcustom micromamba-executable (executable-find "micromamba") (defcustom micromamba-executable (executable-find "micromamba" 1)
"Path to micromamba executable." "Path to micromamba executable."
:type 'string :type 'string
:group 'micromamba) :group 'micromamba)
@ -94,7 +94,9 @@ Pass ARGS as arguments to the program."
(unless micromamba-executable (unless micromamba-executable
(user-error "Micromamba-executable is not set!")) (user-error "Micromamba-executable is not set!"))
(with-temp-buffer (with-temp-buffer
(apply #'call-process micromamba-executable nil t nil args) (if (file-remote-p default-directory)
(shell-command (mapconcat #'shell-quote-argument (cons micromamba-executable args) " ") (current-buffer))
(apply #'call-process micromamba-executable nil t nil args))
(goto-char (point-min)) (goto-char (point-min))
(json-read))) (json-read)))
@ -228,8 +230,13 @@ Return `micromamba-fallback-environment' if not found."
The parameters value is an alist as defined by The parameters value is an alist as defined by
`micromamba--parse-script-buffer'." `micromamba--parse-script-buffer'."
(with-temp-buffer (with-temp-buffer
(call-process micromamba-executable nil t nil (if (file-remote-p default-directory)
"shell" "activate" prefix "-s" "bash") (shell-command
(concat micromamba-executable " shell"
" activate " prefix " -s" " bash")
(current-buffer))
(call-process micromamba-executable nil t nil
"shell" "activate" prefix "-s" "bash"))
(goto-char (point-min)) (goto-char (point-min))
(micromamba--parse-script-buffer))) (micromamba--parse-script-buffer)))
@ -239,8 +246,15 @@ The parameters value is an alist as defined by
The parameters value is an alist as defined by The parameters value is an alist as defined by
`micromamba--parse-script-buffer'." `micromamba--parse-script-buffer'."
(with-temp-buffer (with-temp-buffer
(call-process micromamba-executable nil t nil (if (file-remote-p default-directory)
"shell" "deactivate" "-s" "bash") (shell-command
(concat micromamba-executable " run"
" micromamba" " shell"
" deactivate" " -s" " bash")
(current-buffer))
(call-process micromamba-executable nil t nil
"shell" "deactivate" "-s" "bash"))
(goto-char (point-min)) (goto-char (point-min))
(micromamba--parse-script-buffer))) (micromamba--parse-script-buffer)))