From: Stefan Bund Date: Mon, 17 Nov 2014 12:24:48 +0000 (+0100) Subject: some highlighting cleanups, better/safer flymake init, fix weird glitches X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=75de9b7e3aa0b2375ed73e0ea729431ab1ccfbe4;p=emacs-init.git some highlighting cleanups, better/safer flymake init, fix weird glitches --- diff --git a/emacs-custom.el b/emacs-custom.el index efd6e27..f7933dc 100644 --- a/emacs-custom.el +++ b/emacs-custom.el @@ -13,8 +13,9 @@ '(c-offsets-alist (quote ((arglist-intro . +)))) '(column-number-mode t) '(comment-column 60) - '(comment-fill-column 160) + '(comment-fill-column 98) '(compilation-ask-about-save nil) + '(compilation-scroll-output t) '(csv-align-padding 0) '(csv-comment-start-default "#") '(csv-field-quotes nil) @@ -29,9 +30,11 @@ '(edit-server-done-hook nil) '(edit-server-new-frame nil) '(fill-column 98) + '(flymake-allowed-file-name-masks (quote (("\\.java\\'" flymake-simple-make-java-init flymake-simple-java-cleanup) ("[0-9]+\\.tex\\'" flymake-master-tex-init flymake-master-cleanup) ("\\.tex\\'" flymake-simple-tex-init)))) '(flyspell-delay 30) '(flyspell-delayed-commands nil) '(frame-background-mode (quote light)) + '(git-commit-fill-column 158) '(global-auto-revert-mode nil) '(global-highlight-changes-mode nil) '(global-subword-mode t) @@ -76,7 +79,8 @@ '(which-func-modes (quote (nxml-mode emacs-lisp-mode c-mode c++-mode perl-mode cperl-mode python-mode makefile-mode sh-mode fortran-mode f90-mode ada-mode diff-mode))) '(which-function-mode nil) '(whitespace-action (quote (auto-cleanup warn-if-read-only))) - '(whitespace-style (quote (face trailing space-before-tab newline indentation empty space-after-tab))) + '(whitespace-line-column 100) + '(whitespace-style (quote (face trailing space-before-tab newline indentation empty space-after-tab lines))) '(x-select-enable-clipboard t)) (custom-set-faces ;; custom-set-faces was added by Custom. @@ -91,5 +95,6 @@ '(textile-acronym-face ((t (:foreground "medium blue")))) '(textile-blockquote-face ((t (:foreground "midnight blue")))) '(textile-code-face ((t (:foreground "firebrick4")))) - '(textile-pre-face ((t (:foreground "dark green"))))) + '(textile-pre-face ((t (:foreground "dark green")))) + '(whitespace-line ((t (:background "yellow"))))) (put 'narrow-to-region 'disabled nil) diff --git a/python/init_python.el b/python/init_python.el index 1ba4818..da250d8 100644 --- a/python/init_python.el +++ b/python/init_python.el @@ -38,7 +38,7 @@ (add-hook 'write-file-functions 'write-file-py-cleanup-imports nil t)) (defun my-flymake-error-at-point () - (condition-case nil + (condition-case nil (flymake-ler-text (car (nth 0 (flymake-find-err-info flymake-err-info (flymake-current-line-no))))) (error (error "no flymake error at point")))) @@ -307,7 +307,17 @@ (list "pyflakes" (list local-file)))) (add-to-list 'flymake-allowed-file-name-masks '("\\.py\\'" flymake-pyflakes-init))) -(add-hook 'find-file-hook 'flymake-find-file-hook) + +(defun safer-flymake-find-file-hook () + "Don't barf if we can't open this flymake file" + (let ((flymake-filename + (flymake-create-temp-inplace (buffer-file-name) "flymake"))) + (if (file-writable-p flymake-filename) + (flymake-find-file-hook) + (message + (format + "Couldn't enable flymake; permission denied on %s" flymake-filename))))) +(add-hook 'find-file-hook 'safer-flymake-find-file-hook) (defun py-imports-region () (save-excursion diff --git a/setup/99finish.el b/setup/99finish.el new file mode 100644 index 0000000..23d1e39 --- /dev/null +++ b/setup/99finish.el @@ -0,0 +1,12 @@ +; Don't ask why we need this ... + +; I just don't know where why this is enabled by default in my config ... can't find it +(setq debug-on-error nil) + +; This load consistently fails the first time round +(load-library "python") + +; 'lines-tail' is valid but missing from customize :-/ +(setq whitespace-style + (nconc (delete 'lines (delete 'lines-tail whitespace-style)) + '(lines-tail)))