From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Paul Pogonyshev Newsgroups: gmane.emacs.bugs Subject: bug#57684: locked narrowing breaks existing code without an apparent way to repair Date: Thu, 8 Sep 2022 21:37:02 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000067da2b05e82f8e52" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9609"; mail-complaints-to="usenet@ciao.gmane.io" To: 57684@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 08 21:38:12 2022 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 1oWNLo-0002JP-KZ for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 08 Sep 2022 21:38:12 +0200 Original-Received: from localhost ([::1]:39338 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oWNLn-0002Tb-DZ for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 08 Sep 2022 15:38:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47170) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWNLf-0002SQ-4h for bug-gnu-emacs@gnu.org; Thu, 08 Sep 2022 15:38:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43184) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oWNLe-0006b9-ON for bug-gnu-emacs@gnu.org; Thu, 08 Sep 2022 15:38:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oWNLe-0004DZ-Kn for bug-gnu-emacs@gnu.org; Thu, 08 Sep 2022 15:38:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Pogonyshev Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 08 Sep 2022 19:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 57684 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.166266584616160 (code B ref -1); Thu, 08 Sep 2022 19:38:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 8 Sep 2022 19:37:26 +0000 Original-Received: from localhost ([127.0.0.1]:60116 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oWNL3-0004Ca-PZ for submit@debbugs.gnu.org; Thu, 08 Sep 2022 15:37:26 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:39264) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oWNKy-0004CP-Ss for submit@debbugs.gnu.org; Thu, 08 Sep 2022 15:37:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56186) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWNKy-0001sa-Fc for bug-gnu-emacs@gnu.org; Thu, 08 Sep 2022 15:37:20 -0400 Original-Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]:45947) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oWNKv-0006Tc-AS for bug-gnu-emacs@gnu.org; Thu, 08 Sep 2022 15:37:19 -0400 Original-Received: by mail-ej1-x62d.google.com with SMTP id dv25so11158278ejb.12 for ; Thu, 08 Sep 2022 12:37:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date; bh=sIjQHTOugGWFmFTLIslg+PxqZ1ATasqPLMX2wk+4Tk4=; b=m+5Xvc1bAhsqT9Ow8OTAnHoeKRdf3Ii8vT071euOWZAFbodkIMBGN+AnRTKUzwk2wo BzLCmJ8Yv5rN9261Pb5sRHnPrIO/ZVlw/Rgjt0N5XPfcgPjBbNRQIr321irrc+1p57be OonZW7s6qAYEsMkDDAfTbrpgXjITscjowq5UEyej5mve9aaR/WL5JyxZBe2UB775VZLf ivNT4jftaxLc4li5zCqnl/fnz894WFXxGztc287Z9uiiBtle3eBLifHrpHXc+MQl4Ul2 c5TJiAWRrYPzXiTSSIvQ5aGBfvFqRxfMBMgkmzPkAhRBjhRnktueLhtM/QdSlXJHAm98 RKCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date; bh=sIjQHTOugGWFmFTLIslg+PxqZ1ATasqPLMX2wk+4Tk4=; b=S67qCpB3pnJSw5XnLyPcLMSnwo/Aidtqt8oUu/2QlNhJNgOd5VFrhAJPrLsh5F9MBV wz5hWEZUL5OEvcLTf1IQMvRHZi4k3HkxlsbdL4AHtO25A3s8bQymuDE+X405TdeNEull fp8jEwwBSke73Is6wGzCll59bLamSBRySsCYH3ix6w609JgqDsuiEnPqWKlkyxjqAs0g 0PBIQkssoSXaZlBZzqqtGFouc92/2FtM4/aJcEjDocgGJzocd3FYoXTicIzvDNCzOjw1 XnZoTO2Ke+V+SMToVlk+wtMX81rO5mT+0uqEKj0i4XO+LgFWjA7eOigLJ39z5FrCfVtf awaQ== X-Gm-Message-State: ACgBeo2mu1fZPEDyZY51qnIy8cjG0Lf5e1jh7hvUjKvUUzsGm4cIEA/a a+06GCDd0oWxFWppDpAECgfxSk3HoJVl6mVevyq472V94w== X-Google-Smtp-Source: AA6agR45DTLeqIq5+Nvo0TMCF2gpvauEr8C0mUT30iZ9dmBLz0rpltBofUaMmD4ukTQRls7DfawDAybCaWhZDu4wYYM= X-Received: by 2002:a17:906:d54c:b0:750:5e1c:b88c with SMTP id cr12-20020a170906d54c00b007505e1cb88cmr7353093ejc.485.1662665833829; Thu, 08 Sep 2022 12:37:13 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=pogonyshev@gmail.com; helo=mail-ej1-x62d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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" Xref: news.gmane.io gmane.emacs.bugs:241936 Archived-At: --00000000000067da2b05e82f8e52 Content-Type: text/plain; charset="UTF-8" "Locked narrowing" added in Emacs 29 cannot be (temporarily) canceled by code called inside. This in particular breaks Logview ( https://github.com/doublep/logview), because this narrowing is in effect during fontification and causes Logview to fall down into an infinite loop. Moreover, variable `restrictions-locked' appears to be not exposed to Elisp, meaning that this cannot be cleared even with an explicit let-bind. The mode simply cannot work without an ability to temporarily widen the text. Macro `logview--std-temporarily-widening' is used 35 times in its code: (defmacro logview--std-temporarily-widening (&rest body) (declare (indent 0) (debug t)) `(save-restriction (let ((logview--point-min (logview--point-min)) (logview--point-max (logview--point-max))) (widen) ,@body))) To make it even harder to debug, Emacs sometimes hangs completely with even C-g not aborting faulty code (in this case "faulty" because of incompatible changes in Emacs itself). Paul --00000000000067da2b05e82f8e52 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
"Locked narrowing" added in Emacs 29 cannot be (= temporarily) canceled by code called inside. This in particular breaks Logv= iew (https://github.com/doub= lep/logview), because this narrowing is in effect during fontification = and causes Logview to fall down into an infinite loop. Moreover, variable `= restrictions-locked' appears to be not exposed to Elisp, meaning that t= his cannot be cleared even with an explicit let-bind.

Th= e mode simply cannot work without an ability to temporarily widen the text.= Macro `logview--std-temporarily-widening' is used 35 times in its code= :

(defmacro logview--std-temporarily-widening (&am= p;rest body)
=C2=A0 (declare (indent 0) (debug t))
=C2=A0 `(save-rest= riction
=C2=A0 =C2=A0 =C2=A0(let ((logview--point-min (logview--point-mi= n))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(logview--point-max (logvie= w--point-max)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0(widen)
=C2=A0 =C2=A0 =C2= =A0 =C2=A0,@body)))

To make it even harder to = debug, Emacs sometimes hangs completely with even C-g not aborting faulty c= ode (in this case "faulty" because of incompatible changes in Ema= cs itself).

Paul
--00000000000067da2b05e82f8e52--