unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#63271: 29.0.90; broken mouse-face
@ 2023-05-04 15:11 Juri Linkov
  2023-05-04 16:01 ` Eli Zaretskii
  0 siblings, 1 reply; 54+ messages in thread
From: Juri Linkov @ 2023-05-04 15:11 UTC (permalink / raw)
  To: 63271

This is a regression introduced between 28 and 29.

1. M-x global-tab-line-mode RET
2. C-h C-n   ;; (view-emacs-news)
3. C-h C-t   ;; (view-emacs-todo)
4. C-x b *scratch* RET

Hover the mouse pointer over the tabs.
Over all tabs mouse-face is 'tab-line-highlight'
that is light grey color.  But over the "TODO" tab
the main text is not highlighted with mouse-face.
There is no difference between "NEWS" and "TODO"
with regard to their text properties.
Customizing 'tab-line-highlight' to a more noticeable
background color like red helps the observe the effect.





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-04 15:11 bug#63271: 29.0.90; broken mouse-face Juri Linkov
@ 2023-05-04 16:01 ` Eli Zaretskii
  2023-05-05 17:38   ` Juri Linkov
  0 siblings, 1 reply; 54+ messages in thread
From: Eli Zaretskii @ 2023-05-04 16:01 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 63271

> From: Juri Linkov <juri@linkov.net>
> Date: Thu, 04 May 2023 18:11:18 +0300
> 
> This is a regression introduced between 28 and 29.
> 
> 1. M-x global-tab-line-mode RET
> 2. C-h C-n   ;; (view-emacs-news)
> 3. C-h C-t   ;; (view-emacs-todo)
> 4. C-x b *scratch* RET
> 
> Hover the mouse pointer over the tabs.
> Over all tabs mouse-face is 'tab-line-highlight'
> that is light grey color.  But over the "TODO" tab
> the main text is not highlighted with mouse-face.
> There is no difference between "NEWS" and "TODO"
> with regard to their text properties.
> Customizing 'tab-line-highlight' to a more noticeable
> background color like red helps the observe the effect.

I cannot reproduce this with the current emacs-29 branch.  All tabs
behave the same as far as mouse-highlight is concerned.

Maybe this is specific to X or GTK?  (Why don't you post the details
of your build and configuration, as collected by report-emacs-bug?)





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-04 16:01 ` Eli Zaretskii
@ 2023-05-05 17:38   ` Juri Linkov
  2023-05-05 18:31     ` Eli Zaretskii
  0 siblings, 1 reply; 54+ messages in thread
From: Juri Linkov @ 2023-05-05 17:38 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 63271

>> 1. M-x global-tab-line-mode RET
>> 2. C-h C-n   ;; (view-emacs-news)
>> 3. C-h C-t   ;; (view-emacs-todo)
>> 4. C-x b *scratch* RET
>>
>> Hover the mouse pointer over the tabs.
>> Over all tabs mouse-face is 'tab-line-highlight'
>> that is light grey color.  But over the "TODO" tab
>> the main text is not highlighted with mouse-face.
>
> I cannot reproduce this with the current emacs-29 branch.  All tabs
> behave the same as far as mouse-highlight is concerned.
>
> Maybe this is specific to X or GTK?  (Why don't you post the details
> of your build and configuration, as collected by report-emacs-bug?)

Sorry, I didn't expect that details are needed because the bug is 100%
reproducible on GTK, Lucid and no toolkit.  But here are the details:

1.

In GNU Emacs 29.0.90 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.20, cairo version 1.16.0) of 2023-05-05
Repository revision: b1bda8228e5788391cefbb4721af24f5713a0e37
Repository branch: emacs-29
Windowing system distributor 'The X.Org Foundation', version 11.0.12013000
System Description: Linux Mint 20

Configured using:
 'configure --with-native-compilation --with-mailutils --without-dbus CC=gcc-10'

Configured features:
ACL CAIRO FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON
LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP
NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB

Minor modes in effect:
  global-tab-line-mode: t
  tab-line-mode: t

2.

In GNU Emacs 29.0.90 (build 2, x86_64-pc-linux-gnu, X toolkit, cairo
 version 1.16.0, Xaw3d scroll bars) of 2023-05-05
Repository revision: b1bda8228e5788391cefbb4721af24f5713a0e37
Repository branch: emacs-29
Windowing system distributor 'The X.Org Foundation', version 11.0.12013000
System Description: Linux Mint 20

Configured using:
 'configure --with-native-compilation --with-mailutils --without-dbus
 --with-x-toolkit=lucid'

Configured features:
ACL CAIRO FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON
LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP
NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XAW3D XDBE XIM XINPUT2 XPM
LUCID ZLIB

Minor modes in effect:
  global-tab-line-mode: t
  tab-line-mode: t

3.

In GNU Emacs 29.0.90 (build 3, x86_64-pc-linux-gnu, cairo version
 1.16.0) of 2023-05-05
Repository revision: b1bda8228e5788391cefbb4721af24f5713a0e37
Repository branch: emacs-29
Windowing system distributor 'The X.Org Foundation', version 11.0.12013000
System Description: Linux Mint 20

Configured using:
 'configure --with-native-compilation --with-mailutils --without-dbus
 --with-x-toolkit=no'

Configured features:
ACL CAIRO FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON
LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP
NOTIFY INOTIFY OLDXMENU PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS
TIFF TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM ZLIB

Minor modes in effect:
  global-tab-line-mode: t
  tab-line-mode: t





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-05 17:38   ` Juri Linkov
@ 2023-05-05 18:31     ` Eli Zaretskii
  2023-05-06 11:19       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 54+ messages in thread
From: Eli Zaretskii @ 2023-05-05 18:31 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 63271

> From: Juri Linkov <juri@linkov.net>
> Cc: 63271@debbugs.gnu.org
> Date: Fri, 05 May 2023 20:38:21 +0300
> 
> >> 1. M-x global-tab-line-mode RET
> >> 2. C-h C-n   ;; (view-emacs-news)
> >> 3. C-h C-t   ;; (view-emacs-todo)
> >> 4. C-x b *scratch* RET
> >>
> >> Hover the mouse pointer over the tabs.
> >> Over all tabs mouse-face is 'tab-line-highlight'
> >> that is light grey color.  But over the "TODO" tab
> >> the main text is not highlighted with mouse-face.
> >
> > I cannot reproduce this with the current emacs-29 branch.  All tabs
> > behave the same as far as mouse-highlight is concerned.
> >
> > Maybe this is specific to X or GTK?  (Why don't you post the details
> > of your build and configuration, as collected by report-emacs-bug?)
> 
> Sorry, I didn't expect that details are needed because the bug is 100%
> reproducible on GTK, Lucid and no toolkit.  But here are the details:

Very strange.  Are you sure the recipe above is all that is needed,
starting from "emacs -Q", to reproduce the problem?





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-05 18:31     ` Eli Zaretskii
@ 2023-05-06 11:19       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-05-07 18:00         ` Juri Linkov
  0 siblings, 1 reply; 54+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-05-06 11:19 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 63271, Juri Linkov

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Juri Linkov <juri@linkov.net>
>> Cc: 63271@debbugs.gnu.org
>> Date: Fri, 05 May 2023 20:38:21 +0300
>> 
>> >> 1. M-x global-tab-line-mode RET
>> >> 2. C-h C-n   ;; (view-emacs-news)
>> >> 3. C-h C-t   ;; (view-emacs-todo)
>> >> 4. C-x b *scratch* RET
>> >>
>> >> Hover the mouse pointer over the tabs.
>> >> Over all tabs mouse-face is 'tab-line-highlight'
>> >> that is light grey color.  But over the "TODO" tab
>> >> the main text is not highlighted with mouse-face.
>> >
>> > I cannot reproduce this with the current emacs-29 branch.  All tabs
>> > behave the same as far as mouse-highlight is concerned.
>> >
>> > Maybe this is specific to X or GTK?  (Why don't you post the details
>> > of your build and configuration, as collected by report-emacs-bug?)
>> 
>> Sorry, I didn't expect that details are needed because the bug is 100%
>> reproducible on GTK, Lucid and no toolkit.  But here are the details:
>
> Very strange.  Are you sure the recipe above is all that is needed,
> starting from "emacs -Q", to reproduce the problem?

I don't see this on any X build.
Would you please post details of the font that is displaying the tab
line?





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-06 11:19       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-05-07 18:00         ` Juri Linkov
  2023-05-07 18:35           ` Eli Zaretskii
  0 siblings, 1 reply; 54+ messages in thread
From: Juri Linkov @ 2023-05-07 18:00 UTC (permalink / raw)
  To: Po Lu; +Cc: Eli Zaretskii, 63271

>> Very strange.  Are you sure the recipe above is all that is needed,
>> starting from "emacs -Q", to reproduce the problem?
>
> I don't see this on any X build.
> Would you please post details of the font that is displaying the tab
> line?

Here is the output of describe-char on the first char of the broken tab:

               position: 2 of 35 (3%), column: 1
              character: T (displayed as T) (codepoint 84, #o124, #x54)
                charset: ascii (ASCII (ISO646 IRV))
  code point in charset: 0x54
                 script: latin
                 syntax: w 	which means: word
               category: .:Base, L:Strong L2R, a:ASCII, l:Latin, r:Roman
               to input: type "C-x 8 RET 54" or "C-x 8 RET LATIN CAPITAL LETTER T"
            buffer code: #x54
              file code: #x54 (encoded by coding system utf-8-unix)
                display: by this font (glyph code):
      ftcrhb:-PfEd-DejaVu Sans-regular-normal-normal-*-10-*-*-*-*-0-iso10646-1 (#x37)

I think your guess about fonts involved is right
because the problem disappears when the tab-line face
doesn't inherit from the 'variable-pitch' face.





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-07 18:00         ` Juri Linkov
@ 2023-05-07 18:35           ` Eli Zaretskii
  2023-05-08 15:56             ` Juri Linkov
  0 siblings, 1 reply; 54+ messages in thread
From: Eli Zaretskii @ 2023-05-07 18:35 UTC (permalink / raw)
  To: Juri Linkov; +Cc: luangruo, 63271

> From: Juri Linkov <juri@linkov.net>
> Cc: Eli Zaretskii <eliz@gnu.org>,  63271@debbugs.gnu.org
> Date: Sun, 07 May 2023 21:00:02 +0300
> 
> I think your guess about fonts involved is right
> because the problem disappears when the tab-line face
> doesn't inherit from the 'variable-pitch' face.

How can a face affect mouse-highlight?





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-07 18:35           ` Eli Zaretskii
@ 2023-05-08 15:56             ` Juri Linkov
  2023-05-08 16:14               ` Eli Zaretskii
  2023-05-09  1:08               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 2 replies; 54+ messages in thread
From: Juri Linkov @ 2023-05-08 15:56 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: luangruo, 63271

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

>> I think your guess about fonts involved is right
>> because the problem disappears when the tab-line face
>> doesn't inherit from the 'variable-pitch' face.
>
> How can a face affect mouse-highlight?

Here is the minimal test case:

  (insert " " (propertize "TODO"
                          'face '(:inherit variable-pitch)
                          'mouse-face 'highlight))

that causes such effect after moving point over highlighted text
in fundamental-mode:


[-- Attachment #2: mouse-face-variable-pitch.png --]
[-- Type: image/png, Size: 16876 bytes --]

^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-08 15:56             ` Juri Linkov
@ 2023-05-08 16:14               ` Eli Zaretskii
  2023-05-08 18:20                 ` Stephen Berman
  2023-05-09  6:45                 ` Juri Linkov
  2023-05-09  1:08               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 2 replies; 54+ messages in thread
From: Eli Zaretskii @ 2023-05-08 16:14 UTC (permalink / raw)
  To: Juri Linkov; +Cc: luangruo, 63271

> From: Juri Linkov <juri@linkov.net>
> Cc: luangruo@yahoo.com,  63271@debbugs.gnu.org
> Date: Mon, 08 May 2023 18:56:05 +0300
> 
> >> I think your guess about fonts involved is right
> >> because the problem disappears when the tab-line face
> >> doesn't inherit from the 'variable-pitch' face.
> >
> > How can a face affect mouse-highlight?
> 
> Here is the minimal test case:
> 
>   (insert " " (propertize "TODO"
>                           'face '(:inherit variable-pitch)
>                           'mouse-face 'highlight))
> 
> that causes such effect after moving point over highlighted text
> in fundamental-mode:

Not reproducible here.  I guess it isn't enough to use a face, you
need a specific font for that?

And what exactly is the manifestation of the problem in the image you
posted? that wide black part that hides the letters "ODO"? or
something else?





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-08 16:14               ` Eli Zaretskii
@ 2023-05-08 18:20                 ` Stephen Berman
  2023-05-08 18:27                   ` Eli Zaretskii
  2023-05-09  6:45                 ` Juri Linkov
  1 sibling, 1 reply; 54+ messages in thread
From: Stephen Berman @ 2023-05-08 18:20 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: luangruo, 63271, Juri Linkov

On Mon, 08 May 2023 19:14:46 +0300 Eli Zaretskii <eliz@gnu.org> wrote:

>> From: Juri Linkov <juri@linkov.net>
>> Cc: luangruo@yahoo.com,  63271@debbugs.gnu.org
>> Date: Mon, 08 May 2023 18:56:05 +0300
>>
>> >> I think your guess about fonts involved is right
>> >> because the problem disappears when the tab-line face
>> >> doesn't inherit from the 'variable-pitch' face.
>> >
>> > How can a face affect mouse-highlight?
>>
>> Here is the minimal test case:
>>
>>   (insert " " (propertize "TODO"
>>                           'face '(:inherit variable-pitch)
>>                           'mouse-face 'highlight))
>>
>> that causes such effect after moving point over highlighted text
>> in fundamental-mode:
>
> Not reproducible here.  I guess it isn't enough to use a face, you
> need a specific font for that?

I see the problem here (GNU/Linux, Gtk3), and indeed, it depends on the
font: here the default Variable Pitch face, where the Font Family
attribute has the value Sans Serif, is realized with DejaVu Sans, and
strings that begin not just with "T", but also with "Y", "J" or "j", do
not show mouse-face highlighting; but when I set the Font Family
attribute of Variable Pitch face to Luxi Sans, I see the problem only
with strings beginning with "j".  I haven't tested other fonts yet.

> And what exactly is the manifestation of the problem in the image you
> posted? that wide black part that hides the letters "ODO"? or
> something else?

The image that Juri posted (which appears to be from a no-toolkit build)
differs from what I see (under Gtk3), which is simply that the
problematic strings show no mouse-face highlighting when the mouse
pointer moves over them.

Steve Berman





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-08 18:20                 ` Stephen Berman
@ 2023-05-08 18:27                   ` Eli Zaretskii
  2023-05-08 18:47                     ` Stephen Berman
  0 siblings, 1 reply; 54+ messages in thread
From: Eli Zaretskii @ 2023-05-08 18:27 UTC (permalink / raw)
  To: Stephen Berman; +Cc: luangruo, 63271, juri

> From: Stephen Berman <stephen.berman@gmx.net>
> Cc: Juri Linkov <juri@linkov.net>,  luangruo@yahoo.com,  63271@debbugs.gnu.org
> Date: Mon, 08 May 2023 20:20:31 +0200
> 
> The image that Juri posted (which appears to be from a no-toolkit build)
> differs from what I see (under Gtk3), which is simply that the
> problematic strings show no mouse-face highlighting when the mouse
> pointer moves over them.

mouse-face specifies only the background color, so I'm at a loss how
could a font affect that.  There's something I'm missing here.  Like
some corruption of the realized faces or something.

Do you see the same in Emacs 28 and 27?  If some older version doesn't
show this, any chance of bisecting it?

Thanks.





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-08 18:27                   ` Eli Zaretskii
@ 2023-05-08 18:47                     ` Stephen Berman
  2023-05-08 19:09                       ` Juri Linkov
  0 siblings, 1 reply; 54+ messages in thread
From: Stephen Berman @ 2023-05-08 18:47 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: luangruo, 63271, juri

On Mon, 08 May 2023 21:27:49 +0300 Eli Zaretskii <eliz@gnu.org> wrote:

>> From: Stephen Berman <stephen.berman@gmx.net>
>> Cc: Juri Linkov <juri@linkov.net>,  luangruo@yahoo.com,  63271@debbugs.gnu.org
>> Date: Mon, 08 May 2023 20:20:31 +0200
>>
>> The image that Juri posted (which appears to be from a no-toolkit build)
>> differs from what I see (under Gtk3), which is simply that the
>> problematic strings show no mouse-face highlighting when the mouse
>> pointer moves over them.
>
> mouse-face specifies only the background color, so I'm at a loss how
> could a font affect that.  There's something I'm missing here.  Like
> some corruption of the realized faces or something.
>
> Do you see the same in Emacs 28 and 27?  If some older version doesn't
> show this, any chance of bisecting it?

I cannot reproduce the problematic display in Emacs 28.  I'll see if I
can bisect, but it may take a while.

Steve Berman





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-08 18:47                     ` Stephen Berman
@ 2023-05-08 19:09                       ` Juri Linkov
  2023-05-08 20:46                         ` Stephen Berman
  0 siblings, 1 reply; 54+ messages in thread
From: Juri Linkov @ 2023-05-08 19:09 UTC (permalink / raw)
  To: Stephen Berman; +Cc: luangruo, Eli Zaretskii, 63271

>> mouse-face specifies only the background color, so I'm at a loss how
>> could a font affect that.  There's something I'm missing here.  Like
>> some corruption of the realized faces or something.
>>
>> Do you see the same in Emacs 28 and 27?  If some older version doesn't
>> show this, any chance of bisecting it?
>
> I cannot reproduce the problematic display in Emacs 28.  I'll see if I
> can bisect, but it may take a while.

I tried to bisect and see the problem in

61b9f2c3179..: 2022-11-17 * lisp/emacs-lisp/shortdoc.el (sequence): Don't use cl-lib (bug#59319)

but not in

0636e1066bb..: 2022-11-16 ; Don't unnecessarily use non-ASCII characters in Texinfo

probably because 61b9f2c3179 is the last commit of a big merge at that time.





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-08 19:09                       ` Juri Linkov
@ 2023-05-08 20:46                         ` Stephen Berman
  2023-05-09  6:47                           ` Juri Linkov
  0 siblings, 1 reply; 54+ messages in thread
From: Stephen Berman @ 2023-05-08 20:46 UTC (permalink / raw)
  To: Juri Linkov; +Cc: luangruo, Eli Zaretskii, 63271

On Mon, 08 May 2023 22:09:16 +0300 Juri Linkov <juri@linkov.net> wrote:

>>> mouse-face specifies only the background color, so I'm at a loss how
>>> could a font affect that.  There's something I'm missing here.  Like
>>> some corruption of the realized faces or something.
>>>
>>> Do you see the same in Emacs 28 and 27?  If some older version doesn't
>>> show this, any chance of bisecting it?
>>
>> I cannot reproduce the problematic display in Emacs 28.  I'll see if I
>> can bisect, but it may take a while.
>
> I tried to bisect and see the problem in
>
> 61b9f2c3179..: 2022-11-17 * lisp/emacs-lisp/shortdoc.el (sequence): Don't use
> cl-lib (bug#59319)
>
> but not in
>
> 0636e1066bb..: 2022-11-16 ; Don't unnecessarily use non-ASCII characters in Texinfo

I checked out those commits and rebuilt emacs and can confirm that the
build from 61b9f2c3179 has the problem and the build from 0636e1066bb
does not.

> probably because 61b9f2c3179 is the last commit of a big merge at that time.

If I'm not misreading the vc-change-log, it looks like that commit is
from Stefan's merge of the noverlay branch, and it seems not implausible
that some change in that branch is the source of the problem.  (But my
git skills are elementary, so I may well be misreading it.)  Is it
possible to confine bisection to the commits from a merge, and if so,
how?

Steve Berman





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-08 15:56             ` Juri Linkov
  2023-05-08 16:14               ` Eli Zaretskii
@ 2023-05-09  1:08               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-05-09  6:43                 ` Juri Linkov
  1 sibling, 1 reply; 54+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-05-09  1:08 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Eli Zaretskii, 63271

Juri Linkov <juri@linkov.net> writes:

>>> I think your guess about fonts involved is right
>>> because the problem disappears when the tab-line face
>>> doesn't inherit from the 'variable-pitch' face.
>>
>> How can a face affect mouse-highlight?
>
> Here is the minimal test case:
>
>   (insert " " (propertize "TODO"
>                           'face '(:inherit variable-pitch)
>                           'mouse-face 'highlight))
>
> that causes such effect after moving point over highlighted text
> in fundamental-mode:
>
> x

I don't see this in an Xft build, if it helps.  If you place the
following instrumentation in ftcrfont.c:

diff --git a/src/ftcrfont.c b/src/ftcrfont.c
index c9a4de8137b..1e711152ba6 100644
--- a/src/ftcrfont.c
+++ b/src/ftcrfont.c
@@ -593,6 +593,10 @@ ftcrfont_draw (struct glyph_string *s,
       s->background_filled_p = 1;
       cairo_rectangle (cr, x, y - FONT_BASE (s->font),
 		       s->width, FONT_HEIGHT (s->font));
+      fprintf (stderr, "ftcrfont_draw: %d, %d, %d, %d, %d\n",
+	       x, y - FONT_BASE (s->font),
+	       s->width, FONT_HEIGHT (s->font),
+	       s->hl);
       cairo_fill (cr);
     }
 

then move point over the text under mouse face, what is printed?






^ permalink raw reply related	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-09  1:08               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-05-09  6:43                 ` Juri Linkov
  2023-05-09  8:43                   ` Eli Zaretskii
  0 siblings, 1 reply; 54+ messages in thread
From: Juri Linkov @ 2023-05-09  6:43 UTC (permalink / raw)
  To: Po Lu; +Cc: Eli Zaretskii, 63271

>>   (insert " " (propertize "TODO"
>>                           'face '(:inherit variable-pitch)
>>                           'mouse-face 'highlight))
>
> I don't see this in an Xft build, if it helps.  If you place the
> following instrumentation in ftcrfont.c:
>
> diff --git a/src/ftcrfont.c b/src/ftcrfont.c
> index c9a4de8137b..1e711152ba6 100644
> --- a/src/ftcrfont.c
> +++ b/src/ftcrfont.c
> @@ -593,6 +593,10 @@ ftcrfont_draw (struct glyph_string *s,
>        s->background_filled_p = 1;
>        cairo_rectangle (cr, x, y - FONT_BASE (s->font),
>  		       s->width, FONT_HEIGHT (s->font));
> +      fprintf (stderr, "ftcrfont_draw: %d, %d, %d, %d, %d\n",
> +	       x, y - FONT_BASE (s->font),
> +	       s->width, FONT_HEIGHT (s->font),
> +	       s->hl);
>        cairo_fill (cr);
>      }
>  
> then move point over the text under mouse face, what is printed?

This is after moving point backward from last "O" to first "T" in "TODO"
while mouse is over the text:

ftcrfont_draw: 25, 56, 10, 19, 0
ftcrfont_draw: 35, 56, 48, 19, 0
ftcrfont_draw: 58, 56, 12, 19, 2
ftcrfont_draw: 25, 56, 10, 19, 0
ftcrfont_draw: 35, 56, 48, 19, 0
ftcrfont_draw: 58, 56, 12, 19, 2
ftcrfont_draw: 25, 56, 10, 19, 0
ftcrfont_draw: 35, 56, 48, 19, 0
ftcrfont_draw: 45, 56, 13, 19, 2
ftcrfont_draw: 25, 56, 10, 19, 0
ftcrfont_draw: 35, 56, 48, 19, 0
ftcrfont_draw: 45, 56, 13, 19, 2
ftcrfont_draw: 25, 56, 10, 19, 0
ftcrfont_draw: 35, 56, 48, 19, 0
ftcrfont_draw: 25, 56, 10, 19, 0
ftcrfont_draw: 35, 56, 10, 19, 0
ftcrfont_draw: 35, 56, 10, 19, 2
ftcrfont_draw: 25, 56, 10, 19, 0
ftcrfont_draw: 35, 56, 48, 19, 0
ftcrfont_draw: 25, 56, 10, 19, 0
ftcrfont_draw: 35, 56, 10, 19, 0
ftcrfont_draw: 35, 56, 10, 19, 2

and forward from "T" to "O":

ftcrfont_draw: 25, 56, 10, 19, 0
ftcrfont_draw: 35, 56, 48, 19, 0
ftcrfont_draw: 45, 56, 13, 19, 2
ftcrfont_draw: 25, 56, 10, 19, 0
ftcrfont_draw: 35, 56, 48, 19, 0
ftcrfont_draw: 45, 56, 13, 19, 2
ftcrfont_draw: 25, 56, 10, 19, 0
ftcrfont_draw: 35, 56, 48, 19, 0
ftcrfont_draw: 58, 56, 12, 19, 2
ftcrfont_draw: 25, 56, 10, 19, 0
ftcrfont_draw: 35, 56, 48, 19, 0
ftcrfont_draw: 58, 56, 12, 19, 2
ftcrfont_draw: 25, 56, 10, 19, 0
ftcrfont_draw: 35, 56, 48, 19, 0
ftcrfont_draw: 70, 56, 13, 19, 2
ftcrfont_draw: 25, 56, 10, 19, 0
ftcrfont_draw: 35, 56, 48, 19, 0
ftcrfont_draw: 70, 56, 13, 19, 2





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-08 16:14               ` Eli Zaretskii
  2023-05-08 18:20                 ` Stephen Berman
@ 2023-05-09  6:45                 ` Juri Linkov
  2023-05-09  8:36                   ` Eli Zaretskii
  1 sibling, 1 reply; 54+ messages in thread
From: Juri Linkov @ 2023-05-09  6:45 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: luangruo, 63271

> And what exactly is the manifestation of the problem in the image you
> posted? that wide black part that hides the letters "ODO"? or
> something else?

The letters turn into black boxes while moving the cursor over them
when the mouse pointer is over the text.





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-08 20:46                         ` Stephen Berman
@ 2023-05-09  6:47                           ` Juri Linkov
  2023-05-09 19:06                             ` Juri Linkov
  0 siblings, 1 reply; 54+ messages in thread
From: Juri Linkov @ 2023-05-09  6:47 UTC (permalink / raw)
  To: Stephen Berman; +Cc: luangruo, Eli Zaretskii, 63271

>>> I cannot reproduce the problematic display in Emacs 28.  I'll see if I
>>> can bisect, but it may take a while.
>>
>> I tried to bisect and see the problem in
>>
>> 61b9f2c3179..: 2022-11-17 * lisp/emacs-lisp/shortdoc.el (sequence): Don't use
>> cl-lib (bug#59319)
>>
>> but not in
>>
>> 0636e1066bb..: 2022-11-16 ; Don't unnecessarily use non-ASCII characters in Texinfo
>
> I checked out those commits and rebuilt emacs and can confirm that the
> build from 61b9f2c3179 has the problem and the build from 0636e1066bb
> does not.

Actually, 0636e1066bb was one of the latest commits on emacs-28.
So we need to continue bisecting on emacs-29 down from the commit
be42fdc6dc6..: 2022-04-13 where the test case still fails.
This is one of the last commits before huge merges,
so the history below from it is quite flat and shallow,
and thus easier to bisect.

>> probably because 61b9f2c3179 is the last commit of a big merge at that time.
>
> If I'm not misreading the vc-change-log, it looks like that commit is
> from Stefan's merge of the noverlay branch, and it seems not implausible
> that some change in that branch is the source of the problem.  (But my
> git skills are elementary, so I may well be misreading it.)  Is it
> possible to confine bisection to the commits from a merge, and if so,
> how?

The git history is a mess, it's really hard to read vc-change-log
interspersed with very deep merges.





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-09  6:45                 ` Juri Linkov
@ 2023-05-09  8:36                   ` Eli Zaretskii
  2023-05-09  9:49                     ` Stephen Berman
  0 siblings, 1 reply; 54+ messages in thread
From: Eli Zaretskii @ 2023-05-09  8:36 UTC (permalink / raw)
  To: Juri Linkov, Stephen Berman; +Cc: luangruo, 63271

> From: Juri Linkov <juri@linkov.net>
> Cc: luangruo@yahoo.com,  63271@debbugs.gnu.org
> Date: Tue, 09 May 2023 09:45:16 +0300
> 
> > And what exactly is the manifestation of the problem in the image you
> > posted? that wide black part that hides the letters "ODO"? or
> > something else?
> 
> The letters turn into black boxes while moving the cursor over them
> when the mouse pointer is over the text.

Could you or Stephen please perform the following experiment, using
the latest emacs-29 branch, and report the results:

  $ gdb ./emacs
  ...
  (gdb) break xdisp.c:33519
  (gdb) run -Q

The breakpoint is here:

	  if (end_hpos > start_hpos)
	    {
	      draw_row_with_mouse_face (w, start_x, row,
					start_hpos, end_hpos, draw);

	      row->mouse_face_p   <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
		= draw == DRAW_MOUSE_FACE || draw == DRAW_IMAGE_RAISED;
	    }

Once inside Emacs after "run -Q", first turn off blink-cursor-mode and
global-eldoc-mode, then evaluate the recipe:

  M-: (insert " " (propertize "TODO" 'face '(:inherit variable-pitch) 'mouse-face 'highlight)) RET

Then move the mouse pointer over the "TODO" text.  The breakpoint will
break, and GDB will kick in.  Then type:

  (gdb) pgrow
  (gdb) continue

The breakpoint will break again, and the display of Emacs you are
debugging will show the mouse highlight.  Then type again:

  (gdb) pgrow

And show everything that GDB displays as result of the two "pgrow"
commands.

Some notes:

  . the breakpoint might break before you evaluate the recipe, if you
    happen to move the mouse pointer above some mouse-sensitive
    portion of the display, like the tool bar or the mode line -- in
    that case just type "continue" at the GDB prompt until it no
    longer shows the prompt (meaning Emacs is running again);
  . the "pgrow" command is defined in src/.gdbinit file in the Emacs
    tree, so you need to start Emacs from the src directory for GDB to
    pick up that definition; alternatively, you could tell GDB to read
    that file explicitly by typing "source /path/to/emacs/src/.gdbinit"
    once inside GDB, before "run -Q";
  . if your Emacs is built with optimizations, the breakpoint might
    not break, or break not under the expected conditions; in that
    case, rebuild with CFLAGS='-O0 -g3' and repeat the above

Thanks.





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-09  6:43                 ` Juri Linkov
@ 2023-05-09  8:43                   ` Eli Zaretskii
  2023-05-09 11:44                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 54+ messages in thread
From: Eli Zaretskii @ 2023-05-09  8:43 UTC (permalink / raw)
  To: Juri Linkov; +Cc: luangruo, 63271

> From: Juri Linkov <juri@linkov.net>
> Cc: Eli Zaretskii <eliz@gnu.org>,  63271@debbugs.gnu.org
> Date: Tue, 09 May 2023 09:43:29 +0300
> 
> > --- a/src/ftcrfont.c
> > +++ b/src/ftcrfont.c
> > @@ -593,6 +593,10 @@ ftcrfont_draw (struct glyph_string *s,
> >        s->background_filled_p = 1;
> >        cairo_rectangle (cr, x, y - FONT_BASE (s->font),
> >  		       s->width, FONT_HEIGHT (s->font));
> > +      fprintf (stderr, "ftcrfont_draw: %d, %d, %d, %d, %d\n",
> > +	       x, y - FONT_BASE (s->font),
> > +	       s->width, FONT_HEIGHT (s->font),
> > +	       s->hl);
> >        cairo_fill (cr);
> >      }
> >  
> > then move point over the text under mouse face, what is printed?
> 
> This is after moving point backward from last "O" to first "T" in "TODO"
> while mouse is over the text:
> 
> ftcrfont_draw: 25, 56, 10, 19, 0
> ftcrfont_draw: 35, 56, 48, 19, 0
> ftcrfont_draw: 58, 56, 12, 19, 2
> ftcrfont_draw: 25, 56, 10, 19, 0
> ftcrfont_draw: 35, 56, 48, 19, 0
> ftcrfont_draw: 58, 56, 12, 19, 2
> ftcrfont_draw: 25, 56, 10, 19, 0
> ftcrfont_draw: 35, 56, 48, 19, 0
> ftcrfont_draw: 45, 56, 13, 19, 2
> ftcrfont_draw: 25, 56, 10, 19, 0
> ftcrfont_draw: 35, 56, 48, 19, 0
> ftcrfont_draw: 45, 56, 13, 19, 2
> ftcrfont_draw: 25, 56, 10, 19, 0
> ftcrfont_draw: 35, 56, 48, 19, 0
> ftcrfont_draw: 25, 56, 10, 19, 0
> ftcrfont_draw: 35, 56, 10, 19, 0
> ftcrfont_draw: 35, 56, 10, 19, 2
> ftcrfont_draw: 25, 56, 10, 19, 0
> ftcrfont_draw: 35, 56, 48, 19, 0
> ftcrfont_draw: 25, 56, 10, 19, 0
> ftcrfont_draw: 35, 56, 10, 19, 0
> ftcrfont_draw: 35, 56, 10, 19, 2
> 
> and forward from "T" to "O":
> 
> ftcrfont_draw: 25, 56, 10, 19, 0
> ftcrfont_draw: 35, 56, 48, 19, 0
> ftcrfont_draw: 45, 56, 13, 19, 2
> ftcrfont_draw: 25, 56, 10, 19, 0
> ftcrfont_draw: 35, 56, 48, 19, 0
> ftcrfont_draw: 45, 56, 13, 19, 2
> ftcrfont_draw: 25, 56, 10, 19, 0
> ftcrfont_draw: 35, 56, 48, 19, 0
> ftcrfont_draw: 58, 56, 12, 19, 2
> ftcrfont_draw: 25, 56, 10, 19, 0
> ftcrfont_draw: 35, 56, 48, 19, 0
> ftcrfont_draw: 58, 56, 12, 19, 2
> ftcrfont_draw: 25, 56, 10, 19, 0
> ftcrfont_draw: 35, 56, 48, 19, 0
> ftcrfont_draw: 70, 56, 13, 19, 2
> ftcrfont_draw: 25, 56, 10, 19, 0
> ftcrfont_draw: 35, 56, 48, 19, 0
> ftcrfont_draw: 70, 56, 13, 19, 2

s->hl == 2 means DRAW_CURSOR.  Why does Emacs draw cursor -- did you
s->move point or did you move the mouse pointer?  I thought Po Lu
s->meant the latter, not the former.





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-09  8:36                   ` Eli Zaretskii
@ 2023-05-09  9:49                     ` Stephen Berman
  2023-05-09 10:07                       ` Stephen Berman
  2023-05-09 10:14                       ` Eli Zaretskii
  0 siblings, 2 replies; 54+ messages in thread
From: Stephen Berman @ 2023-05-09  9:49 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: luangruo, 63271, Juri Linkov

On Tue, 09 May 2023 11:36:01 +0300 Eli Zaretskii <eliz@gnu.org> wrote:

>> From: Juri Linkov <juri@linkov.net>
>> Cc: luangruo@yahoo.com,  63271@debbugs.gnu.org
>> Date: Tue, 09 May 2023 09:45:16 +0300
>>
>> > And what exactly is the manifestation of the problem in the image you
>> > posted? that wide black part that hides the letters "ODO"? or
>> > something else?
>>
>> The letters turn into black boxes while moving the cursor over them
>> when the mouse pointer is over the text.
>
> Could you or Stephen please perform the following experiment, using
> the latest emacs-29 branch, and report the results:
>
>   $ gdb ./emacs
>   ...
>   (gdb) break xdisp.c:33519
>   (gdb) run -Q
>
> The breakpoint is here:
>
> 	  if (end_hpos > start_hpos)
> 	    {
> 	      draw_row_with_mouse_face (w, start_x, row,
> 					start_hpos, end_hpos, draw);
>
> 	      row->mouse_face_p   <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> 		= draw == DRAW_MOUSE_FACE || draw == DRAW_IMAGE_RAISED;
> 	    }
>
> Once inside Emacs after "run -Q", first turn off blink-cursor-mode and
> global-eldoc-mode, then evaluate the recipe:
>
>   M-: (insert " " (propertize "TODO" 'face '(:inherit variable-pitch) 'mouse-face 'highlight)) RET
>
> Then move the mouse pointer over the "TODO" text.  The breakpoint will
> break, and GDB will kick in.  Then type:
>
>   (gdb) pgrow
>   (gdb) continue
>
> The breakpoint will break again, and the display of Emacs you are
> debugging will show the mouse highlight.  Then type again:
>
>   (gdb) pgrow
>
> And show everything that GDB displays as result of the two "pgrow"
> commands.

Here's what I get:

Thread 1 "emacs" hit Breakpoint 3, show_mouse_face (
    hlinfo=hlinfo@entry=0x555556145870, draw=draw@entry=DRAW_MOUSE_FACE)
    at /home/steve/src/emacs/emacs-29/src/xdisp.c:33519
33519		      row->mouse_face_p
(gdb) pgrow
TEXT: 6 glyphs
  0    0: CHAR[ ] pos=146 blev=0,btyp=L w=8 a+d=13+4 MB
  1    8: CHAR[T] pos=147 blev=0,btyp=L w=8 a+d=13+4 MB
  2   16: CHAR[O] pos=148 blev=0,btyp=L w=8 a+d=13+4 MB
  3   24: CHAR[D] pos=149 blev=0,btyp=L w=8 a+d=13+4 MB
  4   32: CHAR[O] pos=150 blev=0,btyp=L w=8 a+d=13+4 MB
  5   40: CHAR[ ] pos=0 blev=0,btyp=B w=8 a+d=13+4 MB
(gdb) continue
Continuing.

Thread 1 "emacs" hit Breakpoint 3, show_mouse_face (hlinfo=0x555556145870,
    draw=draw@entry=DRAW_MOUSE_FACE)
    at /home/steve/src/emacs/emacs-29/src/xdisp.c:33519
33519		      row->mouse_face_p
(gdb) pgrow
TEXT: 6 glyphs
  0    0: CHAR[ ] pos=146 blev=0,btyp=L w=8 a+d=13+4 MB
  1    8: CHAR[T] pos=147 blev=0,btyp=L w=8 a+d=13+4 MB
  2   16: CHAR[O] pos=148 blev=0,btyp=L w=8 a+d=13+4 MB
  3   24: CHAR[D] pos=149 blev=0,btyp=L w=8 a+d=13+4 MB
  4   32: CHAR[O] pos=150 blev=0,btyp=L w=8 a+d=13+4 MB
  5   40: CHAR[ ] pos=0 blev=0,btyp=B w=8 a+d=13+4 MB

Steve Berman





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-09  9:49                     ` Stephen Berman
@ 2023-05-09 10:07                       ` Stephen Berman
  2023-05-09 10:21                         ` Eli Zaretskii
  2023-05-09 10:14                       ` Eli Zaretskii
  1 sibling, 1 reply; 54+ messages in thread
From: Stephen Berman @ 2023-05-09 10:07 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: luangruo, 63271, Juri Linkov

On Tue, 09 May 2023 11:49:00 +0200 Stephen Berman <stephen.berman@gmx.net> wrote:

> On Tue, 09 May 2023 11:36:01 +0300 Eli Zaretskii <eliz@gnu.org> wrote:
>
>>> From: Juri Linkov <juri@linkov.net>
>>> Cc: luangruo@yahoo.com,  63271@debbugs.gnu.org
>>> Date: Tue, 09 May 2023 09:45:16 +0300
>>>
>>> > And what exactly is the manifestation of the problem in the image you
>>> > posted? that wide black part that hides the letters "ODO"? or
>>> > something else?
>>>
>>> The letters turn into black boxes while moving the cursor over them
>>> when the mouse pointer is over the text.
>>
>> Could you or Stephen please perform the following experiment, using
>> the latest emacs-29 branch, and report the results:
>>
>>   $ gdb ./emacs
>>   ...
>>   (gdb) break xdisp.c:33519
>>   (gdb) run -Q
>>
>> The breakpoint is here:
>>
>> 	  if (end_hpos > start_hpos)
>> 	    {
>> 	      draw_row_with_mouse_face (w, start_x, row,
>> 					start_hpos, end_hpos, draw);
>>
>> 	      row->mouse_face_p   <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>> 		= draw == DRAW_MOUSE_FACE || draw == DRAW_IMAGE_RAISED;
>> 	    }
>>
>> Once inside Emacs after "run -Q", first turn off blink-cursor-mode and
>> global-eldoc-mode, then evaluate the recipe:
>>
>>   M-: (insert " " (propertize "TODO" 'face '(:inherit variable-pitch) 'mouse-face 'highlight)) RET
>>
>> Then move the mouse pointer over the "TODO" text.  The breakpoint will
>> break, and GDB will kick in.  Then type:
>>
>>   (gdb) pgrow
>>   (gdb) continue
>>
>> The breakpoint will break again, and the display of Emacs you are
>> debugging will show the mouse highlight.  Then type again:
>>
>>   (gdb) pgrow
>>
>> And show everything that GDB displays as result of the two "pgrow"
>> commands.
>
> Here's what I get:
>
> Thread 1 "emacs" hit Breakpoint 3, show_mouse_face (
>     hlinfo=hlinfo@entry=0x555556145870, draw=draw@entry=DRAW_MOUSE_FACE)
>     at /home/steve/src/emacs/emacs-29/src/xdisp.c:33519
> 33519		      row->mouse_face_p
> (gdb) pgrow
> TEXT: 6 glyphs
>   0    0: CHAR[ ] pos=146 blev=0,btyp=L w=8 a+d=13+4 MB
>   1    8: CHAR[T] pos=147 blev=0,btyp=L w=8 a+d=13+4 MB
>   2   16: CHAR[O] pos=148 blev=0,btyp=L w=8 a+d=13+4 MB
>   3   24: CHAR[D] pos=149 blev=0,btyp=L w=8 a+d=13+4 MB
>   4   32: CHAR[O] pos=150 blev=0,btyp=L w=8 a+d=13+4 MB
>   5   40: CHAR[ ] pos=0 blev=0,btyp=B w=8 a+d=13+4 MB
> (gdb) continue
> Continuing.
>
> Thread 1 "emacs" hit Breakpoint 3, show_mouse_face (hlinfo=0x555556145870,
>     draw=draw@entry=DRAW_MOUSE_FACE)
>     at /home/steve/src/emacs/emacs-29/src/xdisp.c:33519
> 33519		      row->mouse_face_p
> (gdb) pgrow
> TEXT: 6 glyphs
>   0    0: CHAR[ ] pos=146 blev=0,btyp=L w=8 a+d=13+4 MB
>   1    8: CHAR[T] pos=147 blev=0,btyp=L w=8 a+d=13+4 MB
>   2   16: CHAR[O] pos=148 blev=0,btyp=L w=8 a+d=13+4 MB
>   3   24: CHAR[D] pos=149 blev=0,btyp=L w=8 a+d=13+4 MB
>   4   32: CHAR[O] pos=150 blev=0,btyp=L w=8 a+d=13+4 MB
>   5   40: CHAR[ ] pos=0 blev=0,btyp=B w=8 a+d=13+4 MB

When I carried out your instructions exactly, I was surprised to see
that "TODO" showed mouse-face highlighting after typing `continue'.
Then I ran my test outside of gdb and indeed, in *scratch* the
problematic characters do show mouse-face highlighting, i.e. in
lisp-interaction mode, but not in fundamental-mode.  Then I returned to
gdb and redid your instructions but switched to a buffer in
fundamental-mode before inserting the propertized string.  Here are the
results:

Thread 1 "emacs" hit Breakpoint 3, show_mouse_face (
    hlinfo=hlinfo@entry=0x555556145540, draw=draw@entry=DRAW_MOUSE_FACE)
    at /home/steve/src/emacs/emacs-29/src/xdisp.c:33519
33519		      row->mouse_face_p
(gdb) pgrow
TEXT: 6 glyphs
  0    0: CHAR[ ] pos=1 blev=0,btyp=L w=8 a+d=13+4 MB
  1    8: CHAR[T] pos=2 blev=0,btyp=L w=8 a+d=13+4 face=24 MB
  2   16: CHAR[O] pos=3 blev=0,btyp=L w=10 a+d=13+4 face=24 MB
  3   26: CHAR[D] pos=4 blev=0,btyp=L w=10 a+d=13+4 face=24 MB
  4   36: CHAR[O] pos=5 blev=0,btyp=L w=10 a+d=13+4 face=24 MB
  5   46: CHAR[ ] pos=0 blev=0,btyp=B w=8 a+d=13+4 MB
(gdb) continue
Continuing.

Thread 1 "emacs" hit Breakpoint 3, show_mouse_face (hlinfo=0x555556145540,
    draw=draw@entry=DRAW_MOUSE_FACE)
    at /home/steve/src/emacs/emacs-29/src/xdisp.c:33519
33519		      row->mouse_face_p
(gdb) pgrow
TEXT: 6 glyphs
  0    0: CHAR[ ] pos=1 blev=0,btyp=L w=8 a+d=13+4 MB
  1    8: CHAR[T] pos=2 blev=0,btyp=L w=8 a+d=13+4 face=24 MB
  2   16: CHAR[O] pos=3 blev=0,btyp=L w=10 a+d=13+4 face=24 MB
  3   26: CHAR[D] pos=4 blev=0,btyp=L w=10 a+d=13+4 face=24 MB
  4   36: CHAR[O] pos=5 blev=0,btyp=L w=10 a+d=13+4 face=24 MB
  5   46: CHAR[ ] pos=0 blev=0,btyp=B w=8 a+d=13+4 MB

Steve Berman





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-09  9:49                     ` Stephen Berman
  2023-05-09 10:07                       ` Stephen Berman
@ 2023-05-09 10:14                       ` Eli Zaretskii
  1 sibling, 0 replies; 54+ messages in thread
From: Eli Zaretskii @ 2023-05-09 10:14 UTC (permalink / raw)
  To: Stephen Berman; +Cc: luangruo, 63271, juri

> From: Stephen Berman <stephen.berman@gmx.net>
> Cc: Juri Linkov <juri@linkov.net>,  luangruo@yahoo.com,  63271@debbugs.gnu.org
> Date: Tue, 09 May 2023 11:49:00 +0200
> 
> Here's what I get:
> 
> Thread 1 "emacs" hit Breakpoint 3, show_mouse_face (
>     hlinfo=hlinfo@entry=0x555556145870, draw=draw@entry=DRAW_MOUSE_FACE)
>     at /home/steve/src/emacs/emacs-29/src/xdisp.c:33519
> 33519		      row->mouse_face_p
> (gdb) pgrow
> TEXT: 6 glyphs
>   0    0: CHAR[ ] pos=146 blev=0,btyp=L w=8 a+d=13+4 MB
>   1    8: CHAR[T] pos=147 blev=0,btyp=L w=8 a+d=13+4 MB
>   2   16: CHAR[O] pos=148 blev=0,btyp=L w=8 a+d=13+4 MB
>   3   24: CHAR[D] pos=149 blev=0,btyp=L w=8 a+d=13+4 MB
>   4   32: CHAR[O] pos=150 blev=0,btyp=L w=8 a+d=13+4 MB
>   5   40: CHAR[ ] pos=0 blev=0,btyp=B w=8 a+d=13+4 MB
> (gdb) continue
> Continuing.
> 
> Thread 1 "emacs" hit Breakpoint 3, show_mouse_face (hlinfo=0x555556145870,
>     draw=draw@entry=DRAW_MOUSE_FACE)
>     at /home/steve/src/emacs/emacs-29/src/xdisp.c:33519
> 33519		      row->mouse_face_p
> (gdb) pgrow
> TEXT: 6 glyphs
>   0    0: CHAR[ ] pos=146 blev=0,btyp=L w=8 a+d=13+4 MB
>   1    8: CHAR[T] pos=147 blev=0,btyp=L w=8 a+d=13+4 MB
>   2   16: CHAR[O] pos=148 blev=0,btyp=L w=8 a+d=13+4 MB
>   3   24: CHAR[D] pos=149 blev=0,btyp=L w=8 a+d=13+4 MB
>   4   32: CHAR[O] pos=150 blev=0,btyp=L w=8 a+d=13+4 MB
>   5   40: CHAR[ ] pos=0 blev=0,btyp=B w=8 a+d=13+4 MB

Thanks, so far so good.

Next experiment:

  $ gdb ./emacs
  [...]
  (gdb) break xterm.c:8119
  (gdb) run -Q

The breakpoint is here:

  else if (s->hl == DRAW_MOUSE_FACE)
    {
      x_set_mouse_face_gc (s);  <<<<<<<<<<<<<<<<<<<<<<<<<<<
      s->stippled_p = s->face->stipple != 0;
    }

Once again, inside Emacs disable blink-cursor-mode and
global-eldoc-mode, then evaluate the recipe:

  M-: (insert " " (propertize "TODO" 'face '(:inherit variable-pitch) 'mouse-face 'highlight)) RET

and move the mouse pointer to "TODO".  Each time it breaks, please
type:

  (gdb) print *s
  (gdb) print s->first_glyph - s->row->glyphs[1]

and show the results.  On my system the glyph_string s includes 5
glyphs (s->nchars = 5), and the last command above prints "1", which
means the first glyph of the glyph_string is the second glyph on its
screen line (since the line starts with a SPC character that doesn't
have the mouse-highlight face).





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-09 10:07                       ` Stephen Berman
@ 2023-05-09 10:21                         ` Eli Zaretskii
  2023-05-09 10:35                           ` Stephen Berman
  0 siblings, 1 reply; 54+ messages in thread
From: Eli Zaretskii @ 2023-05-09 10:21 UTC (permalink / raw)
  To: Stephen Berman; +Cc: luangruo, 63271, juri

> From: Stephen Berman <stephen.berman@gmx.net>
> Cc: Juri Linkov <juri@linkov.net>,  luangruo@yahoo.com,  63271@debbugs.gnu.org
> Date: Tue, 09 May 2023 12:07:25 +0200
> 
> When I carried out your instructions exactly, I was surprised to see
> that "TODO" showed mouse-face highlighting after typing `continue'.
> Then I ran my test outside of gdb and indeed, in *scratch* the
> problematic characters do show mouse-face highlighting, i.e. in
> lisp-interaction mode, but not in fundamental-mode.  Then I returned to
> gdb and redid your instructions but switched to a buffer in
> fundamental-mode before inserting the propertized string.  Here are the
> results:
> 
> Thread 1 "emacs" hit Breakpoint 3, show_mouse_face (
>     hlinfo=hlinfo@entry=0x555556145540, draw=draw@entry=DRAW_MOUSE_FACE)
>     at /home/steve/src/emacs/emacs-29/src/xdisp.c:33519
> 33519		      row->mouse_face_p
> (gdb) pgrow
> TEXT: 6 glyphs
>   0    0: CHAR[ ] pos=1 blev=0,btyp=L w=8 a+d=13+4 MB
>   1    8: CHAR[T] pos=2 blev=0,btyp=L w=8 a+d=13+4 face=24 MB
>   2   16: CHAR[O] pos=3 blev=0,btyp=L w=10 a+d=13+4 face=24 MB
>   3   26: CHAR[D] pos=4 blev=0,btyp=L w=10 a+d=13+4 face=24 MB
>   4   36: CHAR[O] pos=5 blev=0,btyp=L w=10 a+d=13+4 face=24 MB
>   5   46: CHAR[ ] pos=0 blev=0,btyp=B w=8 a+d=13+4 MB
> (gdb) continue
> Continuing.
> 
> Thread 1 "emacs" hit Breakpoint 3, show_mouse_face (hlinfo=0x555556145540,
>     draw=draw@entry=DRAW_MOUSE_FACE)
>     at /home/steve/src/emacs/emacs-29/src/xdisp.c:33519
> 33519		      row->mouse_face_p
> (gdb) pgrow
> TEXT: 6 glyphs
>   0    0: CHAR[ ] pos=1 blev=0,btyp=L w=8 a+d=13+4 MB
>   1    8: CHAR[T] pos=2 blev=0,btyp=L w=8 a+d=13+4 face=24 MB
>   2   16: CHAR[O] pos=3 blev=0,btyp=L w=10 a+d=13+4 face=24 MB
>   3   26: CHAR[D] pos=4 blev=0,btyp=L w=10 a+d=13+4 face=24 MB
>   4   36: CHAR[O] pos=5 blev=0,btyp=L w=10 a+d=13+4 face=24 MB
>   5   46: CHAR[ ] pos=0 blev=0,btyp=B w=8 a+d=13+4 MB

OK, thanks.  This is still OK, so please do this with the new
breakpoint as described in my other email.  It would be interesting to
see the difference between fundamental-mode and lisp-interaction-mode
with that second breakpoint.





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-09 10:21                         ` Eli Zaretskii
@ 2023-05-09 10:35                           ` Stephen Berman
  2023-05-09 11:50                             ` Eli Zaretskii
  0 siblings, 1 reply; 54+ messages in thread
From: Stephen Berman @ 2023-05-09 10:35 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: luangruo, 63271, juri

On Tue, 09 May 2023 13:21:36 +0300 Eli Zaretskii <eliz@gnu.org> wrote:

>> From: Stephen Berman <stephen.berman@gmx.net>
>> Cc: Juri Linkov <juri@linkov.net>,  luangruo@yahoo.com,  63271@debbugs.gnu.org
>> Date: Tue, 09 May 2023 12:07:25 +0200
>>
>> When I carried out your instructions exactly, I was surprised to see
>> that "TODO" showed mouse-face highlighting after typing `continue'.
>> Then I ran my test outside of gdb and indeed, in *scratch* the
>> problematic characters do show mouse-face highlighting, i.e. in
>> lisp-interaction mode, but not in fundamental-mode.  Then I returned to
>> gdb and redid your instructions but switched to a buffer in
>> fundamental-mode before inserting the propertized string.  Here are the
>> results:
>>
>> Thread 1 "emacs" hit Breakpoint 3, show_mouse_face (
>>     hlinfo=hlinfo@entry=0x555556145540, draw=draw@entry=DRAW_MOUSE_FACE)
>>     at /home/steve/src/emacs/emacs-29/src/xdisp.c:33519
>> 33519		      row->mouse_face_p
>> (gdb) pgrow
>> TEXT: 6 glyphs
>>   0    0: CHAR[ ] pos=1 blev=0,btyp=L w=8 a+d=13+4 MB
>>   1    8: CHAR[T] pos=2 blev=0,btyp=L w=8 a+d=13+4 face=24 MB
>>   2   16: CHAR[O] pos=3 blev=0,btyp=L w=10 a+d=13+4 face=24 MB
>>   3   26: CHAR[D] pos=4 blev=0,btyp=L w=10 a+d=13+4 face=24 MB
>>   4   36: CHAR[O] pos=5 blev=0,btyp=L w=10 a+d=13+4 face=24 MB
>>   5   46: CHAR[ ] pos=0 blev=0,btyp=B w=8 a+d=13+4 MB
>> (gdb) continue
>> Continuing.
>>
>> Thread 1 "emacs" hit Breakpoint 3, show_mouse_face (hlinfo=0x555556145540,
>>     draw=draw@entry=DRAW_MOUSE_FACE)
>>     at /home/steve/src/emacs/emacs-29/src/xdisp.c:33519
>> 33519		      row->mouse_face_p
>> (gdb) pgrow
>> TEXT: 6 glyphs
>>   0    0: CHAR[ ] pos=1 blev=0,btyp=L w=8 a+d=13+4 MB
>>   1    8: CHAR[T] pos=2 blev=0,btyp=L w=8 a+d=13+4 face=24 MB
>>   2   16: CHAR[O] pos=3 blev=0,btyp=L w=10 a+d=13+4 face=24 MB
>>   3   26: CHAR[D] pos=4 blev=0,btyp=L w=10 a+d=13+4 face=24 MB
>>   4   36: CHAR[O] pos=5 blev=0,btyp=L w=10 a+d=13+4 face=24 MB
>>   5   46: CHAR[ ] pos=0 blev=0,btyp=B w=8 a+d=13+4 MB
>
> OK, thanks.  This is still OK, so please do this with the new
> breakpoint as described in my other email.  It would be interesting to
> see the difference between fundamental-mode and lisp-interaction-mode
> with that second breakpoint.

lisp-interaction-mode:

Thread 1 "emacs" hit Breakpoint 3, x_set_glyph_string_gc (
    s=s@entry=0x7fffffffc610)
    at /home/steve/src/emacs/emacs-29/src/xterm.c:8119
8119	      x_set_mouse_face_gc (s);
(gdb) print *s
$1 = {
  x = 16,
  y = 51,
  ybase = 64,
  width = 40,
  background_width = 633,
  height = 17,
  left_overhang = 0,
  right_overhang = 0,
  f = 0x55555611ef10,
  w = 0x55555611f160,
  row = 0x5555566bac90,
  area = TEXT_AREA,
  char2b = 0x7fffffffc5f0,
  nchars = 5,
  hl = DRAW_MOUSE_FACE,
  face = 0x5555568e1310,
  font = 0x55555603c258,
  cmp = 0x0,
  cmp_id = 0,
  cmp_from = 0,
  cmp_to = 0,
  extends_to_end_of_line_p = true,
  background_filled_p = false,
  font_not_found_p = false,
  stippled_p = false,
  for_overlaps = 0,
  padding_p = false,
  gc = 0x0,
  first_glyph = 0x55555626a030,
  img = 0x0,
  xwidget = 0x0,
  slice = {
    x = 0,
    y = 0,
    width = 0,
    height = 0
  },
  clip_head = 0x0,
  clip_tail = 0x0,
  clip = {{
      x = 0,
      y = 0,
      width = 0,
      height = 0
    }, {
      x = 0,
      y = 0,
      width = 0,
      height = 0
    }},
  num_clips = 0,
  underline_position = 0,
  underline_thickness = 0,
  next = 0x0,
  prev = 0x0
}
(gdb) print s->first_glyph - s->row->glyphs[1]
$2 = 1
(gdb) continue
Continuing.

Thread 1 "emacs" hit Breakpoint 3, x_set_glyph_string_gc (
    s=s@entry=0x7fffffffc610)
    at /home/steve/src/emacs/emacs-29/src/xterm.c:8119
8119	      x_set_mouse_face_gc (s);
(gdb) print *s
$3 = {
  x = 16,
  y = 51,
  ybase = 64,
  width = 40,
  background_width = 633,
  height = 17,
  left_overhang = 0,
  right_overhang = 0,
  f = 0x55555611ef10,
  w = 0x55555611f160,
  row = 0x5555566bac90,
  area = TEXT_AREA,
  char2b = 0x7fffffffc5f0,
  nchars = 5,
  hl = DRAW_MOUSE_FACE,
  face = 0x5555568e1310,
  font = 0x55555603c258,
  cmp = 0x0,
  cmp_id = 0,
  cmp_from = 0,
  cmp_to = 0,
  extends_to_end_of_line_p = true,
  background_filled_p = false,
  font_not_found_p = false,
  stippled_p = false,
  for_overlaps = 0,
  padding_p = false,
  gc = 0x0,
  first_glyph = 0x55555626a030,
  img = 0x0,
  xwidget = 0x0,
  slice = {
    x = 0,
    y = 0,
    width = 0,
    height = 0
  },
  clip_head = 0x0,
  clip_tail = 0x0,
  clip = {{
      x = 0,
      y = 0,
      width = 0,
      height = 0
    }, {
      x = 0,
      y = 0,
      width = 0,
      height = 0
    }},
  num_clips = 0,
  underline_position = 0,
  underline_thickness = 0,
  next = 0x0,
  prev = 0x0
}
(gdb) print s->first_glyph - s->row->glyphs[1]
$4 = 1
(gdb) continue
Continuing.

Thread 1 "emacs" hit Breakpoint 3, x_set_glyph_string_gc (
    s=s@entry=0x7fffffffc740)
    at /home/steve/src/emacs/emacs-29/src/xterm.c:8119
8119	      x_set_mouse_face_gc (s);
(gdb) print *s
$5 = {
  x = 16,
  y = 51,
  ybase = 64,
  width = 40,
  background_width = 633,
  height = 17,
  left_overhang = 0,
  right_overhang = 0,
  f = 0x55555611ef10,
  w = 0x55555611f160,
  row = 0x5555566bac90,
  area = TEXT_AREA,
  char2b = 0x7fffffffc720,
  nchars = 5,
  hl = DRAW_MOUSE_FACE,
  face = 0x5555568e1310,
  font = 0x55555603c258,
  cmp = 0x0,
  cmp_id = 0,
  cmp_from = 0,
  cmp_to = 0,
  extends_to_end_of_line_p = true,
  background_filled_p = false,
  font_not_found_p = false,
  stippled_p = false,
  for_overlaps = 0,
  padding_p = false,
  gc = 0x0,
  first_glyph = 0x55555626a030,
  img = 0x0,
  xwidget = 0x0,
  slice = {
    x = 0,
    y = 0,
    width = 0,
    height = 0
  },
  clip_head = 0x0,
  clip_tail = 0x0,
  clip = {{
      x = 0,
      y = 0,
      width = 0,
      height = 0
    }, {
      x = 0,
      y = 0,
      width = 0,
      height = 0
    }},
  num_clips = 0,
  underline_position = 0,
  underline_thickness = 0,
  next = 0x0,
  prev = 0x0
}
(gdb) print s->first_glyph - s->row->glyphs[1]
$6 = 1

============================================
fundamental-mode:

Thread 1 "emacs" hit Breakpoint 3, x_set_glyph_string_gc (
    s=s@entry=0x7fffffffc610)
    at /home/steve/src/emacs/emacs-29/src/xterm.c:8119
8119	      x_set_mouse_face_gc (s);
(gdb) print *s
$1 = {
  x = 16,
  y = 0,
  ybase = 13,
  width = 38,
  background_width = 38,
  height = 17,
  left_overhang = 1,
  right_overhang = 0,
  f = 0x5555560f8190,
  w = 0x5555560f83e0,
  row = 0x5555566c4920,
  area = TEXT_AREA,
  char2b = 0x7fffffffc5f0,
  nchars = 4,
  hl = DRAW_MOUSE_FACE,
  face = 0x5555561e69d0,
  font = 0x5555565ece88,
  cmp = 0x0,
  cmp_id = 0,
  cmp_from = 0,
  cmp_to = 0,
  extends_to_end_of_line_p = false,
  background_filled_p = true,
  font_not_found_p = false,
  stippled_p = false,
  for_overlaps = 0,
  padding_p = false,
  gc = 0x55555681ba10,
  first_glyph = 0x5555565c17e0,
  img = 0x0,
  xwidget = 0x0,
  slice = {
    x = 0,
    y = 0,
    width = 0,
    height = 0
  },
  clip_head = 0x7fffffffc610,
  clip_tail = 0x0,
  clip = {{
      x = 8,
      y = 0,
      width = 8,
      height = 17
    }, {
      x = 0,
      y = 0,
      width = 0,
      height = 0
    }},
  num_clips = 0,
  underline_position = 0,
  underline_thickness = 0,
  next = 0x7fffffffc500,
  prev = 0x7fffffffc400
}
(gdb) print s->first_glyph - s->row->glyphs[1]
$2 = 1
(gdb) continue
Continuing.

Thread 1 "emacs" hit Breakpoint 3, x_set_glyph_string_gc (
    s=s@entry=0x7fffffffc500)
    at /home/steve/src/emacs/emacs-29/src/xterm.c:8119
8119	      x_set_mouse_face_gc (s);
(gdb) print *s
$3 = {
  x = 54,
  y = 0,
  ybase = 13,
  width = 8,
  background_width = 595,
  height = 17,
  left_overhang = 0,
  right_overhang = 0,
  f = 0x5555560f8190,
  w = 0x5555560f83e0,
  row = 0x5555566c4920,
  area = TEXT_AREA,
  char2b = 0x7fffffffc4f0,
  nchars = 1,
  hl = DRAW_MOUSE_FACE,
  face = 0x5555561e69d0,
  font = 0x55555615b778,
  cmp = 0x0,
  cmp_id = 0,
  cmp_from = 0,
  cmp_to = 0,
  extends_to_end_of_line_p = true,
  background_filled_p = false,
  font_not_found_p = false,
  stippled_p = false,
  for_overlaps = 0,
  padding_p = false,
  gc = 0x0,
  first_glyph = 0x5555565c18a0,
  img = 0x0,
  xwidget = 0x0,
  slice = {
    x = 0,
    y = 0,
    width = 0,
    height = 0
  },
  clip_head = 0x7fffffffc610,
  clip_tail = 0x0,
  clip = {{
      x = 0,
      y = 0,
      width = 0,
      height = 0
    }, {
      x = 0,
      y = 0,
      width = 0,
      height = 0
    }},
  num_clips = 0,
  underline_position = 0,
  underline_thickness = 0,
  next = 0x0,
  prev = 0x7fffffffc610
}
(gdb) print s->first_glyph - s->row->glyphs[1]
$4 = 5
(gdb) continue
Continuing.

Thread 1 "emacs" hit Breakpoint 3, x_set_glyph_string_gc (
    s=s@entry=0x7fffffffc740)
    at /home/steve/src/emacs/emacs-29/src/xterm.c:8119
8119	      x_set_mouse_face_gc (s);
(gdb) print *s
$5 = {
  x = 16,
  y = 0,
  ybase = 13,
  width = 38,
  background_width = 38,
  height = 17,
  left_overhang = 1,
  right_overhang = 0,
  f = 0x5555560f8190,
  w = 0x5555560f83e0,
  row = 0x5555566c4920,
  area = TEXT_AREA,
  char2b = 0x7fffffffc720,
  nchars = 4,
  hl = DRAW_MOUSE_FACE,
  face = 0x5555561e69d0,
  font = 0x5555565ece88,
  cmp = 0x0,
  cmp_id = 0,
  cmp_from = 0,
  cmp_to = 0,
  extends_to_end_of_line_p = false,
  background_filled_p = true,
  font_not_found_p = false,
  stippled_p = false,
  for_overlaps = 0,
  padding_p = false,
  gc = 0x55555681ba10,
  first_glyph = 0x5555565c17e0,
  img = 0x0,
  xwidget = 0x0,
  slice = {
    x = 0,
    y = 0,
    width = 0,
    height = 0
  },
  clip_head = 0x7fffffffc740,
  clip_tail = 0x0,
  clip = {{
      x = 8,
      y = 0,
      width = 8,
      height = 17
    }, {
      x = 0,
      y = 0,
      width = 0,
      height = 0
    }},
  num_clips = 0,
  underline_position = 0,
  underline_thickness = 0,
  next = 0x7fffffffc630,
  prev = 0x7fffffffc530
}
(gdb) print s->first_glyph - s->row->glyphs[1]
$6 = 1
(gdb) continue
Continuing.

Thread 1 "emacs" hit Breakpoint 3, x_set_glyph_string_gc (
    s=s@entry=0x7fffffffc630)
    at /home/steve/src/emacs/emacs-29/src/xterm.c:8119
8119	      x_set_mouse_face_gc (s);
(gdb) print *s
$7 = {
  x = 54,
  y = 0,
  ybase = 13,
  width = 8,
  background_width = 595,
  height = 17,
  left_overhang = 0,
  right_overhang = 0,
  f = 0x5555560f8190,
  w = 0x5555560f83e0,
  row = 0x5555566c4920,
  area = TEXT_AREA,
  char2b = 0x7fffffffc620,
  nchars = 1,
  hl = DRAW_MOUSE_FACE,
  face = 0x5555561e69d0,
  font = 0x55555615b778,
  cmp = 0x0,
  cmp_id = 0,
  cmp_from = 0,
  cmp_to = 0,
  extends_to_end_of_line_p = true,
  background_filled_p = false,
  font_not_found_p = false,
  stippled_p = false,
  for_overlaps = 0,
  padding_p = false,
  gc = 0x0,
  first_glyph = 0x5555565c18a0,
  img = 0x0,
  xwidget = 0x0,
  slice = {
    x = 0,
    y = 0,
    width = 0,
    height = 0
  },
  clip_head = 0x7fffffffc740,
  clip_tail = 0x0,
  clip = {{
      x = 0,
      y = 0,
      width = 0,
      height = 0
    }, {
      x = 0,
      y = 0,
      width = 0,
      height = 0
    }},
  num_clips = 0,
  underline_position = 0,
  underline_thickness = 0,
  next = 0x0,
  prev = 0x7fffffffc740
}
(gdb) print s->first_glyph - s->row->glyphs[1]
$8 = 5

Steve Berman





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-09  8:43                   ` Eli Zaretskii
@ 2023-05-09 11:44                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 54+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-05-09 11:44 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 63271, Juri Linkov

Eli Zaretskii <eliz@gnu.org> writes:

> s->hl == 2 means DRAW_CURSOR.  Why does Emacs draw cursor -- did you
> move point or did you move the mouse pointer?  I thought Po Lu meant
> the latter, not the former.

I meant moving point with the entirety of the text under the mouse
pointer.

I don't see anything obviously wrong here though, sadly.





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-09 10:35                           ` Stephen Berman
@ 2023-05-09 11:50                             ` Eli Zaretskii
  2023-05-09 12:43                               ` Stephen Berman
  0 siblings, 1 reply; 54+ messages in thread
From: Eli Zaretskii @ 2023-05-09 11:50 UTC (permalink / raw)
  To: Stephen Berman; +Cc: luangruo, 63271, juri

> From: Stephen Berman <stephen.berman@gmx.net>
> Cc: juri@linkov.net,  luangruo@yahoo.com,  63271@debbugs.gnu.org
> Date: Tue, 09 May 2023 12:35:35 +0200
> 
> > OK, thanks.  This is still OK, so please do this with the new
> > breakpoint as described in my other email.  It would be interesting to
> > see the difference between fundamental-mode and lisp-interaction-mode
> > with that second breakpoint.
> 
> lisp-interaction-mode:
> 
> Thread 1 "emacs" hit Breakpoint 3, x_set_glyph_string_gc (
>     s=s@entry=0x7fffffffc610)
>     at /home/steve/src/emacs/emacs-29/src/xterm.c:8119
> 8119	      x_set_mouse_face_gc (s);
> (gdb) print *s
> $1 = {
>   x = 16,
>   y = 51,
>   ybase = 64,
>   width = 40,
>   background_width = 633,
>   height = 17,
>   left_overhang = 0,
>   right_overhang = 0,
>   f = 0x55555611ef10,
>   w = 0x55555611f160,
>   row = 0x5555566bac90,
>   area = TEXT_AREA,
>   char2b = 0x7fffffffc5f0,
>   nchars = 5,
>   hl = DRAW_MOUSE_FACE,
>   face = 0x5555568e1310,
>   font = 0x55555603c258,
>   cmp = 0x0,
>   cmp_id = 0,
>   cmp_from = 0,
>   cmp_to = 0,
>   extends_to_end_of_line_p = true,
>   background_filled_p = false,
>   font_not_found_p = false,
>   stippled_p = false,
>   for_overlaps = 0,
>   padding_p = false,
>   gc = 0x0,
>   first_glyph = 0x55555626a030,
>   img = 0x0,
>   xwidget = 0x0,
>   slice = {
>     x = 0,
>     y = 0,
>     width = 0,
>     height = 0
>   },
>   clip_head = 0x0,
>   clip_tail = 0x0,
>   clip = {{
>       x = 0,
>       y = 0,
>       width = 0,
>       height = 0
>     }, {
>       x = 0,
>       y = 0,
>       width = 0,
>       height = 0
>     }},
>   num_clips = 0,
>   underline_position = 0,
>   underline_thickness = 0,
>   next = 0x0,
>   prev = 0x0
> }
> (gdb) print s->first_glyph - s->row->glyphs[1]
> $2 = 1
> (gdb) continue
> Continuing.
> 
> Thread 1 "emacs" hit Breakpoint 3, x_set_glyph_string_gc (
>     s=s@entry=0x7fffffffc610)
>     at /home/steve/src/emacs/emacs-29/src/xterm.c:8119
> 8119	      x_set_mouse_face_gc (s);
> (gdb) print *s
> $3 = {
>   x = 16,
>   y = 51,
>   ybase = 64,
>   width = 40,
>   background_width = 633,
>   height = 17,
>   left_overhang = 0,
>   right_overhang = 0,
>   f = 0x55555611ef10,
>   w = 0x55555611f160,
>   row = 0x5555566bac90,
>   area = TEXT_AREA,
>   char2b = 0x7fffffffc5f0,
>   nchars = 5,
>   hl = DRAW_MOUSE_FACE,
>   face = 0x5555568e1310,
>   font = 0x55555603c258,
>   cmp = 0x0,
>   cmp_id = 0,
>   cmp_from = 0,
>   cmp_to = 0,
>   extends_to_end_of_line_p = true,
>   background_filled_p = false,
>   font_not_found_p = false,
>   stippled_p = false,
>   for_overlaps = 0,
>   padding_p = false,
>   gc = 0x0,
>   first_glyph = 0x55555626a030,
>   img = 0x0,
>   xwidget = 0x0,
>   slice = {
>     x = 0,
>     y = 0,
>     width = 0,
>     height = 0
>   },
>   clip_head = 0x0,
>   clip_tail = 0x0,
>   clip = {{
>       x = 0,
>       y = 0,
>       width = 0,
>       height = 0
>     }, {
>       x = 0,
>       y = 0,
>       width = 0,
>       height = 0
>     }},
>   num_clips = 0,
>   underline_position = 0,
>   underline_thickness = 0,
>   next = 0x0,
>   prev = 0x0
> }
> (gdb) print s->first_glyph - s->row->glyphs[1]
> $4 = 1
> (gdb) continue
> Continuing.
> 
> Thread 1 "emacs" hit Breakpoint 3, x_set_glyph_string_gc (
>     s=s@entry=0x7fffffffc740)
>     at /home/steve/src/emacs/emacs-29/src/xterm.c:8119
> 8119	      x_set_mouse_face_gc (s);
> (gdb) print *s
> $5 = {
>   x = 16,
>   y = 51,
>   ybase = 64,
>   width = 40,
>   background_width = 633,
>   height = 17,
>   left_overhang = 0,
>   right_overhang = 0,
>   f = 0x55555611ef10,
>   w = 0x55555611f160,
>   row = 0x5555566bac90,
>   area = TEXT_AREA,
>   char2b = 0x7fffffffc720,
>   nchars = 5,
>   hl = DRAW_MOUSE_FACE,
>   face = 0x5555568e1310,
>   font = 0x55555603c258,
>   cmp = 0x0,
>   cmp_id = 0,
>   cmp_from = 0,
>   cmp_to = 0,
>   extends_to_end_of_line_p = true,
>   background_filled_p = false,
>   font_not_found_p = false,
>   stippled_p = false,
>   for_overlaps = 0,
>   padding_p = false,
>   gc = 0x0,
>   first_glyph = 0x55555626a030,
>   img = 0x0,
>   xwidget = 0x0,
>   slice = {
>     x = 0,
>     y = 0,
>     width = 0,
>     height = 0
>   },
>   clip_head = 0x0,
>   clip_tail = 0x0,
>   clip = {{
>       x = 0,
>       y = 0,
>       width = 0,
>       height = 0
>     }, {
>       x = 0,
>       y = 0,
>       width = 0,
>       height = 0
>     }},
>   num_clips = 0,
>   underline_position = 0,
>   underline_thickness = 0,
>   next = 0x0,
>   prev = 0x0
> }
> (gdb) print s->first_glyph - s->row->glyphs[1]
> $6 = 1
> 
> ============================================
> fundamental-mode:
> 
> Thread 1 "emacs" hit Breakpoint 3, x_set_glyph_string_gc (
>     s=s@entry=0x7fffffffc610)
>     at /home/steve/src/emacs/emacs-29/src/xterm.c:8119
> 8119	      x_set_mouse_face_gc (s);
> (gdb) print *s
> $1 = {
>   x = 16,
>   y = 0,
>   ybase = 13,
>   width = 38,
>   background_width = 38,
>   height = 17,
>   left_overhang = 1,
>   right_overhang = 0,
>   f = 0x5555560f8190,
>   w = 0x5555560f83e0,
>   row = 0x5555566c4920,
>   area = TEXT_AREA,
>   char2b = 0x7fffffffc5f0,
>   nchars = 4,
>   hl = DRAW_MOUSE_FACE,
>   face = 0x5555561e69d0,
>   font = 0x5555565ece88,
>   cmp = 0x0,
>   cmp_id = 0,
>   cmp_from = 0,
>   cmp_to = 0,
>   extends_to_end_of_line_p = false,
>   background_filled_p = true,
>   font_not_found_p = false,
>   stippled_p = false,
>   for_overlaps = 0,
>   padding_p = false,
>   gc = 0x55555681ba10,
>   first_glyph = 0x5555565c17e0,
>   img = 0x0,
>   xwidget = 0x0,
>   slice = {
>     x = 0,
>     y = 0,
>     width = 0,
>     height = 0
>   },
>   clip_head = 0x7fffffffc610,
>   clip_tail = 0x0,
>   clip = {{
>       x = 8,
>       y = 0,
>       width = 8,
>       height = 17
>     }, {
>       x = 0,
>       y = 0,
>       width = 0,
>       height = 0
>     }},
>   num_clips = 0,
>   underline_position = 0,
>   underline_thickness = 0,
>   next = 0x7fffffffc500,
>   prev = 0x7fffffffc400
> }
> (gdb) print s->first_glyph - s->row->glyphs[1]
> $2 = 1
> (gdb) continue
> Continuing.
> 
> Thread 1 "emacs" hit Breakpoint 3, x_set_glyph_string_gc (
>     s=s@entry=0x7fffffffc500)
>     at /home/steve/src/emacs/emacs-29/src/xterm.c:8119
> 8119	      x_set_mouse_face_gc (s);
> (gdb) print *s
> $3 = {
>   x = 54,
>   y = 0,
>   ybase = 13,
>   width = 8,
>   background_width = 595,
>   height = 17,
>   left_overhang = 0,
>   right_overhang = 0,
>   f = 0x5555560f8190,
>   w = 0x5555560f83e0,
>   row = 0x5555566c4920,
>   area = TEXT_AREA,
>   char2b = 0x7fffffffc4f0,
>   nchars = 1,
>   hl = DRAW_MOUSE_FACE,
>   face = 0x5555561e69d0,
>   font = 0x55555615b778,
>   cmp = 0x0,
>   cmp_id = 0,
>   cmp_from = 0,
>   cmp_to = 0,
>   extends_to_end_of_line_p = true,
>   background_filled_p = false,
>   font_not_found_p = false,
>   stippled_p = false,
>   for_overlaps = 0,
>   padding_p = false,
>   gc = 0x0,
>   first_glyph = 0x5555565c18a0,
>   img = 0x0,
>   xwidget = 0x0,
>   slice = {
>     x = 0,
>     y = 0,
>     width = 0,
>     height = 0
>   },
>   clip_head = 0x7fffffffc610,
>   clip_tail = 0x0,
>   clip = {{
>       x = 0,
>       y = 0,
>       width = 0,
>       height = 0
>     }, {
>       x = 0,
>       y = 0,
>       width = 0,
>       height = 0
>     }},
>   num_clips = 0,
>   underline_position = 0,
>   underline_thickness = 0,
>   next = 0x0,
>   prev = 0x7fffffffc610
> }
> (gdb) print s->first_glyph - s->row->glyphs[1]
> $4 = 5
> (gdb) continue
> Continuing.
> 
> Thread 1 "emacs" hit Breakpoint 3, x_set_glyph_string_gc (
>     s=s@entry=0x7fffffffc740)
>     at /home/steve/src/emacs/emacs-29/src/xterm.c:8119
> 8119	      x_set_mouse_face_gc (s);
> (gdb) print *s
> $5 = {
>   x = 16,
>   y = 0,
>   ybase = 13,
>   width = 38,
>   background_width = 38,
>   height = 17,
>   left_overhang = 1,
>   right_overhang = 0,
>   f = 0x5555560f8190,
>   w = 0x5555560f83e0,
>   row = 0x5555566c4920,
>   area = TEXT_AREA,
>   char2b = 0x7fffffffc720,
>   nchars = 4,
>   hl = DRAW_MOUSE_FACE,
>   face = 0x5555561e69d0,
>   font = 0x5555565ece88,
>   cmp = 0x0,
>   cmp_id = 0,
>   cmp_from = 0,
>   cmp_to = 0,
>   extends_to_end_of_line_p = false,
>   background_filled_p = true,
>   font_not_found_p = false,
>   stippled_p = false,
>   for_overlaps = 0,
>   padding_p = false,
>   gc = 0x55555681ba10,
>   first_glyph = 0x5555565c17e0,
>   img = 0x0,
>   xwidget = 0x0,
>   slice = {
>     x = 0,
>     y = 0,
>     width = 0,
>     height = 0
>   },
>   clip_head = 0x7fffffffc740,
>   clip_tail = 0x0,
>   clip = {{
>       x = 8,
>       y = 0,
>       width = 8,
>       height = 17
>     }, {
>       x = 0,
>       y = 0,
>       width = 0,
>       height = 0
>     }},
>   num_clips = 0,
>   underline_position = 0,
>   underline_thickness = 0,
>   next = 0x7fffffffc630,
>   prev = 0x7fffffffc530
> }
> (gdb) print s->first_glyph - s->row->glyphs[1]
> $6 = 1
> (gdb) continue
> Continuing.
> 
> Thread 1 "emacs" hit Breakpoint 3, x_set_glyph_string_gc (
>     s=s@entry=0x7fffffffc630)
>     at /home/steve/src/emacs/emacs-29/src/xterm.c:8119
> 8119	      x_set_mouse_face_gc (s);
> (gdb) print *s
> $7 = {
>   x = 54,
>   y = 0,
>   ybase = 13,
>   width = 8,
>   background_width = 595,
>   height = 17,
>   left_overhang = 0,
>   right_overhang = 0,
>   f = 0x5555560f8190,
>   w = 0x5555560f83e0,
>   row = 0x5555566c4920,
>   area = TEXT_AREA,
>   char2b = 0x7fffffffc620,
>   nchars = 1,
>   hl = DRAW_MOUSE_FACE,
>   face = 0x5555561e69d0,
>   font = 0x55555615b778,
>   cmp = 0x0,
>   cmp_id = 0,
>   cmp_from = 0,
>   cmp_to = 0,
>   extends_to_end_of_line_p = true,
>   background_filled_p = false,
>   font_not_found_p = false,
>   stippled_p = false,
>   for_overlaps = 0,
>   padding_p = false,
>   gc = 0x0,
>   first_glyph = 0x5555565c18a0,
>   img = 0x0,
>   xwidget = 0x0,
>   slice = {
>     x = 0,
>     y = 0,
>     width = 0,
>     height = 0
>   },
>   clip_head = 0x7fffffffc740,
>   clip_tail = 0x0,
>   clip = {{
>       x = 0,
>       y = 0,
>       width = 0,
>       height = 0
>     }, {
>       x = 0,
>       y = 0,
>       width = 0,
>       height = 0
>     }},
>   num_clips = 0,
>   underline_position = 0,
>   underline_thickness = 0,
>   next = 0x0,
>   prev = 0x7fffffffc740
> }
> (gdb) print s->first_glyph - s->row->glyphs[1]
> $8 = 5

This looks OK to me: it says we display 4 characters in one face and 1
more in another.  Which agrees with pgrow and with what I understand
should happen here: the 4 characters T O D O are displayed using the
font of the variable-pitch face, and the blank space after it is
displayed using the default face.

What do you see on the screen in this case?  Please describe the
visual appearance of each character in the case of fundamental-mode,
and perhaps also show a screenshot of the window as it is displayed
when the mouse-highlight becomes visible during this scenario.

Thanks.





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-09 11:50                             ` Eli Zaretskii
@ 2023-05-09 12:43                               ` Stephen Berman
  2023-05-09 12:52                                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-05-09 13:32                                 ` Eli Zaretskii
  0 siblings, 2 replies; 54+ messages in thread
From: Stephen Berman @ 2023-05-09 12:43 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: luangruo, 63271, juri

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

On Tue, 09 May 2023 14:50:30 +0300 Eli Zaretskii <eliz@gnu.org> wrote:

>> From: Stephen Berman <stephen.berman@gmx.net>
>> Cc: juri@linkov.net,  luangruo@yahoo.com,  63271@debbugs.gnu.org
>> Date: Tue, 09 May 2023 12:35:35 +0200
>>
>> > OK, thanks.  This is still OK, so please do this with the new
>> > breakpoint as described in my other email.  It would be interesting to
>> > see the difference between fundamental-mode and lisp-interaction-mode
>> > with that second breakpoint.
[...]
> This looks OK to me: it says we display 4 characters in one face and 1
> more in another.  Which agrees with pgrow and with what I understand
> should happen here: the 4 characters T O D O are displayed using the
> font of the variable-pitch face, and the blank space after it is
> displayed using the default face.
>
> What do you see on the screen in this case?  Please describe the
> visual appearance of each character in the case of fundamental-mode,
> and perhaps also show a screenshot of the window as it is displayed
> when the mouse-highlight becomes visible during this scenario.

Here's a screenshot of lisp-interaction-mode when the mouse-highlight
appears:


[-- Attachment #2: Screenshot_2023-05-09_14-10-03.png --]
[-- Type: image/png, Size: 5004 bytes --]

[-- Attachment #3: Type: text/plain, Size: 38 bytes --]


And here's one of fundamental-mode:


[-- Attachment #4: Screenshot_2023-05-09_14-20-12.png --]
[-- Type: image/png, Size: 3195 bytes --]

[-- Attachment #5: Type: text/plain, Size: 542 bytes --]


Aside from the difference in highlighting, another difference I failed
to notice before is that in fundamental-mode the string "TODO" is
displayed with DejaVu Sans but in lisp-interaction-mode with DejaVu Sans
Mono, although I used the same Lisp code with the face property
(:inherit variable-pitch) to enter the string in both buffers.  I guess
lisp-interaction-mode inhibits variable-pitch face and that's the reason
the mouse-highlighting appears on the problematic characters in that
mode, in contrast to fundamental-mode.

Steve Berman

^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-09 12:43                               ` Stephen Berman
@ 2023-05-09 12:52                                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-05-09 13:12                                   ` Stephen Berman
  2023-05-09 13:32                                 ` Eli Zaretskii
  1 sibling, 1 reply; 54+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-05-09 12:52 UTC (permalink / raw)
  To: Stephen Berman; +Cc: Eli Zaretskii, 63271, juri

Stephen Berman <stephen.berman@gmx.net> writes:

> On Tue, 09 May 2023 14:50:30 +0300 Eli Zaretskii <eliz@gnu.org> wrote:
>
>>> From: Stephen Berman <stephen.berman@gmx.net>
>>> Cc: juri@linkov.net,  luangruo@yahoo.com,  63271@debbugs.gnu.org
>>> Date: Tue, 09 May 2023 12:35:35 +0200
>>>
>>> > OK, thanks.  This is still OK, so please do this with the new
>>> > breakpoint as described in my other email.  It would be interesting to
>>> > see the difference between fundamental-mode and lisp-interaction-mode
>>> > with that second breakpoint.
> [...]
>> This looks OK to me: it says we display 4 characters in one face and 1
>> more in another.  Which agrees with pgrow and with what I understand
>> should happen here: the 4 characters T O D O are displayed using the
>> font of the variable-pitch face, and the blank space after it is
>> displayed using the default face.
>>
>> What do you see on the screen in this case?  Please describe the
>> visual appearance of each character in the case of fundamental-mode,
>> and perhaps also show a screenshot of the window as it is displayed
>> when the mouse-highlight becomes visible during this scenario.
>
> Here's a screenshot of lisp-interaction-mode when the mouse-highlight
> appears:
>
> x
>
>
> And here's one of fundamental-mode:
>
> x
>
>
> Aside from the difference in highlighting, another difference I failed
> to notice before is that in fundamental-mode the string "TODO" is
> displayed with DejaVu Sans but in lisp-interaction-mode with DejaVu Sans
> Mono, although I used the same Lisp code with the face property
> (:inherit variable-pitch) to enter the string in both buffers.  I guess
> lisp-interaction-mode inhibits variable-pitch face and that's the reason
> the mouse-highlighting appears on the problematic characters in that
> mode, in contrast to fundamental-mode.
>
> Steve Berman

What if you change the font driver in use to something else, like X?
i.e.

  (set-frame-parameter (selected-frame) 'font-backend "x")





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-09 12:52                                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-05-09 13:12                                   ` Stephen Berman
  2023-05-09 13:35                                     ` Eli Zaretskii
  0 siblings, 1 reply; 54+ messages in thread
From: Stephen Berman @ 2023-05-09 13:12 UTC (permalink / raw)
  To: Po Lu; +Cc: Eli Zaretskii, 63271, juri

On Tue, 09 May 2023 20:52:24 +0800 Po Lu <luangruo@yahoo.com> wrote:

> Stephen Berman <stephen.berman@gmx.net> writes:
[...]
>> Aside from the difference in highlighting, another difference I failed
>> to notice before is that in fundamental-mode the string "TODO" is
>> displayed with DejaVu Sans but in lisp-interaction-mode with DejaVu Sans
>> Mono, although I used the same Lisp code with the face property
>> (:inherit variable-pitch) to enter the string in both buffers.  I guess
>> lisp-interaction-mode inhibits variable-pitch face and that's the reason
>> the mouse-highlighting appears on the problematic characters in that
>> mode, in contrast to fundamental-mode.
>>
>> Steve Berman
>
> What if you change the font driver in use to something else, like X?
> i.e.
>
>   (set-frame-parameter (selected-frame) 'font-backend "x")

With that the highlighting problem in fundamental-mode vanishes: all
problematic strings show mouse-highlighting. (FTR, with the "x"
font-backend, the default face here is displayed with adobe-courier and
variable-pitch face is displayed with adobe-helvetica.)

Steve Berman





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-09 12:43                               ` Stephen Berman
  2023-05-09 12:52                                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-05-09 13:32                                 ` Eli Zaretskii
  2023-05-09 14:34                                   ` Stephen Berman
  2023-05-10  0:47                                   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 2 replies; 54+ messages in thread
From: Eli Zaretskii @ 2023-05-09 13:32 UTC (permalink / raw)
  To: Stephen Berman; +Cc: luangruo, 63271, juri

> From: Stephen Berman <stephen.berman@gmx.net>
> Cc: juri@linkov.net,  luangruo@yahoo.com,  63271@debbugs.gnu.org
> Date: Tue, 09 May 2023 14:43:02 +0200
> 
> > What do you see on the screen in this case?  Please describe the
> > visual appearance of each character in the case of fundamental-mode,
> > and perhaps also show a screenshot of the window as it is displayed
> > when the mouse-highlight becomes visible during this scenario.
> 
> Here's a screenshot of lisp-interaction-mode when the mouse-highlight
> appears:

Thanks.  This is strange.  Can you try one more thing, please?  With
the same breakpoint in xterm.c, when the breakpoint breaks, please
type

  (gdb) print/x s->face->background

Please do this every time the breakpoint breaks, and let's see if
Emacs thinks both the "TODO" text and the blank after it should be
displayed with the same background color (which should be the
background of the 'highlight' face).  That's what I see on my system.

If the colors of the two glyph_string's indeed match, I'm led to
believe that the problem is elsewhere, in the low levels of drawing
the stuff on screen.  Perhaps some library (Cairo?) has a bug or
something.  Because the data structures prepared by the Emacs display
engine are correct, and explicitly specify the mouse-highlight
background to be drawn.  So somehow using this particular font erases
the background, or something to that effect.  This is also consistent
with the fact that other font backends don't show the problem.

Po Lu, any ideas how to look into this further?

> Aside from the difference in highlighting, another difference I failed
> to notice before is that in fundamental-mode the string "TODO" is
> displayed with DejaVu Sans but in lisp-interaction-mode with DejaVu Sans
> Mono, although I used the same Lisp code with the face property
> (:inherit variable-pitch) to enter the string in both buffers.  I guess
> lisp-interaction-mode inhibits variable-pitch face and that's the reason
> the mouse-highlighting appears on the problematic characters in that
> mode, in contrast to fundamental-mode.

This is actually easy to understand, and is expected:
lisp-interaction-mode has font-lock-mode turned on, and thus the
recipe you evaluate doesn't change the face (thus the font), only adds
mouse-highlight.





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-09 13:12                                   ` Stephen Berman
@ 2023-05-09 13:35                                     ` Eli Zaretskii
  2023-05-09 14:34                                       ` Stephen Berman
  0 siblings, 1 reply; 54+ messages in thread
From: Eli Zaretskii @ 2023-05-09 13:35 UTC (permalink / raw)
  To: Stephen Berman; +Cc: luangruo, 63271, juri

> From: Stephen Berman <stephen.berman@gmx.net>
> Cc: Eli Zaretskii <eliz@gnu.org>,  juri@linkov.net,  63271@debbugs.gnu.org
> Date: Tue, 09 May 2023 15:12:06 +0200
> 
> On Tue, 09 May 2023 20:52:24 +0800 Po Lu <luangruo@yahoo.com> wrote:
> 
> > What if you change the font driver in use to something else, like X?
> > i.e.
> >
> >   (set-frame-parameter (selected-frame) 'font-backend "x")
> 
> With that the highlighting problem in fundamental-mode vanishes: all
> problematic strings show mouse-highlighting. (FTR, with the "x"
> font-backend, the default face here is displayed with adobe-courier and
> variable-pitch face is displayed with adobe-helvetica.)

Does changing the font backend also changes the font used for the
variable-pitch face?  If it does, then perhaps you could force Emacs
to use the same font by customizing the variable-pitch face?  Since we
already know that the font somehow affects this issue, we need to try
to use the same font with different backends, to be sure it's the
backend that counts, not the font.





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-09 13:32                                 ` Eli Zaretskii
@ 2023-05-09 14:34                                   ` Stephen Berman
  2023-05-10  0:47                                   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 0 replies; 54+ messages in thread
From: Stephen Berman @ 2023-05-09 14:34 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: luangruo, 63271, juri

On Tue, 09 May 2023 16:32:07 +0300 Eli Zaretskii <eliz@gnu.org> wrote:

>> From: Stephen Berman <stephen.berman@gmx.net>
>> Cc: juri@linkov.net,  luangruo@yahoo.com,  63271@debbugs.gnu.org
>> Date: Tue, 09 May 2023 14:43:02 +0200
>>
>> > What do you see on the screen in this case?  Please describe the
>> > visual appearance of each character in the case of fundamental-mode,
>> > and perhaps also show a screenshot of the window as it is displayed
>> > when the mouse-highlight becomes visible during this scenario.
>>
>> Here's a screenshot of lisp-interaction-mode when the mouse-highlight
>> appears:
>
> Thanks.  This is strange.  Can you try one more thing, please?  With
> the same breakpoint in xterm.c, when the breakpoint breaks, please
> type
>
>   (gdb) print/x s->face->background
>
> Please do this every time the breakpoint breaks, and let's see if
> Emacs thinks both the "TODO" text and the blank after it should be
> displayed with the same background color (which should be the
> background of the 'highlight' face).  That's what I see on my system.

In both fundamental-mode and lisp-interaction-mode the above command
returned the same value at every break: 0xffb4eeb4 (i.e, $1 =
0xffb4eeb4, $2 = 0xffb4eeb4, etc.).

> If the colors of the two glyph_string's indeed match, I'm led to
> believe that the problem is elsewhere, in the low levels of drawing
> the stuff on screen.  Perhaps some library (Cairo?) has a bug or
> something.  Because the data structures prepared by the Emacs display
> engine are correct, and explicitly specify the mouse-highlight
> background to be drawn.  So somehow using this particular font erases
> the background, or something to that effect.  This is also consistent
> with the fact that other font backends don't show the problem.

Yes, it looks like a font plus backend problem.

> Po Lu, any ideas how to look into this further?
>
>> Aside from the difference in highlighting, another difference I failed
>> to notice before is that in fundamental-mode the string "TODO" is
>> displayed with DejaVu Sans but in lisp-interaction-mode with DejaVu Sans
>> Mono, although I used the same Lisp code with the face property
>> (:inherit variable-pitch) to enter the string in both buffers.  I guess
>> lisp-interaction-mode inhibits variable-pitch face and that's the reason
>> the mouse-highlighting appears on the problematic characters in that
>> mode, in contrast to fundamental-mode.
>
> This is actually easy to understand, and is expected:
> lisp-interaction-mode has font-lock-mode turned on, and thus the
> recipe you evaluate doesn't change the face (thus the font), only adds
> mouse-highlight.

Ok, thanks.

BTW, in the screen shot of fundamental-mode I neglected to note that
"TODO" appears to be in bold-face when the mouse pointer moves over it,
and outside of gdb, when I move the mouse pointer over "TODO" and then
away, I can clearly see the thickness of the characters change (but I
cannot verify this with `C-u C-x =', which says "ftcrhb:-PfEd-DejaVu
Sans-regular-normal-normal-*-19-*-*-*-*-0-iso10646-1 (#x37)" both when
the mouse pointer is over the string and when it isn't).

BTW2: In checking the above, I unintentionaly but fortuitously created
the the same image the Juri posted, where "TODO" has a black background,
"ODO" is not visible, and "T" has same foreground color as
mouse-highlight.  I did this by keeping the mouse pointer over "T" and
moving the cursor (i.e. point) leftwards from the end of the string: as
point moves over each character, its foreground appears in
mouse-highlight and on moving point to the next character to the left,
the black cursor block remains on the character it just moved off of,
leaving the character invisible.

Steve Berman





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-09 13:35                                     ` Eli Zaretskii
@ 2023-05-09 14:34                                       ` Stephen Berman
  2023-05-10  0:34                                         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 54+ messages in thread
From: Stephen Berman @ 2023-05-09 14:34 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: luangruo, 63271, juri

On Tue, 09 May 2023 16:35:50 +0300 Eli Zaretskii <eliz@gnu.org> wrote:

>> From: Stephen Berman <stephen.berman@gmx.net>
>> Cc: Eli Zaretskii <eliz@gnu.org>,  juri@linkov.net,  63271@debbugs.gnu.org
>> Date: Tue, 09 May 2023 15:12:06 +0200
>>
>> On Tue, 09 May 2023 20:52:24 +0800 Po Lu <luangruo@yahoo.com> wrote:
>>
>> > What if you change the font driver in use to something else, like X?
>> > i.e.
>> >
>> >   (set-frame-parameter (selected-frame) 'font-backend "x")
>>
>> With that the highlighting problem in fundamental-mode vanishes: all
>> problematic strings show mouse-highlighting. (FTR, with the "x"
>> font-backend, the default face here is displayed with adobe-courier and
>> variable-pitch face is displayed with adobe-helvetica.)
>
> Does changing the font backend also changes the font used for the
> variable-pitch face?  If it does, then perhaps you could force Emacs
> to use the same font by customizing the variable-pitch face?  Since we
> already know that the font somehow affects this issue, we need to try
> to use the same font with different backends, to be sure it's the
> backend that counts, not the font.

As I noted previously, here with ftcrhb variable-pitch face is displayed
with DejaVu Sans.  When I change the font-backend to "x", variable-pitch
face is displayed with adobe-helvetica, as noted, but when I change its
Font Family attribute to DejaVu Sans, the "TODO" string in
fundamental-mode, propertized to inherit variable-pitch, is displayed
with adobe-times.  So it seems that DejaVu Sans cannot be used by the x
font-backend.

Steve Berman





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-09  6:47                           ` Juri Linkov
@ 2023-05-09 19:06                             ` Juri Linkov
  2023-05-09 19:21                               ` Eli Zaretskii
  0 siblings, 1 reply; 54+ messages in thread
From: Juri Linkov @ 2023-05-09 19:06 UTC (permalink / raw)
  To: Stephen Berman; +Cc: luangruo, Eli Zaretskii, 63271

>> I checked out those commits and rebuilt emacs and can confirm that the
>> build from 61b9f2c3179 has the problem and the build from 0636e1066bb
>> does not.
>
> Actually, 0636e1066bb was one of the latest commits on emacs-28.
> So we need to continue bisecting on emacs-29 down from the commit
> be42fdc6dc6..: 2022-04-13 where the test case still fails.
> This is one of the last commits before huge merges,
> so the history below from it is quite flat and shallow,
> and thus easier to bisect.

I finished bisection, and not sure if this helps,
but that commit was 85a078e7853.





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-09 19:06                             ` Juri Linkov
@ 2023-05-09 19:21                               ` Eli Zaretskii
  2023-05-09 23:19                                 ` Gregory Heytings
  2023-05-10  0:46                                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 2 replies; 54+ messages in thread
From: Eli Zaretskii @ 2023-05-09 19:21 UTC (permalink / raw)
  To: Juri Linkov; +Cc: luangruo, 63271, stephen.berman

> From: Juri Linkov <juri@linkov.net>
> Cc: luangruo@yahoo.com,  Eli Zaretskii <eliz@gnu.org>,  63271@debbugs.gnu.org
> Date: Tue, 09 May 2023 22:06:52 +0300
> 
> I finished bisection, and not sure if this helps,
> but that commit was 85a078e7853.

Thanks, but I don't see how this could be true: those changes are all
conditioned by HAIKU-related conditionals, and I don't suppose you run
a Haiku build of Emacs, right?





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-09 19:21                               ` Eli Zaretskii
@ 2023-05-09 23:19                                 ` Gregory Heytings
  2023-05-10  9:38                                   ` Stephen Berman
  2023-05-10 11:00                                   ` Eli Zaretskii
  2023-05-10  0:46                                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 2 replies; 54+ messages in thread
From: Gregory Heytings @ 2023-05-09 23:19 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: luangruo, 63271, stephen.berman, Juri Linkov


>> I finished bisection, and not sure if this helps, but that commit was 
>> 85a078e7853.
>
> Thanks, but I don't see how this could be true: those changes are all 
> conditioned by HAIKU-related conditionals, and I don't suppose you run a 
> Haiku build of Emacs, right?
>

Git bisect is always right.  I confirm that this bug is due to 85a078e785, 
which added, in ftcrfont_draw, a

s->background_filled_p = 1;

statement inside a #ifndef USE_BE_CAIRO (note the "n").  A few days later 
a1aa9cbf57 moved that statement ouside of the conditional.  Removing that 
statement fixes the bug.  I'm not sure what that statement is supposed to 
do however, it might be necessary, but only for Haiku.






^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-09 14:34                                       ` Stephen Berman
@ 2023-05-10  0:34                                         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-05-10  9:39                                           ` Stephen Berman
  0 siblings, 1 reply; 54+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-05-10  0:34 UTC (permalink / raw)
  To: Stephen Berman; +Cc: Eli Zaretskii, 63271, juri

Stephen Berman <stephen.berman@gmx.net> writes:

> On Tue, 09 May 2023 16:35:50 +0300 Eli Zaretskii <eliz@gnu.org> wrote:
>
>>> From: Stephen Berman <stephen.berman@gmx.net>
>>> Cc: Eli Zaretskii <eliz@gnu.org>,  juri@linkov.net,  63271@debbugs.gnu.org
>>> Date: Tue, 09 May 2023 15:12:06 +0200
>>>
>>> On Tue, 09 May 2023 20:52:24 +0800 Po Lu <luangruo@yahoo.com> wrote:
>>>
>>> > What if you change the font driver in use to something else, like X?
>>> > i.e.
>>> >
>>> >   (set-frame-parameter (selected-frame) 'font-backend "x")
>>>
>>> With that the highlighting problem in fundamental-mode vanishes: all
>>> problematic strings show mouse-highlighting. (FTR, with the "x"
>>> font-backend, the default face here is displayed with adobe-courier and
>>> variable-pitch face is displayed with adobe-helvetica.)
>>
>> Does changing the font backend also changes the font used for the
>> variable-pitch face?  If it does, then perhaps you could force Emacs
>> to use the same font by customizing the variable-pitch face?  Since we
>> already know that the font somehow affects this issue, we need to try
>> to use the same font with different backends, to be sure it's the
>> backend that counts, not the font.
>
> As I noted previously, here with ftcrhb variable-pitch face is displayed
> with DejaVu Sans.  When I change the font-backend to "x", variable-pitch
> face is displayed with adobe-helvetica, as noted, but when I change its
> Font Family attribute to DejaVu Sans, the "TODO" string in
> fundamental-mode, propertized to inherit variable-pitch, is displayed
> with adobe-times.  So it seems that DejaVu Sans cannot be used by the x
> font-backend.
>
> Steve Berman

X doesn't support the same fonts that Cairo does.  But does the same
thing happen if you use a build with Xft (i.e. --without-cairo), with
the same font?





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-09 19:21                               ` Eli Zaretskii
  2023-05-09 23:19                                 ` Gregory Heytings
@ 2023-05-10  0:46                                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 0 replies; 54+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-05-10  0:46 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 63271, stephen.berman, Juri Linkov

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Juri Linkov <juri@linkov.net>
>> Cc: luangruo@yahoo.com,  Eli Zaretskii <eliz@gnu.org>,  63271@debbugs.gnu.org
>> Date: Tue, 09 May 2023 22:06:52 +0300
>> 
>> I finished bisection, and not sure if this helps,
>> but that commit was 85a078e7853.
>
> Thanks, but I don't see how this could be true: those changes are all
> conditioned by HAIKU-related conditionals, and I don't suppose you run
> a Haiku build of Emacs, right?

Does s->for_overlaps happen to be set in the glyph string drawn when the
phys cursor is erased?





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-09 13:32                                 ` Eli Zaretskii
  2023-05-09 14:34                                   ` Stephen Berman
@ 2023-05-10  0:47                                   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 0 replies; 54+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-05-10  0:47 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 63271, Stephen Berman, juri

Eli Zaretskii <eliz@gnu.org> writes:

> Thanks.  This is strange.  Can you try one more thing, please?  With
> the same breakpoint in xterm.c, when the breakpoint breaks, please
> type
>
>   (gdb) print/x s->face->background
>
> Please do this every time the breakpoint breaks, and let's see if
> Emacs thinks both the "TODO" text and the blank after it should be
> displayed with the same background color (which should be the
> background of the 'highlight' face).  That's what I see on my system.
>
> If the colors of the two glyph_string's indeed match, I'm led to
> believe that the problem is elsewhere, in the low levels of drawing
> the stuff on screen.  Perhaps some library (Cairo?) has a bug or
> something.  Because the data structures prepared by the Emacs display
> engine are correct, and explicitly specify the mouse-highlight
> background to be drawn.  So somehow using this particular font erases
> the background, or something to that effect.  This is also consistent
> with the fact that other font backends don't show the problem.
>
> Po Lu, any ideas how to look into this further?

Yes, please, show

  (gdb) p s->for_overlaps





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-09 23:19                                 ` Gregory Heytings
@ 2023-05-10  9:38                                   ` Stephen Berman
  2023-05-10 10:53                                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-05-10 11:00                                   ` Eli Zaretskii
  1 sibling, 1 reply; 54+ messages in thread
From: Stephen Berman @ 2023-05-10  9:38 UTC (permalink / raw)
  To: Gregory Heytings; +Cc: luangruo, Eli Zaretskii, 63271, Juri Linkov

On Tue, 09 May 2023 23:19:35 +0000 Gregory Heytings <gregory@heytings.org> wrote:

>>> I finished bisection, and not sure if this helps, but that commit was
>>> 85a078e7853.
>>
>> Thanks, but I don't see how this could be true: those changes are all
>> conditioned by HAIKU-related conditionals, and I don't suppose you run a
>> Haiku build of Emacs, right?
>>
>
> Git bisect is always right.  I confirm that this bug is due to 85a078e785,
> which added, in ftcrfont_draw, a
>
> s->background_filled_p = 1;
>
> statement inside a #ifndef USE_BE_CAIRO (note the "n").  A few days later
> a1aa9cbf57 moved that statement ouside of the conditional.  Removing that
> statement fixes the bug.  I'm not sure what that statement is supposed to do
> however, it might be necessary, but only for Haiku.

I confirm that after rebuilding emacs-29 with that line commented out,
the mouse-face highlighting problems no longer occur (here under Gtk3
with Cairo).

Steve Berman





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-10  0:34                                         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-05-10  9:39                                           ` Stephen Berman
  0 siblings, 0 replies; 54+ messages in thread
From: Stephen Berman @ 2023-05-10  9:39 UTC (permalink / raw)
  To: Po Lu; +Cc: Eli Zaretskii, 63271, juri

On Wed, 10 May 2023 08:34:56 +0800 Po Lu <luangruo@yahoo.com> wrote:

> Stephen Berman <stephen.berman@gmx.net> writes:
>
>> On Tue, 09 May 2023 16:35:50 +0300 Eli Zaretskii <eliz@gnu.org> wrote:
>>
>>>> From: Stephen Berman <stephen.berman@gmx.net>
>>>> Cc: Eli Zaretskii <eliz@gnu.org>,  juri@linkov.net,  63271@debbugs.gnu.org
>>>> Date: Tue, 09 May 2023 15:12:06 +0200
>>>>
>>>> On Tue, 09 May 2023 20:52:24 +0800 Po Lu <luangruo@yahoo.com> wrote:
>>>>
>>>> > What if you change the font driver in use to something else, like X?
>>>> > i.e.
>>>> >
>>>> >   (set-frame-parameter (selected-frame) 'font-backend "x")
>>>>
>>>> With that the highlighting problem in fundamental-mode vanishes: all
>>>> problematic strings show mouse-highlighting. (FTR, with the "x"
>>>> font-backend, the default face here is displayed with adobe-courier and
>>>> variable-pitch face is displayed with adobe-helvetica.)
>>>
>>> Does changing the font backend also changes the font used for the
>>> variable-pitch face?  If it does, then perhaps you could force Emacs
>>> to use the same font by customizing the variable-pitch face?  Since we
>>> already know that the font somehow affects this issue, we need to try
>>> to use the same font with different backends, to be sure it's the
>>> backend that counts, not the font.
>>
>> As I noted previously, here with ftcrhb variable-pitch face is displayed
>> with DejaVu Sans.  When I change the font-backend to "x", variable-pitch
>> face is displayed with adobe-helvetica, as noted, but when I change its
>> Font Family attribute to DejaVu Sans, the "TODO" string in
>> fundamental-mode, propertized to inherit variable-pitch, is displayed
>> with adobe-times.  So it seems that DejaVu Sans cannot be used by the x
>> font-backend.
>>
>> Steve Berman
>
> X doesn't support the same fonts that Cairo does.  But does the same
> thing happen if you use a build with Xft (i.e. --without-cairo), with
> the same font?

After rebuilding --without-cairo (and retaining the change in
a1aa9cbf57, which Gregory Heytings found to be the cause of the problem,
at least in builds with Cairo), the problem no longer occurs,
i.e. mouse-highlighting works with "TODO" and the other test cases, with
DejaVu Sans as the font displaying variable-pitch face.

Steve Berman





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-10  9:38                                   ` Stephen Berman
@ 2023-05-10 10:53                                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-05-10 11:01                                       ` Stephen Berman
  2023-05-10 12:05                                       ` Eli Zaretskii
  0 siblings, 2 replies; 54+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-05-10 10:53 UTC (permalink / raw)
  To: Stephen Berman; +Cc: Gregory Heytings, 63271, Eli Zaretskii, Juri Linkov

Stephen Berman <stephen.berman@gmx.net> writes:

> On Tue, 09 May 2023 23:19:35 +0000 Gregory Heytings <gregory@heytings.org> wrote:
>
>>>> I finished bisection, and not sure if this helps, but that commit was
>>>> 85a078e7853.
>>>
>>> Thanks, but I don't see how this could be true: those changes are all
>>> conditioned by HAIKU-related conditionals, and I don't suppose you run a
>>> Haiku build of Emacs, right?
>>>
>>
>> Git bisect is always right.  I confirm that this bug is due to 85a078e785,
>> which added, in ftcrfont_draw, a
>>
>> s->background_filled_p = 1;
>>
>> statement inside a #ifndef USE_BE_CAIRO (note the "n").  A few days later
>> a1aa9cbf57 moved that statement ouside of the conditional.  Removing that
>> statement fixes the bug.  I'm not sure what that statement is supposed to do
>> however, it might be necessary, but only for Haiku.
>
> I confirm that after rebuilding emacs-29 with that line commented out,
> the mouse-face highlighting problems no longer occur (here under Gtk3
> with Cairo).
>
> Steve Berman

Would you please answer my other question?  Namely, what is:

  (gdb) p s->for_overlaps





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-09 23:19                                 ` Gregory Heytings
  2023-05-10  9:38                                   ` Stephen Berman
@ 2023-05-10 11:00                                   ` Eli Zaretskii
  2023-05-11  0:51                                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 1 reply; 54+ messages in thread
From: Eli Zaretskii @ 2023-05-10 11:00 UTC (permalink / raw)
  To: Gregory Heytings; +Cc: luangruo, 63271, stephen.berman, juri

> Date: Tue, 09 May 2023 23:19:35 +0000
> From: Gregory Heytings <gregory@heytings.org>
> cc: Juri Linkov <juri@linkov.net>, luangruo@yahoo.com, 63271@debbugs.gnu.org, 
>     stephen.berman@gmx.net
> 
> I confirm that this bug is due to 85a078e785, which added, in
> ftcrfont_draw, a
> 
> s->background_filled_p = 1;
> 
> statement inside a #ifndef USE_BE_CAIRO (note the "n").  A few days later 
> a1aa9cbf57 moved that statement ouside of the conditional.  Removing that 
> statement fixes the bug.  I'm not sure what that statement is supposed to 
> do however, it might be necessary, but only for Haiku.

Thanks.

Po Lu, was that change intentional?  If not, let's remove that line or
move it under some conditional that doesn't include all Cairo builds.
If it was intentional, please explain why, and let's take it from
there.





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-10 10:53                                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-05-10 11:01                                       ` Stephen Berman
  2023-05-10 12:05                                       ` Eli Zaretskii
  1 sibling, 0 replies; 54+ messages in thread
From: Stephen Berman @ 2023-05-10 11:01 UTC (permalink / raw)
  To: Po Lu; +Cc: Gregory Heytings, 63271, Eli Zaretskii, Juri Linkov

On Wed, 10 May 2023 18:53:34 +0800 Po Lu <luangruo@yahoo.com> wrote:

> Stephen Berman <stephen.berman@gmx.net> writes:
>
>> On Tue, 09 May 2023 23:19:35 +0000 Gregory Heytings <gregory@heytings.org> wrote:
>>
>>>>> I finished bisection, and not sure if this helps, but that commit was
>>>>> 85a078e7853.
>>>>
>>>> Thanks, but I don't see how this could be true: those changes are all
>>>> conditioned by HAIKU-related conditionals, and I don't suppose you run a
>>>> Haiku build of Emacs, right?
>>>>
>>>
>>> Git bisect is always right.  I confirm that this bug is due to 85a078e785,
>>> which added, in ftcrfont_draw, a
>>>
>>> s->background_filled_p = 1;
>>>
>>> statement inside a #ifndef USE_BE_CAIRO (note the "n").  A few days later
>>> a1aa9cbf57 moved that statement ouside of the conditional.  Removing that
>>> statement fixes the bug.  I'm not sure what that statement is supposed to do
>>> however, it might be necessary, but only for Haiku.
>>
>> I confirm that after rebuilding emacs-29 with that line commented out,
>> the mouse-face highlighting problems no longer occur (here under Gtk3
>> with Cairo).
>>
>> Steve Berman
>
> Would you please answer my other question?  Namely, what is:
>
>   (gdb) p s->for_overlaps

I tried that using Eli's second experiment recipe (with breakpoint
xterm.c:8119) and after hitting the breakpoint and entering that
command, it returned this: $1 = 0

Steve Berman





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-10 10:53                                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-05-10 11:01                                       ` Stephen Berman
@ 2023-05-10 12:05                                       ` Eli Zaretskii
  1 sibling, 0 replies; 54+ messages in thread
From: Eli Zaretskii @ 2023-05-10 12:05 UTC (permalink / raw)
  To: Po Lu; +Cc: gregory, stephen.berman, 63271, juri

> From: Po Lu <luangruo@yahoo.com>
> Cc: Gregory Heytings <gregory@heytings.org>,  Eli Zaretskii <eliz@gnu.org>,
>   Juri Linkov <juri@linkov.net>,  63271@debbugs.gnu.org
> Date: Wed, 10 May 2023 18:53:34 +0800
> 
> Would you please answer my other question?  Namely, what is:
> 
>   (gdb) p s->for_overlaps

It was already reported as part of the investigation, with the full
contents of the glyph_strings: it's zero.  See

  https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63271#77






^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-10 11:00                                   ` Eli Zaretskii
@ 2023-05-11  0:51                                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-05-11  6:00                                       ` Eli Zaretskii
  0 siblings, 1 reply; 54+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-05-11  0:51 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Gregory Heytings, stephen.berman, 63271, juri

Eli Zaretskii <eliz@gnu.org> writes:

> Po Lu, was that change intentional?  If not, let's remove that line or
> move it under some conditional that doesn't include all Cairo builds.
> If it was intentional, please explain why, and let's take it from
> there.

It was needed to prevent drawing overhangs as part of the cursor from
overwriting surrounding characters with the glyph string background.

Unfortunately, I don't remember why it was needed, though I think the
underlying reason has been fixed.





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-11  0:51                                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-05-11  6:00                                       ` Eli Zaretskii
  2023-05-11  6:23                                         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-05-12  3:19                                         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 2 replies; 54+ messages in thread
From: Eli Zaretskii @ 2023-05-11  6:00 UTC (permalink / raw)
  To: Po Lu; +Cc: gregory, stephen.berman, 63271, juri

> From: Po Lu <luangruo@yahoo.com>
> Cc: Gregory Heytings <gregory@heytings.org>,  juri@linkov.net,
>   63271@debbugs.gnu.org,  stephen.berman@gmx.net
> Date: Thu, 11 May 2023 08:51:05 +0800
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Po Lu, was that change intentional?  If not, let's remove that line or
> > move it under some conditional that doesn't include all Cairo builds.
> > If it was intentional, please explain why, and let's take it from
> > there.
> 
> It was needed to prevent drawing overhangs as part of the cursor from
> overwriting surrounding characters with the glyph string background.
> 
> Unfortunately, I don't remember why it was needed, though I think the
> underlying reason has been fixed.

So can we undo that now?  If there is still a reason for doing
something special there, it will pop up sooner or later, and we can
deal with it at that time.  At the very least, the setting of
s->background_filled_p should not be done when s->hl is one of the
last 3 values in enum draw_glyphs_face, I think, and maybe also when
s->for_overlaps is zero.

I'd like to fix this soon, because I want to make another pretest of
29.1.

Thanks.





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-11  6:00                                       ` Eli Zaretskii
@ 2023-05-11  6:23                                         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-05-12  3:19                                         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 0 replies; 54+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-05-11  6:23 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gregory, stephen.berman, 63271, juri

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Po Lu <luangruo@yahoo.com>
>> Cc: Gregory Heytings <gregory@heytings.org>,  juri@linkov.net,
>>   63271@debbugs.gnu.org,  stephen.berman@gmx.net
>> Date: Thu, 11 May 2023 08:51:05 +0800
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> > Po Lu, was that change intentional?  If not, let's remove that line or
>> > move it under some conditional that doesn't include all Cairo builds.
>> > If it was intentional, please explain why, and let's take it from
>> > there.
>> 
>> It was needed to prevent drawing overhangs as part of the cursor from
>> overwriting surrounding characters with the glyph string background.
>> 
>> Unfortunately, I don't remember why it was needed, though I think the
>> underlying reason has been fixed.
>
> So can we undo that now?  If there is still a reason for doing
> something special there, it will pop up sooner or later, and we can
> deal with it at that time.  At the very least, the setting of
> s->background_filled_p should not be done when s->hl is one of the
> last 3 values in enum draw_glyphs_face, I think, and maybe also when
> s->for_overlaps is zero.
>
> I'd like to fix this soon, because I want to make another pretest of
> 29.1.

Yes, but please wait a day or two for me to get to a machine where I can
test this.  Thanks.





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-11  6:00                                       ` Eli Zaretskii
  2023-05-11  6:23                                         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-05-12  3:19                                         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-05-12 10:43                                           ` Eli Zaretskii
  1 sibling, 1 reply; 54+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-05-12  3:19 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gregory, stephen.berman, 63271, juri

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Po Lu <luangruo@yahoo.com>
>> Cc: Gregory Heytings <gregory@heytings.org>,  juri@linkov.net,
>>   63271@debbugs.gnu.org,  stephen.berman@gmx.net
>> Date: Thu, 11 May 2023 08:51:05 +0800
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> > Po Lu, was that change intentional?  If not, let's remove that line or
>> > move it under some conditional that doesn't include all Cairo builds.
>> > If it was intentional, please explain why, and let's take it from
>> > there.
>> 
>> It was needed to prevent drawing overhangs as part of the cursor from
>> overwriting surrounding characters with the glyph string background.
>> 
>> Unfortunately, I don't remember why it was needed, though I think the
>> underlying reason has been fixed.
>
> So can we undo that now?  If there is still a reason for doing
> something special there, it will pop up sooner or later, and we can
> deal with it at that time.  At the very least, the setting of
> s->background_filled_p should not be done when s->hl is one of the
> last 3 values in enum draw_glyphs_face, I think, and maybe also when
> s->for_overlaps is zero.
>
> I'd like to fix this soon, because I want to make another pretest of
> 29.1.
>
> Thanks.

Please go ahead and remove it from ftcrfont.c.  The reason it was added
has already been fixed.





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-12  3:19                                         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-05-12 10:43                                           ` Eli Zaretskii
  2023-05-12 12:49                                             ` Gregory Heytings
  0 siblings, 1 reply; 54+ messages in thread
From: Eli Zaretskii @ 2023-05-12 10:43 UTC (permalink / raw)
  To: Po Lu; +Cc: gregory, stephen.berman, 63271, juri

> From: Po Lu <luangruo@yahoo.com>
> Cc: gregory@heytings.org,  juri@linkov.net,  63271@debbugs.gnu.org,
>   stephen.berman@gmx.net
> Date: Fri, 12 May 2023 11:19:01 +0800
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > I'd like to fix this soon, because I want to make another pretest of
> > 29.1.
> >
> > Thanks.
> 
> Please go ahead and remove it from ftcrfont.c.  The reason it was added
> has already been fixed.

Since I cannot verify the fix on my system, please confirm that the
change you asked me to install is the one below.

diff --git a/src/ftcrfont.c b/src/ftcrfont.c
index c9a4de8..4956469 100644
--- a/src/ftcrfont.c
+++ b/src/ftcrfont.c
@@ -590,7 +590,6 @@ ftcrfont_draw (struct glyph_string *s,
 			    GREEN_FROM_ULONG (col) / 255.0,
 			    BLUE_FROM_ULONG (col) / 255.0);
 #endif
-      s->background_filled_p = 1;
       cairo_rectangle (cr, x, y - FONT_BASE (s->font),
 		       s->width, FONT_HEIGHT (s->font));
       cairo_fill (cr);





^ permalink raw reply related	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-12 10:43                                           ` Eli Zaretskii
@ 2023-05-12 12:49                                             ` Gregory Heytings
  2023-05-12 17:20                                               ` Juri Linkov
  0 siblings, 1 reply; 54+ messages in thread
From: Gregory Heytings @ 2023-05-12 12:49 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Po Lu, 63271, stephen.berman, juri


>
> Since I cannot verify the fix on my system, please confirm that the 
> change you asked me to install is the one below.
>

Yes, that change is correct.  Juri could perhaps also confirm that this 
fixes the bug for him.






^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-12 12:49                                             ` Gregory Heytings
@ 2023-05-12 17:20                                               ` Juri Linkov
  2023-05-12 19:21                                                 ` Eli Zaretskii
  0 siblings, 1 reply; 54+ messages in thread
From: Juri Linkov @ 2023-05-12 17:20 UTC (permalink / raw)
  To: Gregory Heytings; +Cc: Po Lu, Eli Zaretskii, stephen.berman, 63271

>> Since I cannot verify the fix on my system, please confirm that the
>> change you asked me to install is the one below.
>>
>
> Yes, that change is correct.  Juri could perhaps also confirm that this
> fixes the bug for him.

I confirm that this patch completely fixes the reported problem.





^ permalink raw reply	[flat|nested] 54+ messages in thread

* bug#63271: 29.0.90; broken mouse-face
  2023-05-12 17:20                                               ` Juri Linkov
@ 2023-05-12 19:21                                                 ` Eli Zaretskii
  0 siblings, 0 replies; 54+ messages in thread
From: Eli Zaretskii @ 2023-05-12 19:21 UTC (permalink / raw)
  To: Juri Linkov; +Cc: luangruo, gregory, stephen.berman, 63271-done

> From: Juri Linkov <juri@linkov.net>
> Cc: Eli Zaretskii <eliz@gnu.org>,  Po Lu <luangruo@yahoo.com>,
>   stephen.berman@gmx.net,  63271@debbugs.gnu.org
> Date: Fri, 12 May 2023 20:20:47 +0300
> 
> >> Since I cannot verify the fix on my system, please confirm that the
> >> change you asked me to install is the one below.
> >>
> >
> > Yes, that change is correct.  Juri could perhaps also confirm that this
> > fixes the bug for him.
> 
> I confirm that this patch completely fixes the reported problem.

Thanks, installed.





^ permalink raw reply	[flat|nested] 54+ messages in thread

end of thread, other threads:[~2023-05-12 19:21 UTC | newest]

Thread overview: 54+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-04 15:11 bug#63271: 29.0.90; broken mouse-face Juri Linkov
2023-05-04 16:01 ` Eli Zaretskii
2023-05-05 17:38   ` Juri Linkov
2023-05-05 18:31     ` Eli Zaretskii
2023-05-06 11:19       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-07 18:00         ` Juri Linkov
2023-05-07 18:35           ` Eli Zaretskii
2023-05-08 15:56             ` Juri Linkov
2023-05-08 16:14               ` Eli Zaretskii
2023-05-08 18:20                 ` Stephen Berman
2023-05-08 18:27                   ` Eli Zaretskii
2023-05-08 18:47                     ` Stephen Berman
2023-05-08 19:09                       ` Juri Linkov
2023-05-08 20:46                         ` Stephen Berman
2023-05-09  6:47                           ` Juri Linkov
2023-05-09 19:06                             ` Juri Linkov
2023-05-09 19:21                               ` Eli Zaretskii
2023-05-09 23:19                                 ` Gregory Heytings
2023-05-10  9:38                                   ` Stephen Berman
2023-05-10 10:53                                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-10 11:01                                       ` Stephen Berman
2023-05-10 12:05                                       ` Eli Zaretskii
2023-05-10 11:00                                   ` Eli Zaretskii
2023-05-11  0:51                                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-11  6:00                                       ` Eli Zaretskii
2023-05-11  6:23                                         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-12  3:19                                         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-12 10:43                                           ` Eli Zaretskii
2023-05-12 12:49                                             ` Gregory Heytings
2023-05-12 17:20                                               ` Juri Linkov
2023-05-12 19:21                                                 ` Eli Zaretskii
2023-05-10  0:46                                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-09  6:45                 ` Juri Linkov
2023-05-09  8:36                   ` Eli Zaretskii
2023-05-09  9:49                     ` Stephen Berman
2023-05-09 10:07                       ` Stephen Berman
2023-05-09 10:21                         ` Eli Zaretskii
2023-05-09 10:35                           ` Stephen Berman
2023-05-09 11:50                             ` Eli Zaretskii
2023-05-09 12:43                               ` Stephen Berman
2023-05-09 12:52                                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-09 13:12                                   ` Stephen Berman
2023-05-09 13:35                                     ` Eli Zaretskii
2023-05-09 14:34                                       ` Stephen Berman
2023-05-10  0:34                                         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-10  9:39                                           ` Stephen Berman
2023-05-09 13:32                                 ` Eli Zaretskii
2023-05-09 14:34                                   ` Stephen Berman
2023-05-10  0:47                                   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-09 10:14                       ` Eli Zaretskii
2023-05-09  1:08               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-09  6:43                 ` Juri Linkov
2023-05-09  8:43                   ` Eli Zaretskii
2023-05-09 11:44                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors

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).