From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Andreas_R=c3=b6hler?= Newsgroups: gmane.emacs.devel Subject: Re: forward-comment and syntax-ppss Date: Fri, 9 Dec 2016 08:39:21 +0100 Message-ID: <35fc3a3e-90ea-01f8-6fa5-a528b97003d9@online.de> References: <20161206195507.GA2996@acm.fritz.box> <83fd1db0-7362-6117-c5cd-715398c0dea4@gmail.com> <20161207220447.GA4503@acm.fritz.box> <20161208201517.GB3120@acm.fritz.box> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1481268667 19668 195.159.176.226 (9 Dec 2016 07:31:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 9 Dec 2016 07:31:07 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Icedove/45.4.0 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 09 08:30:51 2016 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 1cFFdp-0002l5-Ig for ged-emacs-devel@m.gmane.org; Fri, 09 Dec 2016 08:30:49 +0100 Original-Received: from localhost ([::1]:44936 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cFFdr-0003Kp-U0 for ged-emacs-devel@m.gmane.org; Fri, 09 Dec 2016 02:30:51 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46861) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cFFdG-0003EI-1X for emacs-devel@gnu.org; Fri, 09 Dec 2016 02:30:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cFFdC-0004X4-BC for emacs-devel@gnu.org; Fri, 09 Dec 2016 02:30:14 -0500 Original-Received: from mout.kundenserver.de ([212.227.126.135]:49895) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cFFdC-0004Sj-0d for emacs-devel@gnu.org; Fri, 09 Dec 2016 02:30:10 -0500 Original-Received: from [192.168.178.35] ([77.12.165.196]) by mrelayeu.kundenserver.de (mreue002 [212.227.15.167]) with ESMTPSA (Nemesis) id 0LisgQ-1cmvUB2mvG-00dDBB for ; Fri, 09 Dec 2016 08:30:05 +0100 In-Reply-To: X-Provags-ID: V03:K0:uiz7ber5d1FYHbxza1qBYz2e70ktLa/CSpm+XE6D45CQZNZDfVl dcRNnVwmzMoXmYPMK23HwfsmqG+XZo0LdqNr2xHG8u9T8QpXpPGDXpS3psFJ3MpsXutLWw8 TIPhL5QTvp5OQcPRng9Iei+w5RUbxeYJVELcJV8wmQVQZ4WdU90577ApFBpvh1AtQyr/4jY LpLkJy36qxRQFo7uSvnlQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:Wl31gA9mnq8=:Y3cIe6uD3Ot7a8jv2y7CmZ 8+Y0/r14VSLLpY1l0k7V3cXCg/YNANbvzM/olQD3N72jyZUN7+E/Prn6tsW/7EBVuNcx6Iz45 1I2p57sVltSWSzNpVtRfU+drZWDzvlBP5eiHckZDHxf7eZL5hIHeIEy0oCw6DOcSczHDsSYpz sAQL8RhM1GBFONL3u7TWoefQSErTeGQgmlGHAul6SC7114lq+M7YkHDYFYOIVvS4qR8Vb52Xw CxWWXG8DGVoG4g3JPkMlkfj27v5QzblGLwEP2xaOxu0Mqu5e2DOK61+X3iMSYTqpLBSmmm+yr xh/qdSrhwb9i1NR7znD5HSQAtLEQ+JNz/CI9c7UQx8TRGC9ECYPVIU61eDQ6nwxqhsw/ILBtM CvUmXAfjYQhYJZLVCjf5/jHTKG5U4PSmMX6mx5x7RFnoYwT/c/dgngzZBiiQdChZ5REnyGZKv cHOeT6XQIp6txy6CBlWnhmnpSABrjqswJD3qyfizRCNQh984Kj/cWJrxQAEAjY02CNcfHrtaS nmcg3uWXYFde1N1oLYvjQmdPZfc3aF6W1nLP7RZ6KlPLVPneBsDTAwTizqIaMNudVjElPU1jm mPe7zOZsu21JrhTs6odIpUvpOr2o0OFeIaJb/soFOugfZviYXTeYfFCWId8qMqpXx1R8uDMAo 0JlUZF1Ut+83ehxLGA0n6GWDHSsLhyiYuqSnapDxNkzI0i5K7kTUWIn9hrru3Hd0a9kwLeodW GGlwuBdfOhiP7QpS X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.135 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:210168 Archived-At: On 08.12.2016 22:47, Stefan Monnier wrote: >> Can parse-partial-sexp parse backwards? > No. Two reasons: one is that we don't have code that (attempts to) > do(es) that, the other is that it's fundamentally difficult/impossible > to do it reliably. > > More specifically, the patch "forward-comment and syntax-ppss" is > specifically handling a case where we really don't know how to parse > backward: when moving backward, forward-comment generally tries to find > the beginning of a comment by "parsing backward", but in some cases it > really can't figure it out and (currently) resorts to calling > (parse-partial-sexp (point-min) POS). Another argument why syntax-ppss shouldn' t be used at all, thanks. > Since it may potentially do that > for every "comment-end" marker it finds (e.g. every \n in most major > modes), there are pathological cases where the performance in large > buffers can become really poor, hence the need for a cache. > > Performance of parse-partial-sexp was very fast in its original design. May our masters of circular dependencies have managed to slow it down? At any case: the question is, if you need the info from point-min. If yes, there is not other way than calling it from there. If not, don't ask for it, give a nearer boundary.