bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#5488: flymake does not support .cc + patch to fix it


From: Nil Geisweiller
Subject: bug#5488: flymake does not support .cc + patch to fix it
Date: Thu, 28 Jan 2010 20:44:48 +0200

Hi,

flymake.el does not support .cc (only .c and .cpp). I've written a patch
for it (made a few tests and so far it works,
it is a rather trivial patch so I expect it to work properly).

I've produced the patch based on http://repo.or.cz/r/emacs.git because

bzr branch http://bzr.savannah.gnu.org/r/emacs

returns

bzr: ERROR: Not a branch: "http://bzr.savannah.gnu.org/r/emacs/.bzr/branch/";

and git clone git://git.savannah.gnu.org/emacs.git seems not up to date.

===================== flymake_support_cc.patch =========================
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 4af331c..7fdf8ca 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -270,6 +270,7 @@ are the string substitutions (see `format')."

 (defcustom flymake-allowed-file-name-masks
   '(("\\.c\\'" flymake-simple-make-init)
+    ("\\.cc\\'" flymake-simple-make-init)
     ("\\.cpp\\'" flymake-simple-make-init)
     ("\\.xml\\'" flymake-xml-init)
     ("\\.html?\\'" flymake-xml-init)
@@ -384,7 +385,7 @@ Return t if so, nil if not."

 (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 are .cpp, .cc 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)
@@ -434,7 +435,7 @@ to the beginning of the list (File.h -> File.cpp
moved to top)."
         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).
+For .cpp and .cc 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.
 Whether a buffer for MATER-FILE-NAME exists, use it as a source
@@ -1701,7 +1702,7 @@ Use CREATE-TEMP-F for creating temp copy."
 ;;;; .h/make specific
 (defun flymake-master-make-header-init ()
   (flymake-master-make-init 'flymake-get-include-dirs
-                           '("\\.cpp\\'" "\\.c\\'")
+                           '("\\.cpp\\'" "\\.cc\\'" "\\.c\\'")
                            "[ \t]*#[ \t]*include[ 
\t]*\"\\([[:word:]0-9/\\_.]*%s\\)\""))

 ;;;; .java/make specific
======================================================================

Regards
Nil







reply via email to

[Prev in Thread] Current Thread [Next in Thread]