diff options
| author | Chong Yidong | 2010-01-28 14:53:11 -0500 |
|---|---|---|
| committer | Chong Yidong | 2010-01-28 14:53:11 -0500 |
| commit | fd09a83f94c3122a67180bb3be4221a9a6c9f873 (patch) | |
| tree | 94f0b3b5e6b8b0dfdc9c6c9eccf079fdb1fdfd02 | |
| parent | b242dbfc1b2d4dacad8d33fdd12b328a48afb8b6 (diff) | |
| download | emacs-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/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/progmodes/flymake.el | 18 |
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 @@ | |||
| 1 | 2010-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 | |||
| 1 | 2010-01-28 Michael Albinus <michael.albinus@gmx.de> | 8 | 2010-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. |
| 387 | Master files are .cpp and .c for and .h. Files are searched for | 386 | Master files include .cpp and .c for .h. Files are searched for |
| 388 | starting from the .h directory and max max-level parent dirs. | 387 | starting from the .h directory and max max-level parent dirs. |
| 389 | File contents are not checked." | 388 | File 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. |
| 437 | For .cpp master file this means it includes SOURCE-FILE-NAME (.h). | ||
| 438 | If yes, patch a copy of MASTER-FILE-NAME to include PATCHED-SOURCE-FILE-NAME | 436 | If yes, patch a copy of MASTER-FILE-NAME to include PATCHED-SOURCE-FILE-NAME |
| 439 | instead of SOURCE-FILE-NAME. | 437 | instead of SOURCE-FILE-NAME. |
| 438 | |||
| 439 | For example, foo.cpp is a master file if it includes foo.h. | ||
| 440 | |||
| 440 | Whether a buffer for MATER-FILE-NAME exists, use it as a source | 441 | Whether a buffer for MATER-FILE-NAME exists, use it as a source |
| 441 | instead of reading master file from disk." | 442 | instead 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 () |