1
0
Fork 0

Add flycheck checker for CMake, enable Eldoc

This commit is contained in:
Tom Willemse 2019-05-01 16:37:58 -07:00
parent b19178d1a4
commit 2a139282e7

View file

@ -4,8 +4,8 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 20190402232459 ;; Version: 20190501161805
;; Package-Requires: (cmake-mode oni-company oni-fci cmake-font-lock) ;; Package-Requires: (cmake-mode oni-company oni-fci cmake-font-lock eldoc-cmake flycheck)
;; This program is free software; you can redistribute it and/or modify ;; 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 ;; it under the terms of the GNU General Public License as published by
@ -27,9 +27,11 @@
;;; Code: ;;; Code:
(require 'compile) (require 'compile)
(require 'flycheck)
(add-hook 'cmake-mode-hook 'cmake-font-lock-activate) (add-hook 'cmake-mode-hook 'cmake-font-lock-activate)
(add-hook 'cmake-mode-hook 'company-mode) (add-hook 'cmake-mode-hook 'company-mode)
(add-hook 'cmake-mode-hook 'eldoc-cmake-enable)
(add-hook 'cmake-mode-hook 'electric-pair-local-mode) (add-hook 'cmake-mode-hook 'electric-pair-local-mode)
(add-hook 'cmake-mode-hook 'fci-mode) (add-hook 'cmake-mode-hook 'fci-mode)
@ -43,6 +45,14 @@
eol) eol)
1 2 nil 1 1)) 1 2 nil 1 1))
(flycheck-define-checker cmake-cmakelint
"A CMake checker using cmakelint.
See URL `https://github.com/richq/cmake-lint'"
:command ("cmakelint" source)
:error-patterns ((error line-start (file-name) ":" line ": " (message) line-end))
:modes cmake-mode)
;;;###autoload ;;;###autoload
(with-eval-after-load 'grep (with-eval-after-load 'grep
(add-to-list 'grep-files-aliases '("cmake" . "CMakeLists.txt *.cmake"))) (add-to-list 'grep-files-aliases '("cmake" . "CMakeLists.txt *.cmake")))