Subject: bug#40317: 27.0.90; Reverting a buffer that visits C file signals an error

From: Alan Mackenzie <[email-masked]>
Date: Sun, 20 Sep 2020 17:25:17 +0000

Hello, Damien.

On Wed, Sep 16, 2020 at 16:51:42 +0200, Damien Cassou wrote:
> Eli Zaretskii <[email-masked]> writes:
> > Does that happen with _any_ C# file?  If not, can you post an example
> > of a file where this happens, and a recipe to reproduce the problem?

> I don't know how to reproduce, it is infrequent and seems random.

What do you mean by "infrequent"?  Once a month, once a week, once a
day, several times a day?  Does it happen frequently enough that you
would notice if it stopped happening?  If so ....

csharp-mode has an inappropriate use of syntax-propertize-function,
which might be damaging things.  Could you please disable this with code
like the following in your .emacs (Note: this involves a minor loss of
functionality):

    (defun dc-spf-disable ()
      (setq syntax-propertize-function nil))
    (add-hook 'csharp-mode-hook 'dc-spf-disable)

And then see if the problem with csharp-mode still occurs, and report it
here, please.  Thanks!

> -- 
> Damien Cassou

> "Success is the ability to go from one failure to another without
> losing enthusiasm." --Winston Churchill

-- 
Alan Mackenzie (Nuremberg, Germany).