From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Bj=C3=B6rn_Lindqvist?= Newsgroups: gmane.emacs.help Subject: Mode-specific font lock delays Date: Sun, 4 Sep 2016 07:01:42 +0200 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1472972151 20851 195.159.176.226 (4 Sep 2016 06:55:51 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 4 Sep 2016 06:55:51 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Sep 04 08:55:48 2016 Return-path: Envelope-to: geh-help-gnu-emacs@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 1bgRLE-0004Ts-GC for geh-help-gnu-emacs@m.gmane.org; Sun, 04 Sep 2016 08:55:44 +0200 Original-Received: from localhost ([::1]:48953 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgRLC-0001nQ-CV for geh-help-gnu-emacs@m.gmane.org; Sun, 04 Sep 2016 02:55:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36357) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgPYy-0004YK-3s for help-gnu-emacs@gnu.org; Sun, 04 Sep 2016 01:01:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bgPYw-0001ph-5x for help-gnu-emacs@gnu.org; Sun, 04 Sep 2016 01:01:47 -0400 Original-Received: from mail-wm0-x234.google.com ([2a00:1450:400c:c09::234]:35502) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgPYw-0001pO-0Z for help-gnu-emacs@gnu.org; Sun, 04 Sep 2016 01:01:46 -0400 Original-Received: by mail-wm0-x234.google.com with SMTP id w2so80049286wmd.0 for ; Sat, 03 Sep 2016 22:01:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=5kuncPe6Mk8batXqeq5BIqA8ZlbO6TRGSXZyOiFCyEg=; b=J7h/8WzFsYQpZgwjQmtZFPBB7hMOos7mF5VTO1de+xPsIq4Np5XbfehPQ7+7KBBKkE x0wv6GbbqcVjCS7VKRsNGpdK3B7wx/SGW4GFq3LXfoPmTtwGFtWblzHE1Imzk7tYzc+j HnUUbzWT6ZyAUaHzVvfgSKJ/8Ncuy0PcK8bGZ9snJRUylnKN5OX8NMQuE7Czrq2nxeln L0w/bUGOqZGBzSjzlq4oti7i5/LvrLDteyN9O9Cycv2mdsGwlN6uhxh2xAQOEGR1RY6L zpH4Y8dmOkgzVFDwh+980Wd8AGmLxI3mchXfp05GIgywQ8ZKfl1t+ItKFWOvD1bwSG9Z +YEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=5kuncPe6Mk8batXqeq5BIqA8ZlbO6TRGSXZyOiFCyEg=; b=Xex3Gq6MikRvSDzHweNGKtha6UDvnrs/WIbxEpNrsDbodNVp7hUkg2KkSZxlvCcHH2 zBb01kPDpHvd/KjHSxhrDAxKSrdeC+zecdhrdn672OkVlHyruwbMhVpoV0saS69yyMN0 zZXlUHhSZvrVFwPj2IAVuG1DjPNDKqg3aKpYAjUc9WTWDWgR2dAMyfZxHUP/Zx5IJVLD YGcT6NbAm/IfkoVb2Pa7fSK0siaSRAzrLWudR+yS6flrCn4XxTH6X5etMX1f5s0iAyg+ vMvuZVLctChIitbj60FXyuU+4js+xwuX9dhQVJsl5Bq6BYPhDnipEeCmQqz9AIxNNBLy oD2g== X-Gm-Message-State: AE9vXwO0H7/vSu9TH5hiDHh51nHSHDtC/RptLD/Yx6z6lGBxp92pDi9Oxp85JDPyQcisznNZo0DSpvvweyp8uA== X-Received: by 10.28.212.211 with SMTP id l202mr10121727wmg.109.1472965303365; Sat, 03 Sep 2016 22:01:43 -0700 (PDT) Original-Received: by 10.194.152.4 with HTTP; Sat, 3 Sep 2016 22:01:42 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::234 X-Mailman-Approved-At: Sun, 04 Sep 2016 02:55:03 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:111246 Archived-At: Hello emacsers! In the mode I'm working on, font locking is getting laggy when operating on large buffers. Possibly because the regexps I've written for highlighting aren't very good and could use some tune-up by some experts. But it is quick enough for most buffers. So what I'm looking for is a way to defer font-locking so that it only occurs when nothing else is happening which should prevent emacs from becoming laggy. I've found a few variables in the jit-lock-* namespace which I've tried to tweak. What I've found worked the best was setting jit-lock-defer-time to a value like 0.5-1.5 which completely eliminates all lag. But there are two problems: 1) Changing the variable is not mode-specific, but changes how font-lock operates on all buffers. That's not right as I want the increased defer time to only apply to this mode's buffers. 2) When a file is opened, there is a flicker as font-lock waits for the timeout before highlighting the buffer. It would be much better if there was no delay for the first highlighting pass. Can these two problems be solved? If so, how? It would be nice if font-lock had some builtin auto-tuning so that if it notices that if the highlighting passes are taking a long time to run, it increases the delay between them. --=20 mvh/best regards Bj=C3=B6rn Lindqvist