]> git.eshelyaron.com Git - emacs.git/commitdiff
Make bundled Flymake C backend work for C++, too
authorJoão Távora <joaotavora@gmail.com>
Mon, 25 Mar 2019 14:38:25 +0000 (14:38 +0000)
committerJoão Távora <joaotavora@gmail.com>
Mon, 25 Mar 2019 14:55:27 +0000 (14:55 +0000)
* lisp/progmodes/flymake-cc.el (flymake-cc-use-special-make-target):
Pass -x flag according to major-mode.

lisp/progmodes/flymake-cc.el

index 524521d7db236fea6fadf7be44059ee351ca622c..1b449bd07934eee47c754dfdaaf93180174475d0 100644 (file)
@@ -78,7 +78,11 @@ SOURCE."
 (defun flymake-cc-use-special-make-target ()
   "Command for checking a file via a CHK_SOURCES Make target."
   (unless (executable-find "make") (error "Make not found"))
-  '("make" "check-syntax" "CHK_SOURCES=-x c -"))
+  `("make"
+    "check-syntax"
+    ,(format "CHK_SOURCES=-x %s -c -"
+             (cond ((derived-mode-p 'c++-mode) "c++")
+                   (t "c")))))
 
 (defvar-local flymake-cc--proc nil "Internal variable for `flymake-gcc'")