[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: scratch/fontify-open-string. [Was: CC Mode and electric-pair "proble
From: |
Stephen Leake |
Subject: |
Re: scratch/fontify-open-string. [Was: CC Mode and electric-pair "problem".] |
Date: |
Mon, 16 Jul 2018 22:41:19 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (windows-nt) |
Alan Mackenzie <address@hidden> writes:
> Hello, Stephen.
>
> Many thanks for trying out and testing this branch.
You're welcome; thanks for implementing it.
> I'm afraid I've found a rather large snag - there are backward moving
> commands and functions in Emacs which bypass proper syntax checking.
> For example, in the following in (the modified) shell-script-mode:
>
> 1. foo="Foo"
> 2. bar="Bar
> 3.
>
> , with point at BOL3, a C-M-b moves to the F, rather than "Bar.
>
> This is because (forward-comment -1) crashes into the "whitespace" at
> the end of L2 (the newline) rather than taking account of its syntax
> (the string closing flag).
>
> At the very least, the function back_comment (in src/syntax.c) will need
> to be modified to take account of such things, and in doing so, might as
> well become a function that also goes back over EOL-terminated strings,
> as Stefan suggested. This will be a lot of work.
>
> I fear there may be several, or even many, lisp functions in Emacs which
> may likewise need modifying.
>
> The root cause of this problem, in the abstract, is that Emacs attempts
> to scan backwards over strings and comments, which is only heuristically
> possible, rather than scanning forwards over the same constructs and
> remembering the endpoints.
>
> Right at the moment, I don't know how to proceed. Sorry.
I think you are opposed to syntax-ppss, but that does scan forward and
remember things; can we use that here?
--
-- Stephe
- Re: CC Mode and electric-pair "problem"., (continued)
- Re: CC Mode and electric-pair "problem"., Eli Zaretskii, 2018/07/01
- scratch/fontify-open-string. [Was: CC Mode and electric-pair "problem".], Alan Mackenzie, 2018/07/01
- Re: scratch/fontify-open-string. [Was: CC Mode and electric-pair "problem".], Stephen Leake, 2018/07/08
- Re: scratch/fontify-open-string. [Was: CC Mode and electric-pair "problem".], Stephen Leake, 2018/07/15
- Re: scratch/fontify-open-string. [Was: CC Mode and electric-pair "problem".], Eli Zaretskii, 2018/07/15
- Re: scratch/fontify-open-string. [Was: CC Mode and electric-pair "problem".], Alan Mackenzie, 2018/07/15
- Indentation of ?: in C-mode (was: scratch/fontify-open-string. [Was: CC Mode and electric-pair "problem".]), Stefan Monnier, 2018/07/15
- Re: Indentation of ?: in C-mode (was: scratch/fontify-open-string. [Was: CC Mode and electric-pair "problem".]), Eli Zaretskii, 2018/07/16
- Re: Indentation of ?: in C-mode, Stefan Monnier, 2018/07/16
- Re: scratch/fontify-open-string. [Was: CC Mode and electric-pair "problem".], Alan Mackenzie, 2018/07/15
- Re: scratch/fontify-open-string. [Was: CC Mode and electric-pair "problem".],
Stephen Leake <=
Re: CC Mode and electric-pair "problem"., Eli Zaretskii, 2018/07/01
Re: CC Mode and electric-pair "problem"., Paul Eggert, 2018/07/01
Re: CC Mode and electric-pair "problem"., Stephen Leake, 2018/07/06