From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie <acm@muc.de> Newsgroups: gmane.emacs.devel Subject: Criticism of jit-lock--antiblink-post-command Date: Tue, 26 Nov 2019 19:52:36 +0000 Message-ID: <20191126195236.GA5104@ACM> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="128602"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org To: =?iso-8859-1?Q?Jo=E3o_T=E1vora?= <joaotavora@gmail.com> Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 26 20:54:21 2019 Return-path: <emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org> Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from <emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org>) id 1iZgui-000XHf-1Y for ged-emacs-devel@m.gmane.org; Tue, 26 Nov 2019 20:54:20 +0100 Original-Received: from localhost ([::1]:58562 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org>) id 1iZgug-0000gg-J3 for ged-emacs-devel@m.gmane.org; Tue, 26 Nov 2019 14:54:18 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38706) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <acm@muc.de>) id 1iZgtK-0000dD-Sy for emacs-devel@gnu.org; Tue, 26 Nov 2019 14:52:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <acm@muc.de>) id 1iZgtI-0001iL-Ky for emacs-devel@gnu.org; Tue, 26 Nov 2019 14:52:54 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:51495 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from <acm@muc.de>) id 1iZgtB-0001T9-Qc for emacs-devel@gnu.org; Tue, 26 Nov 2019 14:52:49 -0500 Original-Received: (qmail 31897 invoked by uid 3782); 26 Nov 2019 19:52:37 -0000 Original-Received: from acm.muc.de (p4FE158DE.dip0.t-ipconnect.de [79.225.88.222]) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 26 Nov 2019 20:52:36 +0100 Original-Received: (qmail 5187 invoked by uid 1000); 26 Nov 2019 19:52:36 -0000 Content-Disposition: inline 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.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." <emacs-devel.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-devel>, <mailto:emacs-devel-request@gnu.org?subject=unsubscribe> List-Archive: <https://lists.gnu.org/archive/html/emacs-devel> List-Post: <mailto:emacs-devel@gnu.org> List-Help: <mailto:emacs-devel-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-devel>, <mailto:emacs-devel-request@gnu.org?subject=subscribe> Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" <emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org> Xref: news.gmane.org gmane.emacs.devel:242748 Archived-At: <http://permalink.gmane.org/gmane.emacs.devel/242748> Hello, João. I've been taking a closer look at the jit-lock antiblink functionality, and some things seem to want comment. Firstly, jit-lock-antiblink-grace is tested for being nil, yet is declared in its customization scheme only as a number. Should it not alternatively be customizable to nil instead of a number? This would enable a user to disable it without having to read the source code and use a setq. The variable's doc string should surely also document this possibility. You have mentioned that this antiblink is redundant when using things like electric-pair-mode, in which case the mode merely slows down the processing. The same is true of CC Mode, where there are no unterminated strings. These are good reasons for making antiblink easy to disable. In jit-lock--antiblink-post-command, you create lots of markers, one per command. You don't do anything to get rid of them, beyond waiting for the next garbage collection to do its work. This could easily lead to several hundred markers slowing down operations in a buffer. Maybe. Page "Overview of Markers" in the Elisp manual recommends making them point nowhere when you have finished with them, using (set-marker m nil). Please consider doing this. -- Alan Mackenzie (Nuremberg, Germany).