unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#57684: locked narrowing breaks existing code without an apparent way to repair
@ 2022-09-08 19:37 Paul Pogonyshev
  2022-09-08 19:57 ` Gregory Heytings
  0 siblings, 1 reply; 17+ messages in thread
From: Paul Pogonyshev @ 2022-09-08 19:37 UTC (permalink / raw)
  To: 57684

[-- Attachment #1: Type: text/plain, Size: 1010 bytes --]

"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

[-- Attachment #2: Type: text/html, Size: 1249 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2022-09-17  6:33 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-08 19:37 bug#57684: locked narrowing breaks existing code without an apparent way to repair Paul Pogonyshev
2022-09-08 19:57 ` Gregory Heytings
2022-09-08 20:30   ` Paul Pogonyshev
2022-09-09  1:46     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-09 16:16   ` Lars Ingebrigtsen
2022-09-09 16:20     ` Gregory Heytings
2022-09-13 20:54       ` Paul Pogonyshev
2022-09-13 21:06         ` Gregory Heytings
2022-09-13 21:13           ` Paul Pogonyshev
2022-09-13 21:35             ` Gregory Heytings
2022-09-14  2:34         ` Eli Zaretskii
2022-09-14  9:45           ` Paul Pogonyshev
2022-09-14 11:57             ` Eli Zaretskii
2022-09-16  3:38               ` Richard Stallman
2022-09-16  6:04                 ` Eli Zaretskii
2022-09-17  3:40                   ` Richard Stallman
2022-09-17  6:33                     ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).