Skip to content

Commit

Permalink
Allow users to specify the path to autopep8
Browse files Browse the repository at this point in the history
Original PR: paetzke#25
  • Loading branch information
Benoit Coste committed Jul 21, 2018
1 parent bb7449f commit b13fb95
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions autopep8-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,21 @@ Note that `--in-place' is used by default."
:group 'autopep8
:type '(repeat (string :tag "option")))

(defcustom autopep8-command "autopep8"
"The command used to invoke autopep8."
:group 'autopep8
:type 'string)

(defun autopep8--call-executable (errbuf file)
(zerop (apply 'call-process "autopep8" nil errbuf nil
(zerop (apply 'call-process autopep8-command nil errbuf nil
(append autopep8-options `("--in-place", file)))))


;;;###autoload
(defun autopep8-buffer ()
"Uses the \"autopep8\" tool to reformat the current buffer."
(interactive)
(autopep8-bf--apply-executable-to-buffer "autopep8"
(autopep8-bf--apply-executable-to-buffer autopep8-command
'autopep8--call-executable
nil
"py"))
Expand Down

0 comments on commit b13fb95

Please sign in to comment.