From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stephen Leake Newsgroups: gmane.emacs.devel Subject: Re: scratch/fontify-open-string. [Was: CC Mode and electric-pair "problem".] Date: Mon, 16 Jul 2018 22:41:19 -0500 Message-ID: <864lgysf4w.fsf@stephe-leake.org> References: <20180627182717.GA4625@ACM> <20180630190327.GC6816@ACM> <83tvpkkr93.fsf@gnu.org> <20180630201447.GE6816@ACM> <83o9frkmk7.fsf@gnu.org> <20180701163825.GC4697@ACM> <86bmbiceq7.fsf@stephe-leake.org> <86lgacswk8.fsf@stephe-leake.org> <20180715165658.GB4897@ACM> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1531798803 12400 195.159.176.226 (17 Jul 2018 03:40:03 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 17 Jul 2018 03:40:03 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (windows-nt) To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 17 05:39:59 2018 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 1ffGqE-00036V-Hu for ged-emacs-devel@m.gmane.org; Tue, 17 Jul 2018 05:39:58 +0200 Original-Received: from localhost ([::1]:56933 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ffGsL-0004pb-8i for ged-emacs-devel@m.gmane.org; Mon, 16 Jul 2018 23:42:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55584) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ffGri-0004pW-GI for emacs-devel@gnu.org; Mon, 16 Jul 2018 23:41:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ffGrd-00019j-Ky for emacs-devel@gnu.org; Mon, 16 Jul 2018 23:41:30 -0400 Original-Received: from smtp121.iad3b.emailsrvr.com ([146.20.161.121]:53932) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ffGrd-00018h-Fg for emacs-devel@gnu.org; Mon, 16 Jul 2018 23:41:25 -0400 Original-Received: from smtp24.relay.iad3b.emailsrvr.com (localhost [127.0.0.1]) by smtp24.relay.iad3b.emailsrvr.com (SMTP Server) with ESMTP id 038074006F for ; Mon, 16 Jul 2018 23:41:22 -0400 (EDT) X-Auth-ID: board-president@tomahawk-creek-hoa.com Original-Received: by smtp24.relay.iad3b.emailsrvr.com (Authenticated sender: board-president-AT-tomahawk-creek-hoa.com) with ESMTPSA id C5FD440063 for ; Mon, 16 Jul 2018 23:41:21 -0400 (EDT) X-Sender-Id: board-president@tomahawk-creek-hoa.com Original-Received: from Takver4 (76-218-37-33.lightspeed.kscymo.sbcglobal.net [76.218.37.33]) (using TLSv1.2 with cipher AES256-GCM-SHA384) by 0.0.0.0:25 (trex/5.7.12); Mon, 16 Jul 2018 23:41:21 -0400 In-Reply-To: <20180715165658.GB4897@ACM> (Alan Mackenzie's message of "Sun, 15 Jul 2018 16:56:58 +0000") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 146.20.161.121 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:227492 Archived-At: Alan Mackenzie 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