Skip to content

Commit

Permalink
Fix for Issue pythonic-emacs#48: Changed the black executable from a …
Browse files Browse the repository at this point in the history
…string to a list to allow 'python -m black' to be used instead of just 'black' for the executable name. This is because black as a standalong executable is not something that is typically supported on windows, but the python module invocation always works, and the zombie processes that were using up file handles for Issue 48 was due to the make-process function failing when it couldn't find a black executable. Changing blacken-executable to the list fixes this problem (assuming the black module is installed).
  • Loading branch information
Stephen Broberg committed Apr 3, 2024
1 parent 526702e commit 0edc85c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion blacken.el
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@
"Name of the executable to run."
:type 'string)

(defcustom blacken-executable-list '(blacken-executable)
"Command (with extra arguments) to invoke black"
:type '(repeat string))

(defcustom blacken-line-length nil
"Line length to enforce.
Expand Down Expand Up @@ -92,7 +96,7 @@ output to OUTPUT-BUFFER. Saving process stderr to ERROR-BUFFER.
Return black process the exit code."
(with-current-buffer input-buffer
(let ((process (make-process :name "blacken"
:command `(,blacken-executable ,@(blacken-call-args))
:command `(,@blacken-executable-list ,@(blacken-call-args))
:buffer output-buffer
:stderr error-buffer
:connection-type 'pipe
Expand Down

0 comments on commit 0edc85c

Please sign in to comment.