emacs: Move flymake settings to init.org

This commit is contained in:
Tom Willemsen 2013-02-02 01:08:59 +01:00
parent 8fddc0d0a7
commit 9cd4c8ed8c
3 changed files with 77 additions and 70 deletions

View file

@ -23,7 +23,6 @@
"Face for the supposedly empty line in commit messages." "Face for the supposedly empty line in commit messages."
:group 'local) :group 'local)
(eval-after-load "flymake" '(oni:flymake-init))
(eval-after-load "ido" '(oni:ido-init)) (eval-after-load "ido" '(oni:ido-init))
(eval-after-load "jabber" '(oni:jabber-init)) (eval-after-load "jabber" '(oni:jabber-init))
(eval-after-load "newst-treeview" '(require 'newsticker-init)) (eval-after-load "newst-treeview" '(require 'newsticker-init))
@ -105,52 +104,6 @@
(setq erc-timestamp-format "[%H:%M] ") (setq erc-timestamp-format "[%H:%M] ")
(setq erc-timestamp-only-if-changed-flag nil) (setq erc-timestamp-only-if-changed-flag nil)
(setq fci-rule-color "darkred") (setq fci-rule-color "darkred")
(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"))))
(setq frame-title-format '(:eval (concat "emacs: " (buffer-name)))) (setq frame-title-format '(:eval (concat "emacs: " (buffer-name))))
(setq geiser-repl-history-filename "~/.emacs.d/geiser-history") (setq geiser-repl-history-filename "~/.emacs.d/geiser-history")
(setq gnus-init-file "~/.emacs.d/gnus") (setq gnus-init-file "~/.emacs.d/gnus")
@ -229,7 +182,6 @@
(add-hook 'diary-display-hook 'oni:diary-display-func) (add-hook 'diary-display-hook 'oni:diary-display-func)
(add-hook 'emacs-lisp-mode-hook 'oni:emacs-lisp-mode-func) (add-hook 'emacs-lisp-mode-hook 'oni:emacs-lisp-mode-func)
(add-hook 'erc-mode-hook 'oni:erc-mode-func) (add-hook 'erc-mode-hook 'oni:erc-mode-func)
(add-hook 'flymake-mode-hook 'oni:flymake-mode-func)
(add-hook 'go-mode-hook 'oni:go-mode-func) (add-hook 'go-mode-hook 'oni:go-mode-func)
(add-hook 'gtags-mode-hook 'oni:gtags-mode-func) (add-hook 'gtags-mode-hook 'oni:gtags-mode-func)
(add-hook 'html-mode-hook 'oni:html-mode-func) (add-hook 'html-mode-hook 'oni:html-mode-func)

View file

@ -129,6 +129,83 @@
(global-set-key (kbd "<XF86Tools>") 'oni:start-emms) (global-set-key (kbd "<XF86Tools>") 'oni:start-emms)
#+END_SRC #+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 ** Eshell
Add ~unison~ to the list of =eshell-visual-commands= because it Add ~unison~ to the list of =eshell-visual-commands= because it

View file

@ -110,28 +110,6 @@ DOT are intentionally being skipped."
(visual-line-mode) (visual-line-mode)
(setq truncate-lines nil)) (setq truncate-lines nil))
(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)))
(defun oni:flymake-mode-func ()
"Function for `flymake-mode-hook'."
(local-set-key [M-P] 'flymake-goto-prev-error)
(local-set-key [M-N] 'flymake-goto-next-error))
(defun oni:go-mode-func () (defun oni:go-mode-func ()
"Function for `go-mode-hook'." "Function for `go-mode-hook'."
(setq indent-tabs-mode nil) (setq indent-tabs-mode nil)