From 2a139282e77e250f3a9c3ac1c1fc87ba0777890b Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Wed, 1 May 2019 16:37:58 -0700 Subject: Add flycheck checker for CMake, enable Eldoc --- oni-cmake.el | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'oni-cmake.el') diff --git a/oni-cmake.el b/oni-cmake.el index 7019583..869b049 100644 --- a/oni-cmake.el +++ b/oni-cmake.el @@ -4,8 +4,8 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 20190402232459 -;; Package-Requires: (cmake-mode oni-company oni-fci cmake-font-lock) +;; Version: 20190501161805 +;; 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 ;; it under the terms of the GNU General Public License as published by @@ -27,9 +27,11 @@ ;;; Code: (require 'compile) +(require 'flycheck) (add-hook 'cmake-mode-hook 'cmake-font-lock-activate) (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 'fci-mode) @@ -43,6 +45,14 @@ eol) 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 (with-eval-after-load 'grep (add-to-list 'grep-files-aliases '("cmake" . "CMakeLists.txt *.cmake"))) -- cgit v1.2.3-54-g00ecf