emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RFR cc-langs.el: change syntax for @ in Java


From: Filipp Gunbin
Subject: RFR cc-langs.el: change syntax for @ in Java
Date: Wed, 07 Apr 2021 23:41:09 +0300

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)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]