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: Signal `quit' in a `font-lock-fontify-region-function' Date: Fri, 17 May 2019 00:20:04 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000a4da96058908ab1c" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="268210"; mail-complaints-to="usenet@blaine.gmane.org" To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 17 00:20:33 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 1hROjp-0017gR-Jp for ged-emacs-devel@m.gmane.org; Fri, 17 May 2019 00:20:33 +0200 Original-Received: from localhost ([127.0.0.1]:37597 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hROjo-0002K5-Kj for ged-emacs-devel@m.gmane.org; Thu, 16 May 2019 18:20:32 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:32789) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hROjd-0002Jj-NR for emacs-devel@gnu.org; Thu, 16 May 2019 18:20:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hROjb-0006vl-OR for emacs-devel@gnu.org; Thu, 16 May 2019 18:20:21 -0400 Original-Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:36778) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hROja-0006pX-O9 for emacs-devel@gnu.org; Thu, 16 May 2019 18:20:19 -0400 Original-Received: by mail-wm1-x32c.google.com with SMTP id j187so4930058wmj.1 for ; Thu, 16 May 2019 15:20:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=jVyn33yWBpuI4KdjfbONNAT3gMDy3+YEP7ythd5v0KQ=; b=HmLwCl6cfu5o5pN+z4wngcd3aWmXO6cg5cWTn+Jh18OxGlYzTK24w50+5fOTQTzbhG AwF+aS7jxSfcl7hK68b+OJsXIkGpRz8NnoIeXFdY9EJKtiULypLSAjRi9+ntxCVfm3sE UHWN4OZ0WDC3TnTYeQ7YRJuTO2daUD+AkNWLh4ZYnwlFfTX5j0LqMSEIvSyNA4kvOGw2 YZY/L2KA46NAHLTFa1DnjV7IdL5oZOQAYeMOSSVSAplaU7/MqFJIeOyB+psLLV2+Hd5M RNq16xGcjtLO0wbpGOtPtmWhfLHB7rpXnVqLUXTpLhrO50qMS2YsNJ9JOeZS778BYOrh L66g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=jVyn33yWBpuI4KdjfbONNAT3gMDy3+YEP7ythd5v0KQ=; b=GdA8Y5ocQcxmpGNXruOxoYSZz6fqw57+un4nydtTPTnUHlOvonMepwfPGp3tYdSjaB X2pq2ksXsJN2k4mjx1LNLozqT7jEuvcjEjk0+n0hwlu9tjF8bygyhdMR7kqJANblUeft 8U5X57LpEnZhjkZvJxrn4ATK+KUB5uQM3rp8e15d1jawVlzGVoVSnYLNE7AHEV2kjbW2 bRGSRE+TvC4aHDi+rHRQj4nXQmo+YgyZUGqowqXzGrhLVsqIlO3TwggpmuKhcnXC1+ON DhPXvKiS3BUytVj/pkpYqEdiQ5oDdYXEJrnKUefnT9WvjJbYs7AZbTwb2OiIP6ak0YDX R66A== X-Gm-Message-State: APjAAAVhyY0ZHA6QiVDUnhD53RkOECIMZ+E3h0n59ENookZkXzMNTMmH ltytaJBwi+X3FY9gB6QOB79GHEnP0ie9vXNNHEYIGFU= X-Google-Smtp-Source: APXvYqyuhzkA75nmN1YK1zmzXL6jsUqoyzavAEnlsvYCK4fiBhR6uZZOZDpDZ63G3E6cyW0/NScuw6L1GyiGYhRO9d0= X-Received: by 2002:a1c:e916:: with SMTP id q22mr35958wmc.148.1558045216003; Thu, 16 May 2019 15:20:16 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32c 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:236602 Archived-At: --000000000000a4da96058908ab1c Content-Type: text/plain; charset="UTF-8" Hi, I'm having the following, unfortunately unreproducible problem: inside a custom font-locking function condition `quit' _sometimes_ cannot be triggered with C-g. I'm sure it has nothing to do with `inhibit-quit'. For the same function in one Emacs instance it is triggerable, in another --- not. If in a certain instance it "breaks" (i.e. C-g no longer triggers `quit'), it seems to stay broken forever. This is notoriously difficult to investigate. I came up with the following pseudo-mode (usage: M-x pretend-fontification-mode RET in a large buffer): (define-derived-mode pretend-fontification-mode nil "PRETEND-FONTIFICATION" "..." (setq font-lock-defaults '(nil)) (set (make-local-variable 'font-lock-fontify-region-function) (lambda (from to _verbose) ;; (message ...) doesn't seem to do anything (with-current-buffer "*Messages*" (with-silent-modifications (insert (format "\nPRETEND-FONTIFYING %s-%s\n" from to)))) (let (x) (dotimes (k 10000000) ; long delay in pure Lisp, i.e. not `sleep-for' (setq x k)))))) but as I said it is not reproducible: sometimes mashing C-g results in the following in *Messages* buffer: Error during redisplay: (jit-lock-function ##) signaled (quit) sometimes it doesn't. I also tried `(condition-case ... (quit ...))' inside font-locking function, but result is the same: sometimes the handler is triggered, sometimes it is not and I cannot work out any pattern. I also tried printing out values that could be relevant (inhibit-quit, quit-flag, (input-pending-p), unread-command-events), but they appear to be the same regardless of whether `quit' is still triggerable or not. Does anyone has any idea what's going on? Paul P.S.: I'm not subscribed to the list, please CC answers to me. --000000000000a4da96058908ab1c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

I= 'm having the following, unfortunately unreproducible problem: inside a= custom font-locking function condition `quit' _sometimes_ cannot be tr= iggered with C-g. I'm sure it has nothing to do with `inhibit-quit'= . For the same function in one Emacs instance it is triggerable, in another= --- not. If in a certain instance it "breaks" (i.e. C-g no longe= r triggers `quit'), it seems to stay broken forever.

This is notoriously difficult to investigate. I came up with the fol= lowing pseudo-mode (usage: M-x pretend-fontification-mode RET in a large bu= ffer):

(define-derived-mode pretend-fontifica= tion-mode nil "PRETEND-FONTIFICATION"
=C2=A0 "...&= quot;
=C2=A0 (setq font-lock-defaults '(nil))
=C2= =A0 (set (make-local-variable 'font-lock-fontify-region-function)
=
=C2=A0 =C2=A0 =C2=A0 =C2=A0(lambda (from to _verbose)
=C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0;; (message ...) doesn't seem to do anythin= g
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(with-current-buffer "*M= essages*" (with-silent-modifications (insert (format "\nPRETEND-F= ONTIFYING %s-%s\n" from to))))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0(let (x)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(dotimes = (k 10000000)=C2=A0 ; long delay in pure Lisp, i.e. not `sleep-for'
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(setq x k))))))
=

but as I said it is not reproducible: sometimes m= ashing C-g results in the following in *Messages* buffer:

Error during redisplay: (jit-lock-function ##) signaled (quit)
<= /div>

sometimes it doesn't. I also tried `(condition= -case ... (quit ...))' inside font-locking function, but result is the = same: sometimes the handler is triggered, sometimes it is not and I cannot = work out any pattern. I also tried printing out values that could be releva= nt (inhibit-quit, quit-flag, (input-pending-p), unread-command-events), but= they appear to be the same regardless of whether `quit' is still trigg= erable or not.

Does anyone has any idea what's= going on?

Paul

P.S.: I&#= 39;m not subscribed to the list, please CC answers to me.
=
--000000000000a4da96058908ab1c--