Subject: Re: bug#9092: movement cursor in speedbar

From: Lars Ingebrigtsen <[email-masked]>
Date: Tue, 08 Dec 2020 15:46:21 +0100

Juanma Barranquero <[email-masked]> writes:

> emacs -Q -f speedbar
>
> The cursor is at the bottom of the speedbar window.
>
> <up>    ; the cursor moves over the icon in the previous line
> <up>
> ...
> <up>    ; the cursor moves over the icons normally
> <right> <left>  ; the cursor is again over the icon
> <down>   ; now the cursor moves to the space next to the icon.
>
> and from that moment on, even if you move over the icon, the cursor
> moves back outside it.

This behaviour is still present in Emacs 28.

> According to Eli, line-move-visual tells vertical-motion which column
> the cursor should move to, and that does not work too well with stuff
> that isn't text, like an image or a stretch glyph (like the one for
> `(space :align-to NN)') display property.

Speedbar seems to have some invisible characters at the start, and then
an image, and I think that's what's confusing Emacs here.  If it has
been just an image, Emacs usually handles that fine.

Here's a simpler recipe to reproduce:

(dotimes (i 5)
  (insert (propertize "a" 'invisible t)
	  (propertize "c" 'display
		      (find-image '((:type xpm :file "search.xpm"))))
	  (format " foo %s\n" i)))

If we don't have the invisible text before the image, then motion
commands work as expected.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no