From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] comment-cache 223d16f 2/3: Apply `comment-depth' text properties when calling `back_comment'. Date: Wed, 9 Mar 2016 17:48:16 +0000 Message-ID: <20160309174816.GE3948@acm.fritz.box> References: <20160308132530.861.91488@vcs.savannah.gnu.org> <20160308183010.GB6269@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1457545787 7434 80.91.229.3 (9 Mar 2016 17:49:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 9 Mar 2016 17:49:47 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Richard Stallman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 09 18:49:32 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1adiEk-00061i-Ua for ged-emacs-devel@m.gmane.org; Wed, 09 Mar 2016 18:49:31 +0100 Original-Received: from localhost ([::1]:43148 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adiEk-0001kK-Gw for ged-emacs-devel@m.gmane.org; Wed, 09 Mar 2016 12:49:30 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40876) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adiB7-0004IZ-4b for emacs-devel@gnu.org; Wed, 09 Mar 2016 12:45:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1adiB3-0002YW-9h for emacs-devel@gnu.org; Wed, 09 Mar 2016 12:45:45 -0500 Original-Received: from mail.muc.de ([193.149.48.3]:39859) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adiB3-0002YJ-1T for emacs-devel@gnu.org; Wed, 09 Mar 2016 12:45:41 -0500 Original-Received: (qmail 85998 invoked by uid 3782); 9 Mar 2016 17:45:40 -0000 Original-Received: from acm.muc.de (p548A46A1.dip0.t-ipconnect.de [84.138.70.161]) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 09 Mar 2016 18:45:38 +0100 Original-Received: (qmail 11710 invoked by uid 1000); 9 Mar 2016 17:48:16 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) 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 X-Received-From: 193.149.48.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:201262 Archived-At: Hello, Richard. On Wed, Mar 09, 2016 at 11:37:52AM -0500, Richard Stallman wrote: > [[[ To any NSA and FBI agents reading my email: please consider ]]] > [[[ whether defending the US Constitution against all enemies, ]]] > [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > > My changes might speed up back_comment, but that's not the prime reason > > for them. Rather, I want utterly to expunge all the nonsense about > > parens in column 0. > You might think of this rule as a kludgy rough approximation finding > the defuns in the file. But it is also a useful way of controlling > what count as defuns. For instance, > (eval-when-compile > (defun foo ...) > (defun bar...) > ) > treats foo and bar as defuns, whereas > (eval-when-compile > (defun foo ...) > (defun bar...) > ) > treats the whole thing as one defun. Thanks for the tip! > I always want the former. I suppose I do, too. > Without the open-paren-in-column-0 feature, the whole > eval-when-compile form would have to count as one defun, and the user > would have no choice about that. > Thus, before you talk about "fixing" this, would you please > state what behavior you want to implement? That moving backwards over comments and strings will do the Right Thing, even when those literals contain parentheses in column 0. Currently, problems happen frequently when somebody inadvertantly puts a paren in C0, usually in a comment, and this wreaks havoc with indentation and fontification, etc., because (e.g.) CC Mode handles part of the comment as though it were code. The latest problem, found and reported by Paul Eggert as bug #22884, was in a config.h, and a comment near the start, containing the license statement, started a line with "(at your option)". The consequence of this was editing a comment on Line 1661 took ~10 seconds for the edit to echo. Just for information, I've already implemented the behaviour, putting it into a new git branch called "comment-cache". It is a matter for testing and experience whether this change will be merged into the master branch. The edit that previously took 10s is now instantaneous. However, open-paren-in-column-0-is-defun-start still exists in this version, just that the low level syntactic routines no longer need to use it. Trying out C-M-a on your eval-when-compile, it still jumps to the (defun foo ...). :-) However, on setting open-paren-...-start to nil, the C-M-a moved to the (eval-when-compile). So, yes, it would seem that open-paren-...-start is still useful, and so should survive. > If it makes the right thing happen automatically in some cases > and doesn't make the wrong thing start to happen in other cases, > it could be an improvement. But let's see it and verify that. Well, to me, it's clearly an improvement (I maintain CC Mode). But I only committed the new code yesterday, and so far there's been no feedback from anybody else who's tried it. So, when I said "expunge all the nonsense about parens in column zero", let's take it I meant "from the low level syntactic routines". :-) > -- > Dr Richard Stallman > President, Free Software Foundation (gnu.org, fsf.org) > Internet Hall-of-Famer (internethalloffame.org) > Skype: No way! See stallman.org/skype.html. -- Alan Mackenzie (Nuremberg, Germany).