[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: CC Mode and electric-pair "problem".
From: |
João Távora |
Subject: |
Re: CC Mode and electric-pair "problem". |
Date: |
Thu, 31 May 2018 19:37:22 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Alan Mackenzie <address@hidden> writes:
> Hello, João
>
> On Thu, May 31, 2018 at 17:07:43 +0100, João Távora wrote:
>> ( " \n " ) EOF
>
> I think you mean " ( \n ) " EOF. :-)
Right :)
> Yes. A string in C(++) mode extending over several lines is only valid
> when the newlines are escaped. The generic string syntax is partly an
> artifice to get font-lock-warning-face, but is also deliberately
> intended to cut the opener of the invalid string off from any subsequent
> double quote.
But is there another goal here, apart from the goal of visually
annotating the error?
If the intent is only to annotate the error visually, I'd rather leave
that to something like Flymake. Admiteddly, it's not practical now,
since Flymake usually works by running the whole buffer through an
external syntax check tool, which may take ages compared to using syntax
hints from within emacs.
But that could be changed, my goal is to let Flymake call backends with
only recently changed parts of the buffer, and a much faster
syntax-checking backend could be devised.
Which reminds me, I never did get an answer to
https://lists.gnu.org/archive/html/emacs-devel/2017-10/msg00448.html
did I?
> OK. I'll need to mull this over.
OK, do. If you come to the conclusion that it is very important, and
when the code becomes stable, I can can increase the complexity of
elec-pair.el a bit to make it work in c++-mode.
BTW do all cc-based modes "forbid" multi-line strings?
>> c-append-to-state-cache: Scan error: "Unbalanced parentheses", 5, 1
>
> I don't see this at all. For me, that sequence of actions simply works,
> without signalling an error. This was on the master branch as I
> committed my change today.
Things moves fast :-) I running a master without your commit from around
noon. I can't reproduce it now either, good job.
João
- Re: [Emacs-diffs] master bb591f139f: Enhance CC Mode's fontification, etc., of unterminated strings., (continued)
- Re: [Emacs-diffs] master bb591f139f: Enhance CC Mode's fontification, etc., of unterminated strings., Eli Zaretskii, 2018/05/22
- Re: [Emacs-diffs] master bb591f139f: Enhance CC Mode's fontification, etc., of unterminated strings., João Távora, 2018/05/22
- Re: [Emacs-diffs] master bb591f139f: Enhance CC Mode's fontification, etc., of unterminated strings., João Távora, 2018/05/22
- Re: [Emacs-diffs] master bb591f139f: Enhance CC Mode's fontification, etc., of unterminated strings., Eli Zaretskii, 2018/05/23
- Re: [Emacs-diffs] master bb591f139f: Enhance CC Mode's fontification, etc., of unterminated strings., Alan Mackenzie, 2018/05/23
- Re: [Emacs-diffs] master bb591f139f: Enhance CC Mode's fontification, etc., of unterminated strings., João Távora, 2018/05/23
- Re: [Emacs-diffs] master bb591f139f: Enhance CC Mode's fontification, etc., of unterminated strings., Michael Welsh Duggan, 2018/05/23
CC Mode and electric-pair "problem". (Was: ... master bb591f139f: Enhance CC Mode's fontification, etc., of unterminated strings.), Alan Mackenzie, 2018/05/31