I'd like to configure Emacs to play an audible noise when saving my
.py files but only if there is a linting error present.
I currently have flycheck linting done on the fly and autopep8 settings applied on saving with the following configuration...
;; Use flycheck rather than flymake with elpy (when (require 'flycheck nil t) (setq elpy-modules (delq 'elpy-module-flymake elpy-modules)) (add-hook 'elpy-mode-hook 'flycheck-mode)) (add-hook 'python-mode-hook (lambda () (setq flycheck-python-pylint-executable "~/.virtualenvs/dskit/bin/pylint") (setq flycheck-pylintrc "~/.emacs.d/settings/.pylintrc"))) ;; enable autopep8 formatting on save (require 'py-autopep8) (add-hook 'elpy-mode-hook 'py-autopep8-enable-on-save)
...and was thinking that a hook added to
'py-autopep8-enable-on-save might be the way forward, but am still on the starting slopes of the Lisp learning curve and would appreciate any pointers or suggestions.