From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Signal `quit' in a `font-lock-fontify-region-function' Date: Tue, 28 May 2019 14:24:23 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="151491"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 28 20:24:44 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 1hVgmB-000dFe-Ff for ged-emacs-devel@m.gmane.org; Tue, 28 May 2019 20:24:43 +0200 Original-Received: from localhost ([127.0.0.1]:40774 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVgmA-0008QQ-H9 for ged-emacs-devel@m.gmane.org; Tue, 28 May 2019 14:24:42 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:52397) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVgm4-0008QL-NK for emacs-devel@gnu.org; Tue, 28 May 2019 14:24:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVgm2-0007aO-Ls for emacs-devel@gnu.org; Tue, 28 May 2019 14:24:36 -0400 Original-Received: from [195.159.176.226] (port=36902 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hVgm0-0007Y5-Nr for emacs-devel@gnu.org; Tue, 28 May 2019 14:24:34 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.89) (envelope-from ) id 1hVglw-000cxW-Jk for emacs-devel@gnu.org; Tue, 28 May 2019 20:24:28 +0200 X-Injected-Via-Gmane: http://gmane.org/ Cancel-Lock: sha1:6LMK+Gw6S/3iy/wEX4Z6ngO8jT4= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 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:237119 Archived-At: > 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. Right, here's how I could imagine a "desirable" behavior: - everytime some operation may block Emacs, it should "register" somewhere (probably some let-binding of a global var is all it takes). - After hitting C-g, a timer is started. - If this timer is reached before the C-g has had to chance to be processed, emit a message in the echo area explaining what Emacs is currently doing (based on the "registered" information above). - when we reach the Nth C-g in a row within the same "registered" operation, we abort the operation (e.g. by calling an ad-hoc function provided while "registering"). -- Stefan