Subject: Re: bug#77065: 31.0.50; Infinite loop in move_it_to

From: Yifan Zhu <[email-masked]>
Date: Mon, 17 Mar 2025 09:35:18 -0700

On 3/17/25 7:27 AM, Eli Zaretskii wrote:
> Thanks, but I don't have access to a system where these prerequisites
> can be met.  So either someone can reproduce this, debug the problem,
> and describe the reason for the loop, or I'd need to ask you to do it,
> if possible.  Or, if you can show a recipe for reproducing the problem
> without installing LaTeX and xenops, I could try reproducing this on
> the systems to which I have access.

Some steps to reproduce without latex and xenops:

1. Place attached files into ~/Downloads

2. open emacs on test.txt

3. Evaluate the following function on the buffer (replaces tags with 
inserted images)

(defun replace-img-tags-with-images ()
   "Replace all occurrences of <img-name> with the corresponding 
img-name.png image."
   (interactive)
   (save-excursion
     (goto-char (point-min))
     (while (re-search-forward "<\\([^>]+\\)>" nil t)
       (let ((img-name (match-string 1))
             (image-file))
         (setq image-file (concat img-name ".png"))
         (message "Found tag: <%s>, corresponding image file: %s" 
img-name image-file)
         (if (file-exists-p image-file)
             (progn
               (replace-match "")
               (insert-image (create-image image-file))
               (message "Replaced <%s> with image %s" img-name image-file))
           (message "Image file %s does not exist" image-file))))))

4. Make sure display-line-numbers-mode is turned on, and set wrapping 
mode to word wrap

5. Put cursor on last word of second line, ("subgaussian"), and zoom in 
until second line just spans two lines

6. M-x split-window-right