You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When editing other people's code, I would like to disable the hook on a per buffer basis so I don't change their whitespace or other aspects of their code.
Are you open to a change like this in py-autopep8.el?
;;;###autoload
(defun py-autopep8-enable-on-save ()
"Pre-save hook to be used before running autopep8."
(interactive)
(if current-prefix-arg
(progn
(remove-hook 'before-save-hook 'py-autopep8-buffer t)
(message "py-autopep8-buffer removed"))
(add-hook 'before-save-hook 'py-autopep8-buffer nil t)))
I can create a pull request if so, otherwise, I am open to your preferences...
Thanks
The text was updated successfully, but these errors were encountered:
Formatting on save first calls py-autopep8-on-save-p which you can configure to a function (defaulting to 'always).
There is an included function 'py-autopep8-check-pyproject-exists-with-autopep8 that only auto-formats when you have autopep8 configured for the project. But if you want to check something else you can set this to your own function.
When editing other people's code, I would like to disable the hook on a per buffer basis so I don't change their whitespace or other aspects of their code.
Are you open to a change like this in py-autopep8.el?
I can create a pull request if so, otherwise, I am open to your preferences...
Thanks
The text was updated successfully, but these errors were encountered: