From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: JD Smith Newsgroups: gmane.emacs.bugs Subject: bug#67604: Motion problems with inline images Date: Sun, 3 Dec 2023 15:46:38 -0500 Message-ID: <190CBBD6-067F-41D8-B5EE-6E1643F01C02@gmail.com> References: <83cyvn6wix.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.200.91.1.1\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_A03DF2FC-8B79-4365-B8EB-B8C42052B206" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30817"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 67604@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 03 21:48:13 2023 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 1r9tNq-0007jh-QI for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 03 Dec 2023 21:48:10 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r9tNZ-0004BV-8h; Sun, 03 Dec 2023 15:47:53 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r9tNY-0004BL-9e for bug-gnu-emacs@gnu.org; Sun, 03 Dec 2023 15:47:52 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r9tNY-00012W-0s for bug-gnu-emacs@gnu.org; Sun, 03 Dec 2023 15:47:52 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r9tNh-0006z9-N4 for bug-gnu-emacs@gnu.org; Sun, 03 Dec 2023 15:48:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: JD Smith Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 03 Dec 2023 20:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67604 X-GNU-PR-Package: emacs Original-Received: via spool by 67604-submit@debbugs.gnu.org id=B67604.170163643026658 (code B ref 67604); Sun, 03 Dec 2023 20:48:01 +0000 Original-Received: (at 67604) by debbugs.gnu.org; 3 Dec 2023 20:47:10 +0000 Original-Received: from localhost ([127.0.0.1]:32841 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r9tMs-0006vt-0p for submit@debbugs.gnu.org; Sun, 03 Dec 2023 15:47:10 -0500 Original-Received: from mail-il1-x133.google.com ([2607:f8b0:4864:20::133]:54560) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r9tMn-0006vN-UR for 67604@debbugs.gnu.org; Sun, 03 Dec 2023 15:47:08 -0500 Original-Received: by mail-il1-x133.google.com with SMTP id e9e14a558f8ab-35d5567621fso8303805ab.1 for <67604@debbugs.gnu.org>; Sun, 03 Dec 2023 12:46:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701636410; x=1702241210; darn=debbugs.gnu.org; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=im1bnvBre6xW1nhcCa3Grn6AcRbyXV8ZvBCFtrf0OLI=; b=KwuFRqlzOJ64wkYlRFMU4P+Fx/22rPVmfA8nmgWEaELI5muQLWqcS80YaS/9EctMW9 kv6LFoNwrRPuaNjoSwEwvUlpqnAWMaZvKuwfiYUpEh2uCoxlGUNpGOycsreow0p+f5B6 8pq3XPvDerxaMugsV9lRSbrw7fZ11ZMz70Gal4yL10w39gomzZMfWlYX8GYSZMLQ0QyB Iru+cMEJ2FUdEH2mHBtCV9nERDc+nKAoFoaAM/wN4vWq/DzsMDaxTpcs1AxirWjENLym BqNZRBj8NsZoq6/YqAz2jdZ6pd41GMQpISvnTh7UNP9vgxzN5DLKm7DKqdRIRsFEFxhp lcWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701636410; x=1702241210; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=im1bnvBre6xW1nhcCa3Grn6AcRbyXV8ZvBCFtrf0OLI=; b=anTonDdv8f8OA7KPwaNKC7uEYpY1EHMeg7CdTtL6huCMLA+C3n+LPs8zGAvkc7eTsq PL6uEvjqzzp06zn8YEQnF89QGTj+09EDSNrywo4ifFAG7x+M3w+bS4omU9grcCHIzoT2 xU4i9u0BNXkg/Bl3LUqURBi2f42PGHS4dywQ1+WBfg53SCMvaaftI8DegNf3r5Iz7ShK utdAQ7d1mV6SGLX+b/L23xELL94pB2suRL1vjBMMxZI73lqA51sfctfIkpLMeWtrRzPL xc+ADdlTdL1bjOO0NyClICQcy/5CwFk2XS293sqVeNIjJS9uvnTNB0ueM/LdrH8iXRl8 71sQ== X-Gm-Message-State: AOJu0YzNMOcA+nsvk0kmAstSl/YRv9EH2zsC8uPrSzl6nUjAuHhChLNZ PYbLXrHRJyLTaU8wqGgGgIFLoL0xmJo= X-Google-Smtp-Source: AGHT+IFqX8FWoCMWrItMguEQlo1lku2whdggi2EChfsHav9KCv9T+ehaNGVuq3tqz/Ku08Vj5aSyZQ== X-Received: by 2002:a05:6e02:609:b0:35d:59a2:6467 with SMTP id t9-20020a056e02060900b0035d59a26467mr2432373ils.58.1701636409856; Sun, 03 Dec 2023 12:46:49 -0800 (PST) Original-Received: from smtpclient.apple (cm-24-53-187-34.buckeyecom.net. [24.53.187.34]) by smtp.gmail.com with ESMTPSA id bt19-20020a056e02249300b0035d69e684a7sm585597ilb.32.2023.12.03.12.46.48 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 Dec 2023 12:46:49 -0800 (PST) In-Reply-To: <83cyvn6wix.fsf@gnu.org> X-Mailer: Apple Mail (2.3774.200.91.1.1) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:275453 Archived-At: --Apple-Mail=_A03DF2FC-8B79-4365-B8EB-B8C42052B206 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Dec 3, 2023, at 12:11=E2=80=AFPM, Eli Zaretskii = wrote: >=20 >> From: JD Smith >> Date: Sun, 3 Dec 2023 11:54:27 -0500 >>=20 >> 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. >>=20 >> Here the issue is that next-line/forward-line/(vertical-motion 1) all = skip from the Green inline SVG >> straight to the =E2=80=9CJUMPS HERE=E2=80=9D 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. >=20 > 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. >=20 > 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=3D79.= But I can also confirm, it is font size dependent, likely occurring = with only a precise combination of pixel sizes. =20 Here=E2=80=99s 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 =E2=80=9Cpulvinar 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 =3D (+ w off) for svg =3D (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 =3D %d pixels" res (+ w = res)) (message "Did not find Bug")))) =20 --Apple-Mail=_A03DF2FC-8B79-4365-B8EB-B8C42052B206 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
On Dec 3, 2023, = at 12:11=E2=80=AFPM, 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 =E2=80=9CJUMPS HERE=E2=80=9D 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=3D79.  But I can = also confirm, it is font size dependent, likely occurring with only a = precise combination of pixel sizes.  

Here=E2=80=99s 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 = =E2=80=9Cpulvinar = 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 =3D (+ w = off)
=   for svg =3D (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 =3D %d pixels" res (+ w = res))
      (message "Did not find = Bug"))))
  

= --Apple-Mail=_A03DF2FC-8B79-4365-B8EB-B8C42052B206--