From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Bug #25608 and the comment-cache branch Date: Sun, 5 Feb 2017 22:00:45 +0000 Message-ID: <20170205220045.GB2294@acm> References: <20170202202418.GA2505@acm> <83lgtouxpf.fsf@gnu.org> <20170202215154.GB2505@acm> <83h94bvhzw.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1486332084 25881 195.159.176.226 (5 Feb 2017 22:01:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 5 Feb 2017 22:01:24 +0000 (UTC) User-Agent: Mutt/1.7.2 (2016-11-26) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 05 23:01:18 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 1caUs1-0006NW-CE for ged-emacs-devel@m.gmane.org; Sun, 05 Feb 2017 23:01:17 +0100 Original-Received: from localhost ([::1]:44593 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1caUs7-0002CH-17 for ged-emacs-devel@m.gmane.org; Sun, 05 Feb 2017 17:01:23 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58030) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1caUrx-0002Az-CX for emacs-devel@gnu.org; Sun, 05 Feb 2017 17:01:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1caUru-0003AR-By for emacs-devel@gnu.org; Sun, 05 Feb 2017 17:01:13 -0500 Original-Received: from ocolin.muc.de ([193.149.48.4]:48367 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1caUru-00038W-65 for emacs-devel@gnu.org; Sun, 05 Feb 2017 17:01:10 -0500 Original-Received: (qmail 1321 invoked by uid 3782); 5 Feb 2017 22:01:04 -0000 Original-Received: from acm.muc.de (p548C6D48.dip0.t-ipconnect.de [84.140.109.72]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 05 Feb 2017 23:01:03 +0100 Original-Received: (qmail 11677 invoked by uid 1000); 5 Feb 2017 22:00:45 -0000 Content-Disposition: inline In-Reply-To: <83h94bvhzw.fsf@gnu.org> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.4 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:212006 Archived-At: Hello again, Eli. On Fri, Feb 03, 2017 at 09:41:23 +0200, Eli Zaretskii wrote: > > Date: Thu, 2 Feb 2017 21:51:54 +0000 > > From: Alan Mackenzie > > Cc: emacs-devel@gnu.org > > > I say there's too much resistance to doing that from people whose > > > opinions I respect and trust. Each time this issue comes up, I see > > > that resistance being expressed again. > > Primarily from Stefan. > Not only Stefan. Also Dmitry. > > > I hope it's possible to find some kind of compromise or a different > > > solution that leaves people less unhappy. > > Compromise with what? > With the objections, ideas, and suggestions expressed in those > discussions. (forward-comment -1), implemented by backward_comment in syntax.c is an essential part of Emacs. There are currently four contending ways for how this should be done: (i) The comment-cache branch ("CC"). (ii) The current master with open-paren-in-column-0-is-defun-start set to t (its default) ("M-t"). (iii) As (ii) but with o-p-i-c-0-i-d-s set to nil ("M-nil"). (iv) The "alternative patch" proposed by Stefan and advocated by Dmitry ("AP"). These four ways have the following characteristics: | Speed Direction of scanning Correct parsing ------------------------------------------------------------------------ CC | OK forwards yes M-t | OK backwards no [1] M-nil | Slow backwards probably [2] AP | OK backwards no [3] [1] M-t fails on comments containing parens in column zero. [2] M-nil depends on scanning comments backwards. It is believed to be correct, but it is difficult to be sure. [3] AP depends on syntax-ppss, which returns spurious values for narrowed buffers (bug #22983). A test case exists for which AP fails. By the above criteria, CC is the clear winner. CC is opposed by Stefan and Dmitry, if I understand correctly, because they think the type of action performed by CC should be done using syntax-ppss and no other way. Additionally, Dmitry has expressed some minor concern at the extra RAM used by CC, and Stefan has expressed some concern at how CC might affect multiple major modes in a single buffer. Right now, I am facing a tedious and quite difficult merge of master into comment-cache, necessitated by extensive changes in syntax.c since I last merged, back in December. Should I bother? I strongly believe that comment-cache is the best way for Emacs to do back_comment. As already said, I am not enthusiastic at continually having to field bugs with parens in column 0 inside comments, caused by the current buggy backward_comment. But I need your acceptance of comment-cache to go any further. It has taken a lot of my time to develop, and I am still hopeful of merging it into master. If there is a sound technical reason why it should be abandoned, that is fair enough. If it is rejected without such a reason, I will need to reconsider my relationship with Emacs. I am currently working (or "working") on several ambitious changes in Emacs. One of them is restructuring the byte compiler so that error and warning messages get the correct line number (bug #22288, etc.). If there is the prospect of these being rejected without good reason, I am not willing to take the risk of wasting my time on them. I would restrict my participation in Emacs to CC Mode and simple changes in the non-C part of Emacs which can be done in at most a very few hours. -- Alan Mackenzie (Nuremberg, Germany).