;;; flymake.el -- a universal on-the-fly syntax checker
-;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
;; Free Software Foundation, Inc.
;; Author: Pavel Kobyakov <pk_at_work@yahoo.com>
:group 'tools)
(defcustom flymake-allowed-file-name-masks
- '(("\\.c\\'" flymake-simple-make-init)
- ("\\.cpp\\'" flymake-simple-make-init)
+ '(("\\.\\(?:c\\(?:pp\\|xx\\|\\+\\+\\)?\\|CC\\)\\'" flymake-simple-make-init)
("\\.xml\\'" flymake-xml-init)
("\\.html?\\'" flymake-xml-init)
("\\.cs\\'" flymake-simple-make-init)
;; ("[ \t]*\\input[ \t]*{\\(.*\\)\\(%s\\)}" 1 2 ))
;; ("\\.tex\\'" 1)
)
- "*Files syntax checking is allowed for."
+ "Files syntax checking is allowed for."
:group 'flymake
:type '(repeat (string symbol symbol symbol)))
(defun flymake-find-possible-master-files (file-name master-file-dirs masks)
"Find (by name and location) all possible master files.
-Master files are .cpp and .c for and .h. Files are searched for
+Master files include .cpp and .c for .h. Files are searched for
starting from the .h directory and max max-level parent dirs.
File contents are not checked."
(let* ((dirs master-file-dirs)
source-file-name patched-source-file-name
include-dirs regexp)
"Check if MASTER-FILE-NAME is a master file for SOURCE-FILE-NAME.
-For .cpp master file this means it includes SOURCE-FILE-NAME (.h).
If yes, patch a copy of MASTER-FILE-NAME to include PATCHED-SOURCE-FILE-NAME
instead of SOURCE-FILE-NAME.
+
+For example, foo.cpp is a master file if it includes foo.h.
+
Whether a buffer for MATER-FILE-NAME exists, use it as a source
instead of reading master file from disk."
(let* ((source-file-nondir (file-name-nondirectory source-file-name))
(flymake-report-status "" "") ; PASSED
(if (not flymake-check-was-interrupted)
(flymake-report-fatal-status "CFGERR"
- (format "Configuration error has occured while running %s" command))
+ (format "Configuration error has occurred while running %s" command))
(flymake-report-status nil ""))) ; "STOPPED"
(flymake-report-status (format "%d/%d" err-count warn-count) ""))))
(when dir
(let ((default-directory dir))
(flymake-log 3 "starting process on dir %s" default-directory)))
- (setq process (apply 'start-process "flymake-proc" (current-buffer) cmd args))
+ (setq process (apply 'start-file-process
+ "flymake-proc" (current-buffer) cmd args))
(set-process-sentinel process 'flymake-process-sentinel)
(set-process-filter process 'flymake-process-filter)
(push process flymake-processes)
;;;; .h/make specific
(defun flymake-master-make-header-init ()
- (flymake-master-make-init 'flymake-get-include-dirs
- '("\\.cpp\\'" "\\.c\\'")
- "[ \t]*#[ \t]*include[ \t]*\"\\([[:word:]0-9/\\_.]*%s\\)\""))
+ (flymake-master-make-init
+ 'flymake-get-include-dirs
+ '("\\.\\(?:c\\(?:pp\\|xx\\|\\+\\+\\)?\\|CC\\)\\'")
+ "[ \t]*#[ \t]*include[ \t]*\"\\([[:word:]0-9/\\_.]*%s\\)\""))
;;;; .java/make specific
(defun flymake-simple-make-java-init ()