From 9cd4c8ed8ca61df9a2839cb3b151b71f15c5e0a6 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sat, 2 Feb 2013 01:08:59 +0100 Subject: emacs: Move flymake settings to init.org --- .emacs.d/init.org | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) (limited to '.emacs.d/init.org') 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 "") '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 -- cgit v1.2.3-54-g00ecf