summaryrefslogtreecommitdiffstats
path: root/.emacs.d/init.org
diff options
context:
space:
mode:
authorGravatar Tom Willemsen2013-02-02 01:08:59 +0100
committerGravatar Tom Willemsen2013-02-02 01:08:59 +0100
commit9cd4c8ed8ca61df9a2839cb3b151b71f15c5e0a6 (patch)
treecbfa155a6e2bcbd19b23859dcc6d5fcde9def659 /.emacs.d/init.org
parent8fddc0d0a741ca8b77c08a6c8f33ce1ee6a5925e (diff)
downloaddotfiles-9cd4c8ed8ca61df9a2839cb3b151b71f15c5e0a6.tar.gz
dotfiles-9cd4c8ed8ca61df9a2839cb3b151b71f15c5e0a6.zip
emacs: Move flymake settings to init.org
Diffstat (limited to '.emacs.d/init.org')
-rw-r--r--.emacs.d/init.org77
1 files changed, 77 insertions, 0 deletions
diff --git a/.emacs.d/init.org b/.emacs.d/init.org
index 50a4161..5edf00e 100644
--- a/.emacs.d/init.org
+++ b/.emacs.d/init.org
@@ -129,6 +129,83 @@
(global-set-key (kbd "<XF86Tools>") 'oni:start-emms)
#+END_SRC
+ Load ~flymake-cursor~ after loading ~flymake~, add Python and Go to
+ "allowed" files and add go error output to error patterns.
+
+ #+BEGIN_SRC emacs-lisp :tangle init2.el
+ (defun oni:flymake-init ()
+ "Initialization function for flymake."
+ (require 'flymake-cursor)
+
+ (add-to-list ; Make sure pyflakes is loaded
+ 'flymake-allowed-file-name-masks ; for python files.
+ '("\\.py\\'" ext:flymake-pyflakes-init))
+
+ (add-to-list ; Error line repexp for go
+ 'flymake-err-line-patterns ; compilation.
+ '("^\\([a-zA-Z0-9_]+\\.go\\):\\([0-9]+\\):\\(.*\\)$"
+ 1 2 nil 3))
+
+ (add-to-list ; Go uses makefiles, makes
+ 'flymake-allowed-file-name-masks ; flymaking 'easy'.
+ '("\\.go$" flymake-simple-make-init)))
+
+ (eval-after-load "flymake" '(oni:flymake-init))
+ #+END_SRC
+
+ Disable the GUI for flymake errors, add a bunch of pep8, flymake
+ and pyflakes messages to warning and info patterns, set the log
+ file to somewhere in my home directory and set logging level to 0.
+
+ #+BEGIN_SRC emacs-lisp :tangle init2.el
+ (setq flymake-gui-warnings-enabled nil)
+ (setq flymake-info-line-regexp
+ (eval-when-compile
+ (regexp-opt
+ '("Invalid name"
+ "String statement has no effect"
+ "Missing docstring"
+ "Empty docstring"
+ "multiple imports on one line"
+ "expected 2 blank lines, found 1"
+ "expected 2 blank lines, found 0"
+ "TODO:"
+ "whitespace after '{'"
+ "whitespace before '}'"
+ "whitespace before ':'"
+ "whitespace after '('"
+ "whitespace before ')'"
+ "whitespace after '['"
+ "whitespace before ']'"
+ "the backslash is redundant between brackets"
+ "continuation line over-indented for visual indent"
+ "continuation line under-indented for visual indent"
+ "Too many statements"
+ "comparison to None should be"
+ "missing whitespace around operator"
+ "missing whitespace after ','"
+ "line too long"
+ "at least two spaces before inline comment"
+ "trailing whitespace"
+ "imported but unused"
+ "Unused import"
+ "too many blank lines"))))
+ (setq flymake-log-file-name (expand-file-name "~/.emacs.d/flymake.log"))
+ (setq flymake-log-level 0)
+ (setq flymake-warn-line-regexp
+ (eval-when-compile
+ (regexp-opt '("warning"
+ "Warning"
+ "redefinition of unused"
+ "Redefining built-in"
+ "Redefining name"
+ "Unused argument"
+ "Unused variable"
+ "Dangerous default value {} as argument"
+ "no newline at end of file"
+ "Access to a protected member"))))
+ #+END_SRC
+
** Eshell
Add ~unison~ to the list of =eshell-visual-commands= because it