emacs-devel
[Top][All Lists]
Advanced

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

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


From: Alan Mackenzie
Subject: Re: RFR cc-langs.el: change syntax for @ in Java
Date: Thu, 8 Apr 2021 09:29:10 +0000

Hello, Fillip.

On Wed, Apr 07, 2021 at 23:41:09 +0300, Filipp Gunbin wrote:
> 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).

Do you have a specific test case where things go wrong at the moment, or
work better with the change in place?

I'll run the CC Mode test suite with this change to see how it goes.  It
might entail changes to functions like c-forward-decl-or-cast-1.

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

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

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