Subject: bug#63271: 29.0.90; broken mouse-face

From: Stephen Berman <[email-masked]>
Date: Tue, 09 May 2023 12:35:35 +0200

On Tue, 09 May 2023 13:21:36 +0300 Eli Zaretskii <[email-masked]> wrote:

>> From: Stephen Berman <[email-masked]>
>> Cc: Juri Linkov <[email-masked]>,  [email-masked],  [email-masked]
>> 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