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


View this message in rfc822 format

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: 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 16:13:32 +0200
> Date: Mon, 03 Mar 2025 10:42:25 +0000
> From: Pip Cet <pipcet <at> protonmail.com>
> Cc: Helmut Eller <eller.helmut <at> gmail.com>, Stefan Monnier <monnier <at> iro.umontreal.ca>, Ihor Radchenko <yantar92 <at> posteo.net>, Eli Zaretskii <eliz <at> gnu.org>, joaomoreira <at> gmx.se, 76538 <at> debbugs.gnu.org
> 
> I have no idea why I hit the assert which required the second patch.

Which assertion was that?  Is there any way of triggering that on the
master branch, or on the igc branch without first applying the patch?

> 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 actual character in the buffer text is not relevant in that case,
as the results of the composition determine how many bytes to skip to
get to the next "display element".

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

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




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.