emacs-devel
[Top][All Lists]
Advanced

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

Re: Syntax ambiguities in narrowed buffers and multiple major modes: a p


From: Stefan Monnier
Subject: Re: Syntax ambiguities in narrowed buffers and multiple major modes: a proposed solution.
Date: Sat, 25 Feb 2017 14:42:06 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Sounds fairly close to some of the ideas I toyed with.
Here are a few comments:

>   o - Ambiguity involved with narrowed regions - sometimes programs and
>     users wish to see syntactic entities (e.g. strings, comments) as
>     though point-min were a syntactically neutral position - other times
>     they want the syntax to be relative to the beginning of the buffer.

I don't think this need is very serious for users.
So, I think we should focus on those cases where this is used by Elisp code.

>   o - There will be two new syntax classes introduced for use in syntax
>     table text properties: "island open" and "island close".  Together,
>     these enclose an "island", a region of the buffer syntactically
>     disjoint from the text outside of the region.

[ I like to consider that strings and comments are also a form of
  "island", although we're probably better off supporting them in
  a special way like we do now.  ]

I think we should try not to limit ourselves to nesting of islands.
IOW, we should strive to find a design where a single char can close an
island and open another one.

>   o - narrow-to-region will be given an optional argument which, if set,
>     directs Emacs to make the new region an island.  Thus, C-u C-x n n
>     would enable a user to narrow to a "comment within a string" and edit
>     it as though it were a comment.

How would this work (especially for uses from Elisp)?
Would it set syntax-table text-properties?


        Stefan




reply via email to

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