GNU bug report logs - #76538
31.0.50; 31.0.50; 31.0.50; feature/igc: using magit-section-cycle-global (S-TAB) and magit-section-toggle (TAB) in some random ways blocks GNU Emacs.

Previous Next

Package: emacs;

Reported by: João Moreira <joaomoreira <at> gmx.se>

Date: Tue, 25 Feb 2025 03:42:01 UTC

Severity: normal

Found in version 31.0.50

Full log


Message #146 received at 76538 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Pip Cet <pipcet <at> protonmail.com>
Cc: yantar92 <at> posteo.net, eller.helmut <at> gmail.com, gerd.moellmann <at> gmail.com,
 monnier <at> iro.umontreal.ca, joaomoreira <at> gmx.se, 76538 <at> debbugs.gnu.org
Subject: Re: bug#76538: 31.0.50; 31.0.50; 31.0.50;
 feature/igc: using magit-section-cycle-global (S-TAB) and
 magit-section-toggle (TAB) in some random ways blocks GNU Emacs.
Date: Mon, 03 Mar 2025 17:33:23 +0200
> Date: Mon, 03 Mar 2025 14:46:55 +0000
> From: Pip Cet <pipcet <at> protonmail.com>
> Cc: gerd.moellmann <at> gmail.com, eller.helmut <at> gmail.com, monnier <at> iro.umontreal.ca, yantar92 <at> posteo.net, joaomoreira <at> gmx.se, 76538 <at> debbugs.gnu.org
> 
> Should this combination ever be valid?
> 
> it->what = IT_CHARACTER
> it->c = 10
> it->len = 0
> 
> >> It seems to me like a bug in the xdisp.c code, but it's xdisp.c, so
> >> who knows?
> >
> > I suspect it->len is not used when the character is composed, because
> 
> The character isn't composed, is it? It's a plain newline.

AFAIR, the value of it->len for a newline is never used, because we
are at the end of a line, and will then jump to the next visible line
anyway (or stop iteration altogether).

Which is not to say I'm against the changes, I'm just trying to
explain why it never caused us any assertion violations till now.

> >> -	it->c = STRING_CHAR (s);
> >> +	{
> >> +	  it->c = STRING_CHAR (s);
> >> +	  it->len = CHAR_BYTES (it->c);
> >> +	}
> >
> > This is sub-optimal; please use string_char_and_length instead.
> 
> Will do, if we need to fix this at all.
> 
> >> @@ -6724,6 +6730,7 @@ handle_composition_prop (struct it *it)
> >>        pos_byte = IT_BYTEPOS (*it);
> >>        string = Qnil;
> >>        it->c = FETCH_CHAR (pos_byte);
> >> +      it->len = it->multibyte_p ? CHAR_BYTES (it->c) : 1;
> >
> > Likewise here.
> 
> I was looking for fetch_char_and_length, but I guess
> string_char_and_length (BYTE_POS_ADDR (pos_byte), &it->len) works, too?

Yes.




This bug report was last modified 105 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.