aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2010-01-28 14:53:11 -0500
committerChong Yidong2010-01-28 14:53:11 -0500
commitfd09a83f94c3122a67180bb3be4221a9a6c9f873 (patch)
tree94f0b3b5e6b8b0dfdc9c6c9eccf079fdb1fdfd02
parentb242dbfc1b2d4dacad8d33fdd12b328a48afb8b6 (diff)
downloademacs-fd09a83f94c3122a67180bb3be4221a9a6c9f873.tar.gz
emacs-fd09a83f94c3122a67180bb3be4221a9a6c9f873.zip
Flymake fix to handle more C++ filenames (Bug#5488).
* progmodes/flymake.el (flymake-allowed-file-name-masks) (flymake-master-make-header-init): Add other C++ filename masks. (flymake-find-possible-master-files) (flymake-check-patch-master-file-buffer): Doc fixes (Bug#5488).
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/progmodes/flymake.el18
2 files changed, 17 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 6b0c6a016ed..7a12dc0256f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12010-01-28 Nil Geisweiller <ngeiswei@googlemail.com> (tiny change)
2
3 * progmodes/flymake.el (flymake-allowed-file-name-masks)
4 (flymake-master-make-header-init): Add other C++ filename masks.
5 (flymake-find-possible-master-files)
6 (flymake-check-patch-master-file-buffer): Doc fixes (Bug#5488).
7
12010-01-28 Michael Albinus <michael.albinus@gmx.de> 82010-01-28 Michael Albinus <michael.albinus@gmx.de>
2 9
3 Fix some busybox annoyances. 10 Fix some busybox annoyances.
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 4af331c5c29..2a198215536 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -269,8 +269,7 @@ are the string substitutions (see `format')."
269 :group 'tools) 269 :group 'tools)
270 270
271(defcustom flymake-allowed-file-name-masks 271(defcustom flymake-allowed-file-name-masks
272 '(("\\.c\\'" flymake-simple-make-init) 272 '(("\\.\\(?:c\\(?:pp\\|xx\\|\\+\\+\\)?\\|CC\\)\\'" flymake-simple-make-init)
273 ("\\.cpp\\'" flymake-simple-make-init)
274 ("\\.xml\\'" flymake-xml-init) 273 ("\\.xml\\'" flymake-xml-init)
275 ("\\.html?\\'" flymake-xml-init) 274 ("\\.html?\\'" flymake-xml-init)
276 ("\\.cs\\'" flymake-simple-make-init) 275 ("\\.cs\\'" flymake-simple-make-init)
@@ -291,7 +290,7 @@ are the string substitutions (see `format')."
291 ;; ("[ \t]*\\input[ \t]*{\\(.*\\)\\(%s\\)}" 1 2 )) 290 ;; ("[ \t]*\\input[ \t]*{\\(.*\\)\\(%s\\)}" 1 2 ))
292 ;; ("\\.tex\\'" 1) 291 ;; ("\\.tex\\'" 1)
293 ) 292 )
294 "*Files syntax checking is allowed for." 293 "Files syntax checking is allowed for."
295 :group 'flymake 294 :group 'flymake
296 :type '(repeat (string symbol symbol symbol))) 295 :type '(repeat (string symbol symbol symbol)))
297 296
@@ -384,7 +383,7 @@ Return t if so, nil if not."
384 383
385(defun flymake-find-possible-master-files (file-name master-file-dirs masks) 384(defun flymake-find-possible-master-files (file-name master-file-dirs masks)
386 "Find (by name and location) all possible master files. 385 "Find (by name and location) all possible master files.
387Master files are .cpp and .c for and .h. Files are searched for 386Master files include .cpp and .c for .h. Files are searched for
388starting from the .h directory and max max-level parent dirs. 387starting from the .h directory and max max-level parent dirs.
389File contents are not checked." 388File contents are not checked."
390 (let* ((dirs master-file-dirs) 389 (let* ((dirs master-file-dirs)
@@ -434,9 +433,11 @@ to the beginning of the list (File.h -> File.cpp moved to top)."
434 source-file-name patched-source-file-name 433 source-file-name patched-source-file-name
435 include-dirs regexp) 434 include-dirs regexp)
436 "Check if MASTER-FILE-NAME is a master file for SOURCE-FILE-NAME. 435 "Check if MASTER-FILE-NAME is a master file for SOURCE-FILE-NAME.
437For .cpp master file this means it includes SOURCE-FILE-NAME (.h).
438If yes, patch a copy of MASTER-FILE-NAME to include PATCHED-SOURCE-FILE-NAME 436If yes, patch a copy of MASTER-FILE-NAME to include PATCHED-SOURCE-FILE-NAME
439instead of SOURCE-FILE-NAME. 437instead of SOURCE-FILE-NAME.
438
439For example, foo.cpp is a master file if it includes foo.h.
440
440Whether a buffer for MATER-FILE-NAME exists, use it as a source 441Whether a buffer for MATER-FILE-NAME exists, use it as a source
441instead of reading master file from disk." 442instead of reading master file from disk."
442 (let* ((source-file-nondir (file-name-nondirectory source-file-name)) 443 (let* ((source-file-nondir (file-name-nondirectory source-file-name))
@@ -1700,9 +1701,10 @@ Use CREATE-TEMP-F for creating temp copy."
1700 1701
1701;;;; .h/make specific 1702;;;; .h/make specific
1702(defun flymake-master-make-header-init () 1703(defun flymake-master-make-header-init ()
1703 (flymake-master-make-init 'flymake-get-include-dirs 1704 (flymake-master-make-init
1704 '("\\.cpp\\'" "\\.c\\'") 1705 'flymake-get-include-dirs
1705 "[ \t]*#[ \t]*include[ \t]*\"\\([[:word:]0-9/\\_.]*%s\\)\"")) 1706 '("\\.\\(?:c\\(?:pp\\|xx\\|\\+\\+\\)?\\|CC\\)\\'")
1707 "[ \t]*#[ \t]*include[ \t]*\"\\([[:word:]0-9/\\_.]*%s\\)\""))
1706 1708
1707;;;; .java/make specific 1709;;;; .java/make specific
1708(defun flymake-simple-make-java-init () 1710(defun flymake-simple-make-java-init ()