unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: JD Smith <jdtsmith@gmail.com>
To: 67604@debbugs.gnu.org
Subject: bug#67604: Motion problems with inline images
Date: Sun, 3 Dec 2023 11:54:27 -0500	[thread overview]
Message-ID: <E1F6123B-DA1E-419B-B305-43A31A5876A6@gmail.com> (raw)

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

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 <https://gist.github.com/jdtsmith/ad765047a6afe20f353de573d8c07da9?permalink_comment_id=4780726#gistcomment-4780726> 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.

There are other related phenomena, such as prev-line from an image at column 0 jumping to (near the) end of the previous screen line, but hopefully this is enough to identify the motion issue(s) at hand.

++++ 
(require 'svg)
(let ((buf "svg-file-motion-demo")
      (ims '(("red" 146 29)
	     ("green" 106 29)
	     ("blue" 151 29))))
  (with-current-buffer (get-buffer-create buf)
    (erase-buffer)
    (visual-line-mode 1)
    (insert "tellus.  $\\gamma(t) = \\log\\left(\\sqrt{\\tan(t)}\\right)$  Donec hendrerit tempor tellus.  $\\chi(y) = \\sqrt{\\frac{1}{\\log(y)}}$  Phasellus lacus.  $\\tau(t) = \\exp\\left(\\sqrt{\\exp(t)}\\right)$  Curabitur lacinia pulvinar nibh.
JUMPS HERE")
    (goto-char (point-min))
    (while  (re-search-forward (rx ?$ (* (not ?$)) ?$) nil t)
      (let* ((ov (make-overlay (match-beginning 0) (match-end 0)))
	     (im (pop ims))
	     (svg (svg-create (nth 1 im) (nth 2 im))))
	(svg-rectangle svg 0 0 (nth 1 im) (nth 2 im) :fill-color (car im))
	(overlay-put ov 'display (svg-image svg :ascent 'center)))))
  (pop-to-buffer buf))
++++


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

             reply	other threads:[~2023-12-03 16:54 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-03 16:54 JD Smith [this message]
2023-12-03 17:11 ` bug#67604: Motion problems with inline images Eli Zaretskii
2023-12-03 20:46   ` JD Smith
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

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=E1F6123B-DA1E-419B-B305-43A31A5876A6@gmail.com \
    --to=jdtsmith@gmail.com \
    --cc=67604@debbugs.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 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).