diff options
author | Matthew Lemon <lemon@matthewlemon.com> | 2019-12-27 16:52:00 +0000 |
---|---|---|
committer | Matthew Lemon <lemon@matthewlemon.com> | 2019-12-27 16:52:00 +0000 |
commit | f6edf59da6eb6015ccdb94496a64b5c1cc05aefe (patch) | |
tree | f222d12a242c74693ac8b5f9ba1731527b22aeb5 | |
parent | 84b25b7e38e36becb29c56fa9f58f56717f2d814 (diff) |
python tweaks including fixing escape codes in compilation buffer
-rw-r--r-- | init.el | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -706,11 +706,11 @@ :config (add-hook 'elpy-mode-hook 'py-autopep8-enable-on-save) (setq elpy-rpc-python-command "python3") - (setq python-shell-interpreter "ptipython" + (setq python-shell-interpreter "python3" python-shell-interpreter-args "console --simple-prompt" python-shell-prompt-detect-failure-warning nil) (add-to-list 'python-shell-completion-native-disabled-interpreters - "ptipython") + "python3") (when (require 'flycheck nil t) (setq elpy-modules (delq 'elpy-module-flymake elpy-modules)) @@ -721,6 +721,15 @@ ("C-c ESC t" . python-pytest-popup) ) +;; need this code to fix escape codes in compilation buffer +;; (when running elpy test, for example) +;; from https://stackoverflow.com/questions/3072648/cucumbers-ansi-colors-messing-up-emacs-compilation-buffer +(set-frame-font)(require 'ansi-color) +(defun colorize-compilation-buffer () + (let ((inhibit-read-only t)) + (ansi-color-apply-on-region (point-min) (point-max)))) +(add-hook 'compilation-filter-hook 'colorize-compilation-buffer) + ;; Go programming (use-package lsp-mode :hook (go-mode . lsp-deferred) |