emacs-devel
[Top][All Lists]
Advanced

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

Re: emacs rendering comparisson between emacs23 and emacs26.3


From: Dmitry Gutov
Subject: Re: emacs rendering comparisson between emacs23 and emacs26.3
Date: Tue, 7 Apr 2020 15:52:14 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

On 07.04.2020 11:32, martin rudalics wrote:
It depends on what we consider a failure: I do not think that inserting
a "/*" in my window showing the top of my C buffer should cause the
window showing the bottom of my buffer consider everything part of a
comment starting at that "/*".  I think that the comment should stop at
the first paren in column zero after that "/*" even if that paren is
shown in the window showing the top of the buffer and even if that's
syntactically wrong (and hence the compiler would see it differently).

To be accurate, the comment started by '/*' would end at the first occurrence of '*/' somewhere down the buffer.

If you insert or close a paren, however, that would definitely change syntax state at EOB.

The former case is possible to support better in syntax-ppss, FWIW. The latter we probably never will (in syntax-ppss).

So what I would vote for in this case is that font-lock would specially
highlight the open paren that "stops seeing the comment as comment" so
the user is aware of the fact.  Would that be so hard to implement?
Even with a slight change in 'parse-partial-sexp' and 'syntax-ppss' that
would accompany it.  Optionally, by default turned off, so nobody who
wants the correct syntactic interpretation would be bothered.

According to Alan's experiment, you can get this behavior now already simply by setting comment-use-syntax-ppss to nil and open-paren-in-column-0-is-defun-start to t.

Does it improve your experience significantly?



reply via email to

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