all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: JD Smith <jdtsmith@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 67604@debbugs.gnu.org
Subject: bug#67604: Motion problems with inline images
Date: Sun, 3 Dec 2023 15:46:38 -0500	[thread overview]
Message-ID: <190CBBD6-067F-41D8-B5EE-6E1643F01C02@gmail.com> (raw)
In-Reply-To: <83cyvn6wix.fsf@gnu.org>

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

> On Dec 3, 2023, at 12:11 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> 
>> From: JD Smith <jdtsmith@gmail.com>
>> Date: Sun, 3 Dec 2023 11:54:27 -0500
>> 
>> Following on from the recently fixed bug#67533, which related to incorrect pixel size measurements
>> with inline images, one remaining issue, with that fix in place, relates to motion in buffers in visual line
>> mode with inline images.  A video of the effect can be seen on the associated gist for bug#67533.
>> 
>> Here the issue is that next-line/forward-line/(vertical-motion 1) all skip from the Green inline SVG
>> straight to the “JUMPS HERE” line, for certain frame widths (for me: 79 characters).  See
>> reproduction code, below.  Depending on your font char size (mine is 7x14 pixels) this width may
>> vary for you.  Note that multiple frame width produce the exact same wrapped appearance, but the
>> motion bug shows up only for one of them.
> 
> I tried different frame widths, but couldn't reproduce the problem.
> Not with the latest master branch, anyway, where I recently installed
> the changes from bug#67533.
> 
> If someone can tell what frame width and default font height trigger
> the problem, I will try to reproduce with those sizes.

I just compiled a fresh NS build from master with your bug#67533 fix.  It triggers the skip-a-line bug for me, from emacs -q at frame-width=79.  But I can also confirm, it is font size dependent, likely occurring with only a precise combination of pixel sizes.  

Here’s an easy way to find it with your font, using the attached command:

Run the let-form mentioned in my initial message.
Resize the frame width down until the green image first moves to the beginning of a visual line (80 chars, for me).
Resize down one more column *without causing further wrap* (79 chars for me).
In the svg-file-motion-demo buffer, execute M-x my/find-skip-bug.
It should report the pixel width needed for the red SVG image on the first line to trigger the bug, and leave the demo buffer in that state.
Hitting down twice from (point-min) should land on JUMPS HERE, bypassing the stub line “pulvinar nibh".

++++

(defun my/find-skip-bug ()
  (interactive)
  (goto-char (point-min))
  (let* ((ov (car (overlays-at 10)))
	 (w 146)
	 (h 29)
	 (wc (frame-char-width))
	 (res
	  (cl-loop
	   for off from (- (- wc 2)) to (1- wc)
	   for sw = (+ w off)
	   for svg = (svg-create sw h) do
	   (message "Checking with red image width %d" sw)
	   (svg-rectangle svg 0 0 sw h :fill-color "red")
	   (overlay-put ov 'display (svg-image svg :ascent 'center))
	   if (save-excursion
		(next-line) (next-line)
		(beginning-of-visual-line)
		(looking-at "JUMPS HERE"))
	   return off
	   finally return nil)))
    (if res (message "Found Bug at offset %d = %d pixels" res (+ w res))
      (message "Did not find Bug"))))
  


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

  reply	other threads:[~2023-12-03 20:46 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-03 16:54 bug#67604: Motion problems with inline images JD Smith
2023-12-03 17:11 ` Eli Zaretskii
2023-12-03 20:46   ` JD Smith [this message]
2023-12-04 13:16     ` Eli Zaretskii
2023-12-04 14:10       ` JD Smith
2023-12-04 14:17         ` Eli Zaretskii
2023-12-04 14:25           ` JD Smith
2023-12-04 14:37             ` Eli Zaretskii
2023-12-04 17:44               ` JD Smith
2023-12-04 18:20                 ` Eli Zaretskii
2023-12-04 19:16                   ` JD Smith
2023-12-04 19:38                     ` Eli Zaretskii
2023-12-04 21:05                       ` JD Smith
2023-12-05  3:24                         ` Eli Zaretskii
2023-12-05 23:06                           ` JD Smith
2023-12-06  3:31                             ` Eli Zaretskii
2023-12-06  4:33                               ` JD Smith
2023-12-06 12:25                                 ` Eli Zaretskii
2023-12-06 18:29                                   ` JD Smith
2023-12-11 19:06                               ` JD Smith
2023-12-11 19:44                                 ` Eli Zaretskii
2023-12-11 22:06                                   ` JD Smith
2024-09-03 18:00                                   ` JD Smith

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=190CBBD6-067F-41D8-B5EE-6E1643F01C02@gmail.com \
    --to=jdtsmith@gmail.com \
    --cc=67604@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.