From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nil Geisweiller Newsgroups: gmane.emacs.bugs Subject: bug#5488: flymake does not support .cc + patch to fix it Date: Thu, 28 Jan 2010 20:44:48 +0200 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1264707125 17479 80.91.229.12 (28 Jan 2010 19:32:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Jan 2010 19:32:05 +0000 (UTC) To: 5488@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jan 28 20:32:02 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Naa5w-0001y1-FQ for geb-bug-gnu-emacs@m.gmane.org; Thu, 28 Jan 2010 20:32:00 +0100 Original-Received: from localhost ([127.0.0.1]:41784 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Naa5v-0002SU-TG for geb-bug-gnu-emacs@m.gmane.org; Thu, 28 Jan 2010 14:31:59 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NaZkt-0007NB-2C for bug-gnu-emacs@gnu.org; Thu, 28 Jan 2010 14:10:15 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NaZko-0007MH-Hv for bug-gnu-emacs@gnu.org; Thu, 28 Jan 2010 14:10:14 -0500 Original-Received: from [199.232.76.173] (port=46040 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NaZko-0007ME-BB for bug-gnu-emacs@gnu.org; Thu, 28 Jan 2010 14:10:10 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45042) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NaZkn-000461-HR for bug-gnu-emacs@gnu.org; Thu, 28 Jan 2010 14:10:09 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NaZOP-0005ZL-Mi; Thu, 28 Jan 2010 13:47:01 -0500 X-Loop: bug-gnu-emacs@gnu.org Resent-From: Nil Geisweiller Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Jan 2010 18:47:01 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-Emacs-PR-Message: report 5488 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.126470439021378 (code B ref -1); Thu, 28 Jan 2010 18:47:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 28 Jan 2010 18:46:30 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NaZNt-0005Yl-AQ for submit@debbugs.gnu.org; Thu, 28 Jan 2010 13:46:29 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NaZMq-0005XB-T1 for submit@debbugs.gnu.org; Thu, 28 Jan 2010 13:45:25 -0500 Original-Received: from mail.gnu.org ([199.232.76.166]:44084 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NaZMl-0004ky-RN for submit@debbugs.gnu.org; Thu, 28 Jan 2010 13:45:19 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NaZMk-0006l7-6i for submit@debbugs.gnu.org; Thu, 28 Jan 2010 13:45:19 -0500 Original-Received: from lists.gnu.org ([199.232.76.165]:45051) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NaZMj-0006kz-Us for submit@debbugs.gnu.org; Thu, 28 Jan 2010 13:45:18 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NaZMj-0007iP-9L for bug-gnu-emacs@gnu.org; Thu, 28 Jan 2010 13:45:17 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NaZMe-0007aq-7D for bug-gnu-emacs@gnu.org; Thu, 28 Jan 2010 13:45:16 -0500 Original-Received: from [199.232.76.173] (port=45082 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NaZMe-0007aV-0R for bug-gnu-emacs@gnu.org; Thu, 28 Jan 2010 13:45:12 -0500 Original-Received: from mx20.gnu.org ([199.232.41.8]:64729) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NaZMd-0006jD-Ka for bug-gnu-emacs@gnu.org; Thu, 28 Jan 2010 13:45:11 -0500 Original-Received: from mail-ew0-f224.google.com ([209.85.219.224]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NaZMc-00034r-8I for bug-gnu-emacs@gnu.org; Thu, 28 Jan 2010 13:45:10 -0500 Original-Received: by ewy24 with SMTP id 24so1082565ewy.26 for ; Thu, 28 Jan 2010 10:45:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=SwbWzzclDbSNfmOngPadUf4ReHjCGK94FBuDK5VCy54=; b=inhoNR90nNdLD3xxth+5DzqBX/DjoIKbm/iWV4rCR87ACcDH2eJRhU3KzzXnJ6Xnmr CjKTWXycSIQlRWYp1gyoxw6xo0rZh9kZbVP0M4X4bB6na73ZKv3rYOJxdiyE22tZFgA2 aqFoomUCumrOEuTLf1AWVKorcUUfZndtyiVlE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=djoabQ24IDPr/2ewbLF82YdQpofZAHOO9LjhT10/LbWJ5g+cU194h35C4eCylSjrPs GJX5aY0hT02QbRaasEp6+J5iMumvBo9LB4HKpdapAUv7niQEeJcZ/ojkGRZVT1WTtlPA D0sdSKjIzzhfP/tcZfBxN+f39GhSER32ID8+Q= Original-Received: by 10.213.46.12 with SMTP id h12mr4067216ebf.39.1264704308234; Thu, 28 Jan 2010 10:45:08 -0800 (PST) X-detected-operating-system: by mx20.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -5.9 (-----) X-Mailman-Approved-At: Thu, 28 Jan 2010 13:46:27 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list X-Spam-Score: -5.9 (-----) Resent-Date: Thu, 28 Jan 2010 13:47:01 -0500 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-Mailman-Approved-At: Thu, 28 Jan 2010 14:30:23 -0500 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:34777 Archived-At: 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