From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#63253: 29.0.90; with-delayed-message fails in combination with inhibit-message Date: Mon, 08 May 2023 09:54:35 -0400 Message-ID: References: <87r0rxdwc8.fsf@daniel-mendler.de> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32063"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 63253@debbugs.gnu.org To: Daniel Mendler Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 08 15:55:09 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pw1KX-00087w-I1 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 08 May 2023 15:55:09 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pw1KS-00074v-12; Mon, 08 May 2023 09:55:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pw1KR-00074l-3w for bug-gnu-emacs@gnu.org; Mon, 08 May 2023 09:55:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pw1KQ-0004VP-O7 for bug-gnu-emacs@gnu.org; Mon, 08 May 2023 09:55:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pw1KQ-0005uw-J6 for bug-gnu-emacs@gnu.org; Mon, 08 May 2023 09:55:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 08 May 2023 13:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63253 X-GNU-PR-Package: emacs Original-Received: via spool by 63253-submit@debbugs.gnu.org id=B63253.168355409122674 (code B ref 63253); Mon, 08 May 2023 13:55:02 +0000 Original-Received: (at 63253) by debbugs.gnu.org; 8 May 2023 13:54:51 +0000 Original-Received: from localhost ([127.0.0.1]:39624 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pw1KE-0005tc-Oy for submit@debbugs.gnu.org; Mon, 08 May 2023 09:54:51 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:6660) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pw1KC-0005tN-FY for 63253@debbugs.gnu.org; Mon, 08 May 2023 09:54:49 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 9452380BAF; Mon, 8 May 2023 09:54:42 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 62FDD8025F; Mon, 8 May 2023 09:54:41 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1683554081; bh=luTOcnjSckXGkJ6mG+SzKbPYl7BZEPd2HsdYj915Ojc=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=fKwKCnmpH5IeXfTcTknxBhG/a34ZTn1eHPun4vU6SMY0BxZW7zrrKs+mYieP2LXM5 JTM4n0U8YLunsl3TObguUUSd9bSsxqAS/GCc8jkpwlsn4YC9sSx8kBgWrCBLAmmiVo CKol7GLCRgHKZlkKUGqJKOb5aPJBwgYUTZqAajRwAPGCfgQVwZ768s1p1FhmCIjihB ePN0B4QQ+j7K/S8cGzEygpzhNIjpF2M4BD8zLxuMgNNzAkDSj3wix6ORvkNouZCao5 0Ko0BVr92l5NYJ0nWdY3Z2Z6xOt0oYWXqTZMtJDoxz+kAvMYFGTrXmh2tZ5sIBcF08 6WLggFGYbIR3g== Original-Received: from pastel (unknown [45.72.217.176]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 0F6DA12029D; Mon, 8 May 2023 09:54:41 -0400 (EDT) In-Reply-To: <87r0rxdwc8.fsf@daniel-mendler.de> (Daniel Mendler's message of "Wed, 03 May 2023 21:54:47 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:261325 Archived-At: > There seems to exist an interaction issue of `with-delayed-message' with > `inhibit-message'. Very much so, indeed. The issue is fundamentally linked to `set-message-function`: `with-delayed-message` calls `message3` (via `with_delayed_message_display`) from an "atimer", i.e. a thing that can be run from `process_pending_signals`, `unblock_input`, `maybe_quit`, ... AFAIK these are places where it's safe to run some C code, but not places where it's safe to run arbitrary ELisp code. So `set-message-function` is "dangerous" because it runs ELisp code from `message3` => `message3_nolog` => `set_message`. I think this is related to bug#58042. Here the problem is that the regexp engine is stateful, so calling a regexp function in the middle of another regexp match causes serious problems. When we need to run ELisp from a regexp match for on-the-fly syntax-propertization (in `parse_sexp_propertize`), we're careful to try and detect if the ELisp code may have modified the current buffer and we re-set the `gl_state` with a call to `SETUP_SYNTAX_TABLE`. But when `with-delayed-message' performs a regexp operation from within another regexp match, it doesn't re-set the `gl_state`, which then leads to this "Error in syntax_table logic for to-the-end intervals" error. I'm surprised we haven't yet seen the same problem when the ELisp code is run via things like -[EmacsView layoutSublayersOfLayer:] which can be called from `maybe_quit` and call `redisplay` which in turn can run arbitrary ELisp code (via `mode-line-format`, jit-lock, you name it). Stefan