From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Filipp Gunbin Newsgroups: gmane.emacs.devel Subject: RFR cc-langs.el: change syntax for @ in Java Date: Wed, 07 Apr 2021 23:41:09 +0300 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25971"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Apr 07 22:43:09 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lUF13-0006ee-P1 for ged-emacs-devel@m.gmane-mx.org; Wed, 07 Apr 2021 22:43:09 +0200 Original-Received: from localhost ([::1]:48780 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lUF12-0001Lv-Mv for ged-emacs-devel@m.gmane-mx.org; Wed, 07 Apr 2021 16:43:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34708) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUEzJ-0000RJ-NU for emacs-devel@gnu.org; Wed, 07 Apr 2021 16:41:21 -0400 Original-Received: from out5-smtp.messagingengine.com ([66.111.4.29]:41517) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUEzG-0006th-3Z for emacs-devel@gnu.org; Wed, 07 Apr 2021 16:41:21 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id C65925C00C2; Wed, 7 Apr 2021 16:41:12 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 07 Apr 2021 16:41:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= from:to:cc:subject:date:message-id:mime-version:content-type; s= fm2; bh=4zFXqoCI5ZumiiTmzfDEm5DNn6zjHMZFeay30wGteHI=; b=HPW+easc 49TfYTSUXeEwAC7Zo+Vv63xXmmnLopxEg3nXsH6NbBWx1GQyP35Dto8OyXGZNnaK 2l1RHNEY/b65emWxrP9kKjnf1zU8MwHyosSKraGrATtYU5+bkldc2M7a2aMCS5qP OfD0aiTp8HxkjOkbNf1UIFmBci4IGFZKxXcIPgBPHZIQa9nzvuIT2Va+uG0jVg51 8QgVQJiZql8W3qZKxETeMX1emmUUP+zZiOhk4AOtppfPy9VYZPJ+sSMTR7NHdtVr hY/KP66MHJDwZXEKxmo+4KgiDIsug+eqVJduoJ45WcEocZVIl7Rnj9qat/Cns5XT I7n4SU4qh8ucWQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=4zFXqoCI5ZumiiTmzfDEm5DNn6zjH MZFeay30wGteHI=; b=PRupbW9+ZkmXOUfrpGO5yoC0r0/hN0LEgrzmOib/l1r3y m2FVuaH6Jla49vuVW2IELqxjr6uwltm+6Vs1lXCgoalIkLP4YK4RbuLv9vUZBdD3 onuFQhAOZW6pIvsfZBYrIo+wnvoaZUE+RpL9ygnxf0bOWjYwq1jMJ0HsUmXaW07v a4yBAaTC5ioWS/Mlbp+RTl0w/xQcUK8RlboBa/v8y4h807ujN+jOs7AiCvhIE+Am S7O3LHcO51zIbrZJZmy1LOZV9uKB282xV4Y0hXSSaZuxlP5KsU7YOL+IFZIpCfAJ yADo2wg05VEAakRSXZtruvgbzQomL3yyipaQhOdpA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudejjedgudehgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkfggtgesthdtredttd dttdenucfhrhhomhephfhilhhiphhpucfiuhhnsghinhcuoehfghhunhgsihhnsehfrghs thhmrghilhdrfhhmqeenucggtffrrghtthgvrhhnpedvgeeifffgueeugfeuieehueefie fgveevvdegveelleeugfejhfejgfevhfetudenucfkphepkeegrddvtdegrdduleefrddu tdeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepfh hguhhnsghinhesfhgrshhtmhgrihhlrdhfmh X-ME-Proxy: Original-Received: from fgunbin.local (unknown [84.204.193.106]) by mail.messagingengine.com (Postfix) with ESMTPA id AFC781080068; Wed, 7 Apr 2021 16:41:11 -0400 (EDT) Mail-Followup-To: Alan Mackenzie , emacs-devel@gnu.org Received-SPF: pass client-ip=66.111.4.29; envelope-from=fgunbin@fastmail.fm; helo=out5-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:267574 Archived-At: Hi Alan, are you ok if I make this small change? Prefix is better syntax for @ in Java, because it just denotes that the following is an annotation interface name (but is not part of it). Thanks. Filipp diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index fa4e73087e..e2c1c6099f 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -378,12 +378,14 @@ c-make-mode-syntax-table (let ((table (make-syntax-table))) (c-populate-syntax-table table) ;; Mode specific syntaxes. - ,(cond ((or (c-major-mode-is 'objc-mode) (c-major-mode-is 'java-mode)) + ,(cond ((c-major-mode-is 'objc-mode) ;; Let '@' be part of symbols in ObjC to cope with ;; its compiler directives as single keyword tokens. ;; This is then necessary since it's assumed that ;; every keyword is a single symbol. '(modify-syntax-entry ?@ "_" table)) + ((c-major-mode-is 'java-mode) + '(modify-syntax-entry ?@ "'" table)) ((c-major-mode-is 'pike-mode) '(modify-syntax-entry ?@ "." table))) table)))