Subject: Re: bug#56682: Fix the long lines font locking related slowdowns

From: Eli Zaretskii <[email-masked]>
Date: Sat, 30 Jul 2022 14:32:25 +0300

> Date: Sat, 30 Jul 2022 10:52:48 +0000
> From: Gregory Heytings <[email-masked]>
> cc: Stefan Monnier <[email-masked]>, [email-masked]
> 
> By the way, while trying the above, it became clear that I forgot to 
> properly handle the new optional argument to narrow-to-region in 
> byte-compiled code.  But I don't know how to do that:
> 
> diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
> index b4954eee9f..1ecd77f751 100644
> --- a/lisp/emacs-lisp/bytecomp.el
> +++ b/lisp/emacs-lisp/bytecomp.el
> @@ -767,7 +767,7 @@ 121
>   (byte-defop 122  0 byte-char-syntax)
>   (byte-defop 123 -1 byte-buffer-substring)
>   (byte-defop 124 -1 byte-delete-region)
> -(byte-defop 125 -1 byte-narrow-to-region)
> +(byte-defop 125 -2 byte-narrow-to-region)
>   (byte-defop 126  1 byte-widen)
>   (byte-defop 127  0 byte-end-of-line)
> 
> @@ -3833,7 +3833,7 @@ setcar
>   (byte-defop-compiler setcdr            2)
>   (byte-defop-compiler buffer-substring  2)
>   (byte-defop-compiler delete-region     2)
> -(byte-defop-compiler narrow-to-region  2)
> +(byte-defop-compiler narrow-to-region  2-3)
>   (byte-defop-compiler (% byte-rem)      2)
>   (byte-defop-compiler aset              3)
> 
> is apparently not enough, because "2-3" seems to install an 
> integer-or-marker-p check on the third argument, which raises a 
> (wrong-type-argument integer-or-marker-p nil) or (wrong-type-argument 
> integer-or-marker-p t) error when narrow-to-region is called from 
> byte-compiled code.

Where's the integer-or-marker-p test installed and/or called from?