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: Problems with syntax-ppss: Was [... Apply `comment-depth' text properties when calling `back_comment'.] Date: Fri, 11 Mar 2016 23:08:55 +0000 Message-ID: <20160311230855.GI2888@acm.fritz.box> References: <20160310130156.GA4831@acm.fritz.box> <20160310152949.GB4831@acm.fritz.box> <20160310172539.GC4831@acm.fritz.box> <20160310190824.GD4831@acm.fritz.box> <20160311204817.GF2888@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 1457737595 5107 80.91.229.3 (11 Mar 2016 23:06:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 11 Mar 2016 23:06:35 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 12 00:06:28 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 1aeW8X-0000Lz-AA for ged-emacs-devel@m.gmane.org; Sat, 12 Mar 2016 00:06:25 +0100 Original-Received: from localhost ([::1]:58149 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aeW8W-0002op-F5 for ged-emacs-devel@m.gmane.org; Fri, 11 Mar 2016 18:06:24 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33122) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aeW8T-0002of-BN for emacs-devel@gnu.org; Fri, 11 Mar 2016 18:06:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aeW8Q-0008WR-4q for emacs-devel@gnu.org; Fri, 11 Mar 2016 18:06:21 -0500 Original-Received: from mail.muc.de ([193.149.48.3]:64444) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aeW8P-0008WC-T0 for emacs-devel@gnu.org; Fri, 11 Mar 2016 18:06:18 -0500 Original-Received: (qmail 32991 invoked by uid 3782); 11 Mar 2016 23:06:15 -0000 Original-Received: from acm.muc.de (p579E8E6B.dip0.t-ipconnect.de [87.158.142.107]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 12 Mar 2016 00:06:14 +0100 Original-Received: (qmail 7329 invoked by uid 1000); 11 Mar 2016 23:08:55 -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:201507 Archived-At: Hello, Stefan. On Fri, Mar 11, 2016 at 05:35:05PM -0500, Stefan Monnier wrote: > > OK. It wouldn't compile, so I had to correct it a little bit. > Hmm... I've seen your arrows but they weren't sufficient to make me see > what it was you needed to change. > > ............" "...." /* "...." */ /* */ /* */ > > | | | > > point-min return value of syntax-ppss pos > Give me a non-artificial recipe where this happens, and I'll think about > how it should best be solved. No. (forward-comment -n) must work with any comments, artificial or not. Here's a line out of a C file to help with your testing: char foo[] = "asdf asdf" "asdf"; /* "asdf" */ /* */ /* '"'" */ ^ . Narrow the buffer so that point-min is at the indicated position, then try to get (forward-comment -1) from EOL working. But it won't help you much. On calling syntax-ppss, find_defun_start cannot know whether point-min is inside a string or not. When it is, the parse state returned is useless. Like I keep telling you, syntax-ppss is not suitable for use in back_comment. Sooner or later, you must come to accept that I am right. All the time, my new code in branch comment-cache copes with the above situation, and all other situations, without difficulty. > Stefan -- Alan Mackenzie (Nuremberg, Germany).