From 57347554a13de87eb519cbe49ce718b4bb929d91 Mon Sep 17 00:00:00 2001 From: Filipp Gunbin Date: Wed, 14 Apr 2021 19:27:00 +0000 Subject: [PATCH] Java Mode: Change the syntax of character @ to prefix syntax lisp/progmodes/cc-langs.el (c-make-mode-syntax-table): Change the syntax of @ as indicated. --- lisp/progmodes/cc-langs.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 28a15654277..4c5d043593c 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -378,12 +378,14 @@ The syntax tables aren't stored directly since they're quite large." (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))) -- 2.39.5