From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jordon Biondo Newsgroups: gmane.emacs.bugs Subject: bug#18378: [Patch] wrong fontification of Java code Date: Mon, 1 Sep 2014 15:20:30 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1409599289 30532 80.91.229.3 (1 Sep 2014 19:21:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 1 Sep 2014 19:21:29 +0000 (UTC) To: 18378@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 01 21:21:21 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XOXAG-0006y9-8n for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Sep 2014 21:21:20 +0200 Original-Received: from localhost ([::1]:33640 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOXAF-0001TO-Ca for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Sep 2014 15:21:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOXA6-0001SQ-Di for bug-gnu-emacs@gnu.org; Mon, 01 Sep 2014 15:21:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XOXA0-00023U-En for bug-gnu-emacs@gnu.org; Mon, 01 Sep 2014 15:21:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36096) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOXA0-00023Q-Af for bug-gnu-emacs@gnu.org; Mon, 01 Sep 2014 15:21:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XOX9z-0003Pk-V5 for bug-gnu-emacs@gnu.org; Mon, 01 Sep 2014 15:21:04 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Jordon Biondo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Sep 2014 19:21:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18378 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18378-submit@debbugs.gnu.org id=B18378.140959924213057 (code B ref 18378); Mon, 01 Sep 2014 19:21:03 +0000 Original-Received: (at 18378) by debbugs.gnu.org; 1 Sep 2014 19:20:42 +0000 Original-Received: from localhost ([127.0.0.1]:55887 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XOX9d-0003OV-TB for submit@debbugs.gnu.org; Mon, 01 Sep 2014 15:20:42 -0400 Original-Received: from mail-ie0-f169.google.com ([209.85.223.169]:46990) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XOX9a-0003OH-59 for 18378@debbugs.gnu.org; Mon, 01 Sep 2014 15:20:40 -0400 Original-Received: by mail-ie0-f169.google.com with SMTP id tr6so6614703ieb.28 for <18378@debbugs.gnu.org>; Mon, 01 Sep 2014 12:20:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:content-transfer-encoding:subject:message-id:date :to:mime-version; bh=KyE2B+hscIYi6jsPPd7Y9L79A3WkIDueSqJlKQnW0xU=; b=svX1NbSdrzLVDtaYBsdUrCirB1Aa4RR9W74DPK33NHRcUi2KJEuSlFJ24L875wf3gR al+9SJv1fmpyoKD2f2UHJkGQ7anVRjAFBW+oM7hGiq4OtTPEaVS6M+HGZpFOi7FKvDX3 B0Jjp1N/AVcJU/EE5h89PivIAAnIYGOQ/3X9eYppbNv39+FBgduaqOnsOBWIBuFXUdhK HocN6sWO01GgBuq8wt+hmxVp5oKSurK02LQyaOPPDOdV18u6jIdSolIwGcXd57oSHy9t QLP3k+Q4XQdWJcSFkZtTV65FeT7YNXxX0r9+qPgojnROpDurGRaoPAqX3C59Fg/jDXb4 l1WA== X-Received: by 10.50.36.38 with SMTP id n6mr23312487igj.24.1409599232497; Mon, 01 Sep 2014 12:20:32 -0700 (PDT) Original-Received: from [192.168.0.4] ([216.150.236.84]) by mx.google.com with ESMTPSA id ky8sm30734034igb.16.2014.09.01.12.20.31 for <18378@debbugs.gnu.org> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Sep 2014 12:20:31 -0700 (PDT) X-Mailer: Apple Mail (2.1878.2) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:92934 Archived-At: I have a potential solution for this bug, as it has impacted me as well. Not sure what the best solution would be but I have included a patch = that does solve the problem. =46rom what I can tell there are no tests = for java fortification but I have not seen any issues arising in my own = java projects. The issue was that in java, a =93:=94 can mark the end of = a declaration in a foreach, not just a =93;=94 or =93,=94. =3D=3D=3D modified file 'lisp/ChangeLog' *** lisp/ChangeLog 2014-09-01 15:03:45 +0000 --- lisp/ChangeLog 2014-09-01 19:11:46 +0000 *************** *** 1,3 **** --- 1,8 ---- + 2014-09-01 Jordon Biondo +=20 + * progmodes/cc-fonts.el (c-font-lock-declarators): Special + case for declarations inside Java foreach loops (Bug#18378) +=20 2014-09-01 Eli Zaretskii =20 * ls-lisp.el (ls-lisp-use-string-collate) =3D=3D=3D modified file 'lisp/progmodes/cc-fonts.el' *** lisp/progmodes/cc-fonts.el 2014-08-24 20:50:11 +0000 --- lisp/progmodes/cc-fonts.el 2014-09-01 19:11:59 +0000 *************** casts and declarations are fontified. U *** 1116,1123 **** ;; initializing brace lists. (let (found) (while ! (and (setq found (c-syntactic-re-search-forward ! "[;,]\\|\\s)\\|\\'\\|\\(=3D\\|\\s(\\)" = limit t t)) (eq (char-before) ?\[) (c-go-up-list-forward)) (setq brackets-after-id t)) --- 1116,1128 ---- ;; initializing brace lists. (let (found) (while ! (and (setq found (c-syntactic-re-search-forward ! (concat = "[;,]\\|\\s)\\|\\'\\|\\(=3D\\|" ! (if (c-major-mode-is = 'java-mode) ! ":\\|" ! "") ! "\\s(\\)") ! limit t t)) (eq (char-before) ?\[) (c-go-up-list-forward)) (setq brackets-after-id t))