From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: emacs rendering comparisson between emacs23 and emacs26.3 Date: Tue, 07 Apr 2020 23:48:04 -0400 Message-ID: References: <83k12zz6ds.fsf@gnu.org> <054393f3-3873-ab6e-b325-0eca354d8838@gmx.at> <20200403174757.GA8266@ACM> <20200405111623.GB5049@ACM> <20200406121449.GB7100@ACM> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="52755"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: acm@muc.de, eliz@gnu.org, rrandresf@gmail.com, emacs-devel@gnu.org, rudalics@gmx.at To: Richard Stallman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Apr 08 05:48:55 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jM1hu-000DfH-RA for ged-emacs-devel@m.gmane-mx.org; Wed, 08 Apr 2020 05:48:54 +0200 Original-Received: from localhost ([::1]:55680 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jM1ht-00020Q-UH for ged-emacs-devel@m.gmane-mx.org; Tue, 07 Apr 2020 23:48:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42880) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jM1hK-0001Me-Bk for emacs-devel@gnu.org; Tue, 07 Apr 2020 23:48:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jM1hJ-0000o4-1V for emacs-devel@gnu.org; Tue, 07 Apr 2020 23:48:17 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:54579) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jM1hH-0000mP-Fh; Tue, 07 Apr 2020 23:48:15 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id D08DA8122A; Tue, 7 Apr 2020 23:48:13 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id CC6F280D33; Tue, 7 Apr 2020 23:48:11 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1586317691; bh=IVn6SLfrUjXqAcUAcbghWcbv40GuJKfYwZrt9Iur7DM=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=FdSXQOLZW3y3MoLB4YQ2WiVD6XxlH3lWpAxnfTwNAk2XEDxEYEz7/eA9rpEK/U/RX +VaHN0Eq00UIjMSsJQVCmKuQZ+/+rx9BAXelksaxrfb/4pWAr+FnX6Jgtggxm5+OBa iM6YDMU0MXAHwgbwGDT53BKfpZQ+w0/KT3JHJyW2BZce7i0cGvF/XpEChZGzJB7MDA zGxkzTp0MfDF+/FD37XZXwO5glfhyJqKPa+zg7UW+aWqrGh5m9xuB1naZ9d9fu8+6F DAp1P6E6CwlR11hbAAGoYKCtiO0gW0tAwoE+McTE1OK+or4rF07O1VJ9PTSM7U52pH GwktxEAm6yYbA== Original-Received: from alfajor (unknown [104.247.241.114]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 4AE2C1208CF; Tue, 7 Apr 2020 23:48:11 -0400 (EDT) In-Reply-To: (Richard Stallman's message of "Tue, 07 Apr 2020 22:29:27 -0400") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 132.204.25.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:246634 Archived-At: > I found the open-paren-in-column-0 heuristic satisfactory because in > practice I saw that open-parens did not drift into column zero. Yes, it was a good heuristic when we needed one and when a heuristic was good enough. Nowadays it's not good enough any more. Users who experience a misbehavior because some "stray" open-paren in column-0 don't think "oh silly me, I shouldn't do that". Instead they think "Duh! Emacs is stupid!". > It presumes that the developers adopt the practice of indenting the > text of block comments, or can be persuaded to do so. What about those who can't or don't want to? Should Emacs provide poor behavior when open parens in column 0 occur for non-defuns? Should Emacs provide poor performance when the buffer doesn't have any open-parens in column 0 (as is the common case in many languages)? For these reasons, we came up with a different approach, not based on a heuristic. To make it work sufficiently efficiently it relies on caching. It's not always as efficient as the old heuristic, but on the average it is more efficient, in the worst case it's a bit less efficient, and in the best case it's a lot more efficient. OK, I've wasted enough time in this thread, so I'll stop here. I just recommend anyone who wants to hack on this problem to first do some careful profiling (both at the Elisp level and the C level). Then see if maybe the performance improvement that they're aiming for can't be obtained simply by optimizing syntax-ppss (e.g. it's a pretty simple code so it would not be hard to move it to C, if needed). Finally, I'd urge anyone who's not willing to spend this effort to stop arguing here about what they think should be done, because the likelihood that the profiler would prove them wrong is just much too high. Stefan