unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#5488: flymake does not support .cc + patch to fix it
@ 2010-01-28 18:44 Nil Geisweiller
  2010-01-28 19:48 ` Glenn Morris
  2010-01-28 19:53 ` Chong Yidong
  0 siblings, 2 replies; 4+ messages in thread
From: Nil Geisweiller @ 2010-01-28 18:44 UTC (permalink / raw)
  To: 5488

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







^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-01-28 20:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-28 18:44 bug#5488: flymake does not support .cc + patch to fix it Nil Geisweiller
2010-01-28 19:48 ` Glenn Morris
2010-01-28 20:33   ` Chong Yidong
2010-01-28 19:53 ` Chong Yidong

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).