From 408f6b329afb03bec557c3f088558395a214aa6c Mon Sep 17 00:00:00 2001 From: Samuel Tonini Date: Thu, 20 Nov 2014 06:30:24 +0100 Subject: [PATCH 1/2] add flycheck submodule --- .gitmodules | 3 +++ vendor/flycheck | 1 + 2 files changed, 4 insertions(+) create mode 160000 vendor/flycheck diff --git a/.gitmodules b/.gitmodules index 6cf8870..ef93464 100644 --- a/.gitmodules +++ b/.gitmodules @@ -138,3 +138,6 @@ [submodule "vendor/elixir-mode"] path = vendor/elixir-mode url = git@github.com:elixir-lang/emacs-elixir.git +[submodule "vendor/flycheck"] + path = vendor/flycheck + url = https://github.com/flycheck/flycheck.git diff --git a/vendor/flycheck b/vendor/flycheck new file mode 160000 index 0000000..3ed6fde --- /dev/null +++ b/vendor/flycheck @@ -0,0 +1 @@ +Subproject commit 3ed6fde11d0047feb24aeacdc7a178faed7918d4 From dbc4d060c7f76aebe26efe902fa7aac9b1a6841a Mon Sep 17 00:00:00 2001 From: Samuel Tonini Date: Wed, 26 Nov 2014 09:47:04 +0100 Subject: [PATCH 2/2] update major-mode bundles to work with flycheck instead of flymake --- bundles/erlang/bundle.el | 6 +- bundles/flycheck/bundle.el | 6 ++ bundles/javascript/bundle.el | 74 ++------------------- bundles/javascript/readme.md | 6 -- bundles/latex/bundle.el | 27 ++------ bundles/latex/flymake.el | 41 ------------ bundles/latex/readme.md | 14 ---- bundles/php/bundle.el | 8 ++- bundles/php/flymake.el | 34 ---------- bundles/plone/bundle.el | 14 ---- bundles/plone/readme.md | 1 - bundles/python/bundle.el | 92 ++++++--------------------- bundles/ruby/bundle.el | 8 ++- bundles/ruby/flymake.el | 36 ----------- bundles/xml/bundle.el | 24 ++----- lib/bundles/framework.el | 12 ++-- lib/platforms/mac.el | 3 - lib/variables.el | 4 +- vendor/flymake-point/flymake-point.el | 59 ----------------- 19 files changed, 62 insertions(+), 407 deletions(-) create mode 100644 bundles/flycheck/bundle.el delete mode 100644 bundles/latex/flymake.el delete mode 100644 bundles/php/flymake.el delete mode 100644 bundles/ruby/flymake.el delete mode 100644 vendor/flymake-point/flymake-point.el diff --git a/bundles/erlang/bundle.el b/bundles/erlang/bundle.el index 684d992..7edb2eb 100644 --- a/bundles/erlang/bundle.el +++ b/bundles/erlang/bundle.el @@ -8,7 +8,6 @@ (setq exec-path (cons erlang-bin-dir exec-path)) (defun cabbage-erlang-mode-hook () - (require 'erlang-flymake) (local-set-key (kbd "C-c C-l") 'erlang-compile)) ;; customizations @@ -16,3 +15,8 @@ (add-hook 'erlang-mode-hook 'cabbage-erlang-mode-hook)) (require 'erlang-start))) + +(when (cabbage-flycheck-active-p) + (cabbage-flycheck-init) + (add-hook 'erlang-mode-hook 'flycheck-mode) + (add-hook 'erlang-mode-hook 'cabbage-flycheck-keybindings)) diff --git a/bundles/flycheck/bundle.el b/bundles/flycheck/bundle.el new file mode 100644 index 0000000..d1cbb3a --- /dev/null +++ b/bundles/flycheck/bundle.el @@ -0,0 +1,6 @@ +(cabbage-vendor 'flycheck) + +(defun cabbage-flycheck-keybindings () + (local-set-key (kbd "C-c f n") 'flycheck-next-error) + (local-set-key (kbd "C-c f p") 'flycheck-previous-error) + (local-set-key (kbd "C-c f l") 'flycheck-list-errors)) diff --git a/bundles/javascript/bundle.el b/bundles/javascript/bundle.el index 2512d02..223d6a4 100644 --- a/bundles/javascript/bundle.el +++ b/bundles/javascript/bundle.el @@ -1,47 +1,18 @@ -;; Configuration - -(defcustom cabbage-javascript-jslint-enabled nil - "Enable flymake with jslint" - :type 'boolean - :group 'cabbage) - -(defcustom cabbage-javascript-jslint-executable-path - (or (executable-find "jsl") - (concat cabbage-repository "bin/jsl-0.3.0-mac/jsl")) - "path to the js-lint executable" - :type 'string - :group 'cabbage) - ;;;; ------------------------------------- ;;;; Bundle (add-to-list 'auto-mode-alist '("\\.js\\(on\\)?$" . js-mode)) - -;; Defuns - -(defun cabbage-javascript-jslint-compile () - (interactive) - (compile (format "%s -process %s" cabbage-javascript-jslint-executable-path (buffer-file-name)))) - ;; Setup - -(defun cabbage-javascript-keybindings () - (local-set-key (kbd "C-§") 'flymake-goto-next-error)) -(add-hook 'js-mode-hook 'cabbage-javascript-keybindings) - - (defun cabbage-javascript-configure-indenting () (setq js-indent-level 2 javascript-indent-level 2 js-auto-indent-flag nil)) (add-hook 'js-mode-hook 'cabbage-javascript-configure-indenting) - (defun cabbage-javascript-set-pairs () (cabbage--set-pairs '("(" "{" "[" "\"" "'"))) (add-hook 'js-mode-hook 'cabbage-javascript-set-pairs) - (defun cabbage-javascript-fix-fontlock () (font-lock-add-keywords 'js-mode @@ -58,44 +29,7 @@ '(progn (cabbage-javascript-fix-fontlock))) - -(defun cabbage-javascript--configure-jslint () - (when (executable-find cabbage-javascript-jslint-executable-path) - (require 'flymake) - (defun cabbage-javascript-flymake-jslint-init () - (let* ((temp-file (flymake-init-create-temp-buffer-copy - 'flymake-create-temp-inplace)) - (local-file (file-relative-name - temp-file - (file-name-directory buffer-file-name)))) - (list cabbage-javascript-jslint-executable-path - (list "-process" local-file)))) - - (setq flymake-allowed-file-name-masks - (cons '(".+\\.js$" - cabbage-javascript-flymake-jslint-init - flymake-simple-cleanup - flymake-get-real-file-name) - flymake-allowed-file-name-masks)) - - (setq flymake-err-line-patterns - (cons '("^Lint at line \\([[:digit:]]+\\) character \\([[:digit:]]+\\): \\(.+\\)$" - nil 1 2 3) - flymake-err-line-patterns)) - - (defun cabbage-javascript-enable-flymake-mode () - (if (executable-find cabbage-javascript-jslint-executable-path) - (flymake-mode t))) - (add-hook 'js-mode-hook 'cabbage-javascript-enable-flymake-mode) - - (add-hook 'js-mode-hook 'cabbage-flymake-init))) - -(eval-after-load 'js - '(progn - (when cabbage-javascript-jslint-enabled - (cabbage-javascript--configure-jslint)))) - - -(eval-after-load 'mode-compile - '(progn - (add-to-list 'mode-compile-modes-alist '(js-mode . (senny-jslint-compile kill-compilation))))) +(when (cabbage-flycheck-active-p) + (cabbage-flycheck-init) + (add-hook 'js-mode-hook 'cabbage-flycheck-keybindings) + (add-hook 'js-mode-hook 'flycheck-mode)) diff --git a/bundles/javascript/readme.md b/bundles/javascript/readme.md index ee21a1a..821b8b0 100644 --- a/bundles/javascript/readme.md +++ b/bundles/javascript/readme.md @@ -1,9 +1,3 @@ # javascript bundle The javascript bundle configures emacs for coding javascript. - - -## Features - -* [flymake](http://flymake.sourceforge.net/) validation for javascript - files using the cabbage built-in javascript linter. diff --git a/bundles/latex/bundle.el b/bundles/latex/bundle.el index 9bf8afe..2801b6f 100644 --- a/bundles/latex/bundle.el +++ b/bundles/latex/bundle.el @@ -1,18 +1,3 @@ -;; configurations - -(defcustom cabbage-latex-enable-flymake - t - "Enable flymake. Uses texify by default." - :type 'boolean - :group 'cabbage) - -(defcustom cabbage-latex-flymake-use-chktex - t - "If t, flymake uses chktext instead of texify in latex mode." - :type 'boolean - :group 'cabbage) - - ;;;; ------------------------------------- ;;;; Bundle @@ -27,13 +12,6 @@ (define-key latex-mode-map (kbd "C-c 2") 'cabbage-latex-open-pdf) (define-key latex-mode-map (kbd "C-c 3") 'cabbage-latex-cleanup))) - -;; flymake - -(when (and cabbage-latex-enable-flymake (cabbage-flymake-active-p)) - (cabbage-load-bundle-dependencies "latex" '("flymake.el"))) - - ;; funs (defun cabbage-latex-pdflatex-build (&optional nonstop) @@ -69,3 +47,8 @@ (mapcar (lambda (x) (shell-command (concat "rm " basename x))) (list ".aux" ".lof" ".log" ".lot" ".pdf" ".toc"))) (message "Deleted temp files and pdf")) + +(when (cabbage-flycheck-active-p) + (cabbage-flycheck-init) + (add-hook 'latex-mode-hook 'flycheck-mode) + (add-hook 'latex-mode-hook 'cabbage-flycheck-keybindings)) diff --git a/bundles/latex/flymake.el b/bundles/latex/flymake.el deleted file mode 100644 index a8c15bd..0000000 --- a/bundles/latex/flymake.el +++ /dev/null @@ -1,41 +0,0 @@ - -(defun cabbage-latex--enable-flymake () - (if (load "flymake" t) - (progn - - ;; we need to patch flymake-get-tex-args after each load of flymake. - ;; doing this only once and loading flymake afterwards may result in - ;; crash of emacs in certain cases. - (defun flymake-get-tex-args (file-name) - (eval cabbage-latex--flymake-tex-args)) - - (flymake-mode t) - (cabbage-flymake-init)))) - -(defvar cabbage-latex--flymake-tex-args nil - "quoted flymake arguments.") - -(when (and cabbage-latex-enable-flymake - (cond - - ;; allow user to set the args in his customizations - (cabbage-latex--flymake-tex-args - t) - - ;; use chktex - (cabbage-latex-flymake-use-chktex - (when (executable-find "chktex") - - (setq cabbage-latex--flymake-tex-args - '(list "chktex" (list "-q" "-v0" file-name))) - t)) - - ;; use texify - ((executable-find "texify") - (setq cabbage-latex--flymake-tex-args - '(list "texify" (list "--pdf" - "--tex-option=-c-style-errors" - file-name))) - t)) - - (add-hook 'latex-mode-hook 'cabbage-latex--enable-flymake))) diff --git a/bundles/latex/readme.md b/bundles/latex/readme.md index f5f70df..75110b9 100644 --- a/bundles/latex/readme.md +++ b/bundles/latex/readme.md @@ -2,26 +2,12 @@ Configures emacs for coding LaTeX. - ## Features -* Configures [flymake](http://flymake.sourceforge.net/) validation - using [chktex](http://www.nongnu.org/chktex/). - * Adds bindings for converting a LaTeX file to a PDF and display it. - ## Configuration options -* `cabbage-latex-enable-flymake`: If `t` (default), emacs will try to - set up flymake validation. - -* `cabbage-latex-flymake-use-chktex`: If `t` (default), cabbage - reconfigures the flymake validation to use "chktex". The chktex - executable has to be in the `PATH`. If it is `nil`, `texify` is - used. - - # Functions / bindings * `cabbage-latex-pdflatex-build` (`C-c 1`): convert the current LaTeX diff --git a/bundles/php/bundle.el b/bundles/php/bundle.el index 1b2dda6..bef7b32 100644 --- a/bundles/php/bundle.el +++ b/bundles/php/bundle.el @@ -52,7 +52,9 @@ (when (and buffer-file-name (string-match "Test.php$" buffer-file-name)) (setq cabbage-testing-execute-function 'cabbage-phpunit-run-single-file))) -(when (cabbage-flymake-active-p) - (cabbage-load-bundle-dependencies "php" '("flymake"))) - (add-hook 'php-mode-hook 'cabbage-php-mode-hook) + +(when (cabbage-flycheck-active-p) + (cabbage-flycheck-init) + (add-hook 'php-mode-hook 'flycheck-mode) + (add-hook 'php-mode-hook 'cabbage-flycheck-keybindings)) diff --git a/bundles/php/flymake.el b/bundles/php/flymake.el deleted file mode 100644 index 74b7c03..0000000 --- a/bundles/php/flymake.el +++ /dev/null @@ -1,34 +0,0 @@ -(eval-after-load 'php-mode - '(progn - ;; Libraries - (require 'flymake) - - ;; Invoke php with '-l' to get syntax checking - (defun flymake-php-init () - (let* ((temp (flymake-init-create-temp-buffer-copy 'flymake-create-temp-inplace)) - (local (file-relative-name temp (file-name-directory buffer-file-name)))) - (list "php" (list "-f" local "-l")))) - - (push '("\\(Parse\\|Fatal\\) error: +\\(.*?\\) in \\(.*?\\) on line \\([0-9]+\\)$" 3 4 nil 2) - flymake-err-line-patterns) - - (push '(".+\\.php[345s]?$" flymake-php-init) flymake-allowed-file-name-masks) - (push '(".+\\.inc$" flymake-php-init) flymake-allowed-file-name-masks) - (push '(".+\\.module$" flymake-php-init) flymake-allowed-file-name-masks) - - (add-hook 'php-mode-hook 'cabbage-flymake-init) - - (add-hook 'php-mode-hook - (lambda () - (when (and buffer-file-name - (file-writable-p - (file-name-directory buffer-file-name)) - (file-writable-p buffer-file-name) - (if (fboundp 'tramp-list-remote-buffers) - (not (subsetp - (list (current-buffer)) - (tramp-list-remote-buffers))) - t)) - (local-set-key (kbd "C-c d") - 'flymake-display-err-menu-for-current-line) - (flymake-mode t)))))) diff --git a/bundles/plone/bundle.el b/bundles/plone/bundle.el index ce4b5e7..e97efc0 100644 --- a/bundles/plone/bundle.el +++ b/bundles/plone/bundle.el @@ -209,20 +209,6 @@ then prompts for a file. Expects to be within a package (add-to-list 'auto-mode-alist '("\\.[zc]?pt$" . nxml-mode)) (add-to-list 'auto-mode-alist '("\\.zcml$" . nxml-mode)) - -(defun cabbage-plone--xml-flymake () - (when (and (cabbage-bundle-active-p 'xml) - cabbage-xml-flymake-enabled - (executable-find "xml")) - - (add-to-list 'flymake-allowed-file-name-masks - '("\\.[zc]?pt$" flymake-xml-init)) - (add-to-list 'flymake-allowed-file-name-masks - '("\\.zcml$" flymake-xml-init)))) - -(add-hook 'nxml-mode-hook 'cabbage-plone--xml-flymake) - - (defun cabbage-plone--python-bindings () (define-key python-mode-map (kbd "C-M-") 'cabbage-plone-goto-defition) (define-key python-mode-map (kbd "C-M-S-") 'cabbage-plone-lookup-import)) diff --git a/bundles/plone/readme.md b/bundles/plone/readme.md index bfe8521..d2d54ae 100644 --- a/bundles/plone/readme.md +++ b/bundles/plone/readme.md @@ -8,7 +8,6 @@ especially when using ## Features * Configures modes for .zcml, .?pt and .po[t] files. -* Configures flymake (pyflakes, xml-startlet) * Provides shortcuts for finding files when using buildout. * Configures pdb-mode, so that zope can be run within emacs. * Reload code using diff --git a/bundles/python/bundle.el b/bundles/python/bundle.el index 2f0f714..78bea3a 100644 --- a/bundles/python/bundle.el +++ b/bundles/python/bundle.el @@ -2,15 +2,13 @@ (defcustom cabbage-python-pyflakes-enabled t - "Enable flymake with pyflakes in python mode" + "Enable flycheck with pyflakes in python mode" :type 'boolean :group 'cabbage) - ;;;; ------------------------------------- ;;;; Bundle - ;; helpers (defun cabbage-python--sort-lines-at-point () @@ -20,85 +18,37 @@ (let ((sort-fold-case t)) (call-interactively 'sort-lines))) +;; flycheck + +(when (cabbage-flycheck-active-p) + (cabbage-flycheck-init) + + (when cabbage-python-pyflakes-enabled + (flycheck-define-checker python-pyflakes + "A Python syntax and style checker using the pyflakes utility. +See URL `http://pypi.python.org/pypi/pyflakes'." + :command ("pyflakes" source-inplace) + :error-patterns + ((error line-start (file-name) ":" line ":" (message) line-end)) + :modes python-mode) + + (add-to-list 'flycheck-checkers 'python-pyflakes)) + + (add-hook 'python-mode-hook 'cabbage-flycheck-keybindings) + (add-hook 'python-mode-hook 'flycheck-mode)) ;; hooks (defun cabbage-python-set-pairs () (cabbage--set-pairs '("(" "{" "[" "\"" "\'" "`"))) -(add-hook 'python-mode-hook 'cabbage-python-set-pairs) - - (defun cabbage-python--default-config () (set (make-local-variable 'tab-width) 4)) -(add-hook 'python-mode-hook 'cabbage-python--default-config) - - (defun cabbage-python-keybindings () (local-set-key (kbd "RET") 'newline-and-indent) (local-set-key (kbd "C-c f s") 'cabbage-python--sort-lines-at-point)) +(add-hook 'python-mode-hook 'cabbage-python-set-pairs) +(add-hook 'python-mode-hook 'cabbage-python--default-config) (add-hook 'python-mode-hook 'cabbage-python-keybindings) - -(defun cabbage-python-pep8-finished (buffer msg) - (when (or (eq last-command 'cabbage-python-pep8) - (eq last-command 'cabbage-python-pylint) - (eq last-command 'cabbage-plone--pep8-package)) - (pop-to-buffer buffer) - (next-error-follow-minor-mode t) - (goto-line 5) - (next-error-follow-mode-post-command-hook) - (compile-goto-error))) - -(defun cabbage-python-pep8 () - "Check for pep8 errors and go to the first error." - (interactive) - - (cabbage-vendor 'python-pep8) - (require 'tramp) - - (add-to-list 'compilation-finish-functions 'cabbage-python-pep8-finished) - (pep8)) - -(defun cabbage-python-configure-pep8 () - (local-set-key (kbd "C-°") 'cabbage-python-pep8)) - -(add-hook 'python-mode-hook 'cabbage-python-configure-pep8) - - -(defun cabbage-python-pylint () - "Check for pylint errors on key-press rather than using flymake." - (interactive) - (let ((command (concat (executable-find "epylint") - " " buffer-file-name - ;; this regexp reformats the epylint output so that it matches the pep8 output - ;; XXX we could "let" python-pep8-regexp-alist instead. - " | sed -e 's/\\([^:]*:[^:]*:\\)\\([^(]*(\\)\\([EW][0-9]*\\)\\(.*\\)/\\11: \\3\\2\\3\\4/'"))) - (add-to-list 'compilation-finish-functions 'cabbage-python-pep8-finished) - (compilation-start command 'python-pep8-mode))) - -(defun cabbage-python-configure-pylint () - (local-set-key (kbd "C-M-§") 'cabbage-python-pylint)) - -(add-hook 'python-mode-hook 'cabbage-python-configure-pylint) - -(defun cabbage-python-flymake () - (when (and cabbage-python-pyflakes-enabled (executable-find "pyflakes")) - (when (load "flymake" t) - (cabbage-flymake-init) - - (defun flymake-pyflakes-init () - (let* ((temp-file (flymake-init-create-temp-buffer-copy - 'flymake-create-temp-inplace)) - (local-file (file-relative-name - temp-file - (file-name-directory buffer-file-name)))) - (list (executable-find "pyflakes") (list local-file)))) - - (add-to-list 'flymake-allowed-file-name-masks - '("\\.py\\'" flymake-pyflakes-init))) - - (flymake-find-file-hook))) - -(add-hook 'python-mode-hook 'cabbage-python-flymake) diff --git a/bundles/ruby/bundle.el b/bundles/ruby/bundle.el index cac8a97..a98466e 100644 --- a/bundles/ruby/bundle.el +++ b/bundles/ruby/bundle.el @@ -115,9 +115,6 @@ (6 (7 . ?/)))) )) -(when (cabbage-flymake-active-p) - (cabbage-load-bundle-dependencies "ruby" '("flymake"))) - (defun cabbage-ruby-mode-hook () (cabbage--set-pairs '("(" "{" "[" "\"" "\'" "|")) @@ -135,3 +132,8 @@ (add-to-list 'ac-ignores "end")))) (add-hook 'ruby-mode-hook 'cabbage-ruby-mode-hook) + +(when (cabbage-flycheck-active-p) + (cabbage-flycheck-init) + (add-hook 'ruby-mode-hook 'flycheck-mode) + (add-hook 'ruby-mode-hook 'cabbage-flycheck-keybindings)) diff --git a/bundles/ruby/flymake.el b/bundles/ruby/flymake.el deleted file mode 100644 index 39381bc..0000000 --- a/bundles/ruby/flymake.el +++ /dev/null @@ -1,36 +0,0 @@ -(eval-after-load 'ruby-mode - '(progn - ;; Libraries - (require 'flymake) - - ;; Invoke ruby with '-c' to get syntax checking - (defun flymake-ruby-init () - (let* ((temp-file (flymake-init-create-temp-buffer-copy - 'flymake-create-temp-inplace)) - (local-file (file-relative-name - temp-file - (file-name-directory buffer-file-name)))) - (list "ruby" (list "-c" local-file)))) - - (push '(".+\\.rb$" flymake-ruby-init) flymake-allowed-file-name-masks) - (push '("Rakefile$" flymake-ruby-init) flymake-allowed-file-name-masks) - - (push '("^\\(.*\\):\\([0-9]+\\): \\(.*\\)$" 1 2 nil 3) - flymake-err-line-patterns) - - (add-hook 'ruby-mode-hook 'cabbage-flymake-init) - - (add-hook 'ruby-mode-hook - (lambda () - (when (and buffer-file-name - (file-writable-p - (file-name-directory buffer-file-name)) - (file-writable-p buffer-file-name) - (if (fboundp 'tramp-list-remote-buffers) - (not (subsetp - (list (current-buffer)) - (tramp-list-remote-buffers))) - t)) - (local-set-key (kbd "C-c d") - 'flymake-display-err-menu-for-current-line) - (flymake-mode t)))))) diff --git a/bundles/xml/bundle.el b/bundles/xml/bundle.el index 8cde065..b10b711 100644 --- a/bundles/xml/bundle.el +++ b/bundles/xml/bundle.el @@ -1,12 +1,3 @@ -;; Configuration - -(defcustom cabbage-xml-flymake-enabled - t - "Enable flymake for xml mode." - :type 'boolean - :group 'cabbage) - - ;;;; ------------------------------------- ;;;; Bundle @@ -31,15 +22,6 @@ (add-hook 'nxml-mode-hook 'cabbage-xml-set-pairs) -(defun cabbage-xml-flymake () - (when (and cabbage-xml-flymake-enabled (executable-find "xml")) - (when (load "flymake" t) - (cabbage-flymake-init) - - (flymake-find-file-hook)))) - -(add-hook 'nxml-mode-hook 'cabbage-xml-flymake) - ;; Rebind '>', so that it automatically inserts a closing xml tag (if ;; appropriate) (defun cabbage-nxml-end-tag () @@ -56,5 +38,7 @@ ;; rebind > to close the current tag (define-key nxml-mode-map ">" 'cabbage-nxml-end-tag))) - - +(when (cabbage-flycheck-active-p) + (cabbage-flycheck-init) + (add-hook 'nxml-mode-hook 'flycheck-mode) + (add-hook 'nxml-mode-hook 'cabbage-flycheck-keybindings)) diff --git a/lib/bundles/framework.el b/lib/bundles/framework.el index eec4220..48b87e1 100644 --- a/lib/bundles/framework.el +++ b/lib/bundles/framework.el @@ -5,8 +5,8 @@ (defun cabbage-bundle-active-p (bundle-name) (member bundle-name cabbage-bundles)) -(defun cabbage-flymake-active-p () - cabbage-use-flymake) +(defun cabbage-flycheck-active-p () + cabbage-use-flycheck) (defun cabbage-global-set-key (binding func) (add-to-list 'cabbage--globaly-bound-keys-alist (cons binding func)) @@ -31,11 +31,9 @@ (defun cabbage-lisp-buffer-p () (memql major-mode '(emacs-lisp-mode lisp-mode lisp-interaction-mode))) -(defun cabbage-flymake-init () - "registered as hook in bundles ; configures flymake" - (cabbage-vendor 'flymake-point) - - (local-set-key (kbd "C-§") 'flymake-goto-next-error)) +(defun cabbage-flycheck-init () + "Initialize flycheck and specific functionalities." + (cabbage-load-bundle 'flycheck)) (defun cabbage-insert-pairs-p () cabbage-insert-pairs) diff --git a/lib/platforms/mac.el b/lib/platforms/mac.el index e9255bf..327098c 100644 --- a/lib/platforms/mac.el +++ b/lib/platforms/mac.el @@ -48,6 +48,3 @@ ;; make emacs use the clipboard (setq x-select-enable-clipboard t) - -;; do not use flymake gui popups, since emacs crashes on the second popup. -(setq flymake-gui-warnings-enabled nil) diff --git a/lib/variables.el b/lib/variables.el index 1364788..6c61db8 100644 --- a/lib/variables.el +++ b/lib/variables.el @@ -10,8 +10,8 @@ :type 'string :group 'cabbage) -(defcustom cabbage-use-flymake t - "set if you want to use flymake or not" +(defcustom cabbage-use-flycheck t + "set if you want to use flycheck or not" :type 'boolean :group 'cabbage) diff --git a/vendor/flymake-point/flymake-point.el b/vendor/flymake-point/flymake-point.el deleted file mode 100644 index 1250ea2..0000000 --- a/vendor/flymake-point/flymake-point.el +++ /dev/null @@ -1,59 +0,0 @@ -;;; flymake-point.el --- show flymake errors under the point in the minibuffer - -;; Copyright (C) 2008 Travis B. Hartwell -;; Copyright (C) 2011 Brodie Rao - -;; Author: Travis B. Hartwell -;; Maintainer: Brodie Rao -;; Created: Jun 2008 -;; Version: 0.1 -;; Keywords: conveniece languages tools - -;; This program is free software; you can redistribute it and/or -;; modify it under the terms of the GNU General Public License as -;; published by the Free Software Foundation, either version 3 of the -;; License, or (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, but -;; WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;; General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see . - -;;; Commentary: - -;; Additional functionality that makes flymake error messages appear -;; in the minibuffer when point is on a line containing a flymake -;; error. This saves having to mouse over the error, which is a -;; keyboard user's annoyance. - -;;; Code: - -(defun flymake-error-under-point () - "Display the flymake error under the point in the minibuffer." - (interactive) - (let ((line-no (line-number-at-pos))) - (dolist (elem flymake-err-info) - (if (eq (car elem) line-no) - (let ((err (car (nth 1 elem)))) - (message "%s" (flymake-ler-text err))))))) - -(defadvice flymake-goto-next-error (after display-message activate compile) - "Show the next error in the ring in the minibuffer." - (flymake-error-under-point)) - -(defadvice flymake-goto-prev-error (after display-message activate compile) - "Show the previous error in the ring in the minibuffer." - (flymake-error-under-point)) - -(defadvice flymake-mode (before post-command-stuff activate compile) - "When there's an error under the point, display it in the -minibuffer." - (set (make-local-variable 'post-command-hook) - (cons 'flymake-error-under-point post-command-hook))) - -(provide 'flymake-point) - -;;; flymake-point.el ends here