From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Syntax ambiguities in narrowed buffers and multiple major modes: a proposed solution. Date: Sat, 25 Feb 2017 14:42:06 -0500 Message-ID: References: <20170225135355.GA2592@acm> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1488051751 23524 195.159.176.226 (25 Feb 2017 19:42:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 25 Feb 2017 19:42:31 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 25 20:42:27 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1chiEd-0005W9-1S for ged-emacs-devel@m.gmane.org; Sat, 25 Feb 2017 20:42:27 +0100 Original-Received: from localhost ([::1]:44019 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1chiEi-00015Q-Vb for ged-emacs-devel@m.gmane.org; Sat, 25 Feb 2017 14:42:33 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35406) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1chiEb-000150-87 for emacs-devel@gnu.org; Sat, 25 Feb 2017 14:42:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1chiEX-0002IP-56 for emacs-devel@gnu.org; Sat, 25 Feb 2017 14:42:25 -0500 Original-Received: from [195.159.176.226] (port=34179 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1chiEW-0002IJ-UZ for emacs-devel@gnu.org; Sat, 25 Feb 2017 14:42:21 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1chiEL-0003vm-NM for emacs-devel@gnu.org; Sat, 25 Feb 2017 20:42:09 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 34 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:2vvPKpKyUZsTWrCD7A8zMngic7I= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:212598 Archived-At: 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