From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Paul Pogonyshev Newsgroups: gmane.emacs.devel Subject: Re: Signal `quit' in a `font-lock-fontify-region-function' Date: Tue, 28 May 2019 20:14:11 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="107068"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Emacs developers To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 28 20:15:17 2019 Return-path: 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.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hVgd2-000Rji-Mo for ged-emacs-devel@m.gmane.org; Tue, 28 May 2019 20:15:16 +0200 Original-Received: from localhost ([127.0.0.1]:40676 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVgd1-0005XI-Md for ged-emacs-devel@m.gmane.org; Tue, 28 May 2019 14:15:15 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:50768) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVgcJ-0005Vs-8i for emacs-devel@gnu.org; Tue, 28 May 2019 14:14:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVgcH-0008UP-Cs for emacs-devel@gnu.org; Tue, 28 May 2019 14:14:31 -0400 Original-Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:51895) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hVgcF-0008PZ-Eg for emacs-devel@gnu.org; Tue, 28 May 2019 14:14:28 -0400 Original-Received: by mail-wm1-x329.google.com with SMTP id f10so4025188wmb.1 for ; Tue, 28 May 2019 11:14:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0zbqrY6x43EnWfPAb7ZdaQRG+lXA+rx/yN0hlzA1xJY=; b=mYbRd4nL0ERPrlXHIU2jLoJLZps3vpKd/TzK8/JhFhW5oEoayAmZ49gDxmBmxQYnXu Im2ztTssbn4aRdlKCFTuMOfyds7XiWnuK+5IHmMWMCv0F87v94sMn0McknshJcdWPwty azS0d+f1M5ZWqn6eOOTmKqjjvnJlrLAQENop+WBbEn5FWS4n25ZlOZqlUQmHQROjC1Fm F0pm/aQTAxHgWohUnMM0MWml70h2wYGbEzFEV9Vn4mrAXzk5fuz466UNOki6b/1KxldU IZL8CuRQnCPXrQqiDEIpSloX9LyDm4OSGn1o2cFnLUh4jNy9MCwbjJ5Z02TeYJsBDxzq 8xUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0zbqrY6x43EnWfPAb7ZdaQRG+lXA+rx/yN0hlzA1xJY=; b=TZnzVwIzE+DD2pB/V0oTb6YinRP6bd5dVp48BUYoxYtb5di6Q4IyPYHhe1KE6/Vvbx prauuK5oV1TRpX1tSGJW+loHPnOkMRx7UcPB7J7nAZaQOqqEiPC73fwh2c2hMp++iTyR pkKdDuLf2jPAMx0/7V9N0mjPB5P2IG5KfA8Zl9ejUJbOhqkuSZfdI2RTTIsos9//dWl/ HcjcKkHpMw6qhpGthFizy8CVDygxBEw/dT6au/HorIZ/BgjLzQbIKMx+qrCkufbldehf Wxzv+JAaLjWjKxFPvItHXlFSrY7sKymGDANNFyIahql1+jYpWJGd9O8AiDCDrF1+zCpU spqQ== X-Gm-Message-State: APjAAAXJOrLXqeRnsDxKAJPAh1tgMqv5cRIuG61G7hqp83L6ptBpBhm6 CqsTArbShb+7MLhYhaomEnnE2724hhWtb5Go7eARmbE= X-Google-Smtp-Source: APXvYqwb1rmRpeN55kJg+OkWmi8X9PQlIThWB9yfuEOyIY0ZYTiQh7zOUBuAzp7jxuInNh82khKgJEfiASZm8ox3HgE= X-Received: by 2002:a1c:a002:: with SMTP id j2mr4078998wme.131.1559067263229; Tue, 28 May 2019 11:14:23 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::329 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:237118 Archived-At: > Yes but: there's the obvious question of "how many C-g are > necessary", as well as making sure this doesn't misfire just because the > user hits C-g several times for some other reason. > > IOW, to do this, we'd need to make sure that Emacs was busy font-locking > this one buffer during all this time, or something like that. I certainly didn't mean one C-g. More like three presses within one second and all during font-lock. Still could result in false positives, but I believe an occasional unwanted broken fontlocking is better than outright hung Emacs. Could also be customizable as everything else. I think a larger (apparent) problem is to let user know what's going on. Naively issued messages would get overridden with "Quit" in the echo area, because the natural response (at least mine) in such situation is to mash C-g continuosly, not do it accurately and watch if there is any change. And those "excessive" C-g would result in "Quit" message. This is also part of the reason I haven't continued with implementing this just for my mode, but rather feel it would be better as a general Emacs feature. > Also, I get the impression that we'd want this kind of behavior for more > than just font-lock. Yeah, I have encountered similar problems with timers due to some recent bug. I mean, the bug has been fixed already, but I still had to restart Emacs a couple of times, and what guarantees there will be no similar bugs in the future? Paul On Tue, 28 May 2019 at 19:50, Stefan Monnier wrote: > > > But would it make sense to adjust fontification code to disable > > fontification in the current buffer if fontification function is > > killed with C-g several times? > > Yes but: there's the obvious question of "how many C-g are > necessary", as well as making sure this doesn't misfire just because the > user hits C-g several times for some other reason. > > IOW, to do this, we'd need to make sure that Emacs was busy font-locking > this one buffer during all this time, or something like that. > > Also, I get the impression that we'd want this kind of behavior for more > than just font-lock. > > > Stefan >