aboutsummaryrefslogtreecommitdiffstats
path: root/emacs/.emacs.d
diff options
context:
space:
mode:
authorGravatar Tom Willemse2016-08-06 20:36:08 +0200
committerGravatar Tom Willemse2016-08-06 20:36:08 +0200
commit27e1b90637e9d11c9404d8a8b86015fcd681d9d6 (patch)
tree213e740b2c9c6007813a6f232b36ef763a2f96b5 /emacs/.emacs.d
parented329adacd999b675b9cef387a2456c7f1c3c219 (diff)
downloadnew-dotfiles-27e1b90637e9d11c9404d8a8b86015fcd681d9d6.tar.gz
new-dotfiles-27e1b90637e9d11c9404d8a8b86015fcd681d9d6.zip
Add flycheck configuration
Diffstat (limited to 'emacs/.emacs.d')
-rw-r--r--emacs/.emacs.d/init.org51
1 files changed, 51 insertions, 0 deletions
diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org
index 6a7e5f1..7f0122f 100644
--- a/emacs/.emacs.d/init.org
+++ b/emacs/.emacs.d/init.org
@@ -350,6 +350,51 @@ To start off, first I need to enable lexical binding.
(add-hook 'electric-indent-local-mode-hook #'oni:switch-newline-keys)
#+END_SRC
+** Flycheck
+
+ Flycheck lets me see (compiler) errors, warnings and info messages
+ while writing code.
+
+ #+BEGIN_SRC emacs-lisp
+ (ensure-library flycheck)
+ #+END_SRC
+
+ When developing packages with Cask, some special care needs to be
+ taken to ensure the checkers work correctly.
+
+ #+BEGIN_SRC emacs-lisp
+ (ensure-library flycheck-cask)
+ (add-hook 'flycheck-mode-hook 'flycheck-cask-setup)
+ #+END_SRC
+
+ I disable the pylint and pyflakes checkers because they don't seem
+ to add much except noise when used together with flake8. Also
+ pylint seems hell-bent on making Python written like a
+ statically-typed langauge.
+
+ #+BEGIN_SRC emacs-lisp
+ (with-eval-after-load 'flycheck
+ (mapc (lambda (c) (delq c flycheck-checkers))
+ '(python-pylint python-pyflakes)))
+ #+END_SRC
+
+ Also show which columns messages appear in.
+
+ #+BEGIN_SRC emacs-lisp
+ (with-eval-after-load 'flycheck
+ (setq flycheck-highlighting-mode 'columns))
+ #+END_SRC
+
+ Show the error message at point in a tooltip.
+
+ #+BEGIN_SRC emacs-lisp
+ (ensure-library flycheck-pos-tip)
+
+ (with-eval-after-load 'flycheck
+ (require 'flycheck-pos-tip)
+ (flycheck-pos-tip-mode))
+ #+END_SRC
+
* Major modes
** Emacs lisp mode
@@ -455,6 +500,12 @@ To start off, first I need to enable lexical binding.
(add-hook 'python-mode-hook 'electric-pair-local-mode)
#+END_SRC
+ Enable syntax and style checking with flycheck.
+
+ #+BEGIN_SRC emacs-lisp
+ (add-hook 'python-mode-hook 'flycheck-mode)
+ #+END_SRC
+
* Applications
** Magit