GNU bug report logs - #77452
31.0.50; Wide characters in left margin on ttys

Previous Next

Package: emacs;

Reported by: Gerd Möllmann <gerd.moellmann <at> gmail.com>

Date: Wed, 2 Apr 2025 09:53:01 UTC

Severity: normal

Found in version 31.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: gerd.moellmann <at> gmail.com
Cc: 77452 <at> debbugs.gnu.org
Subject: Re: bug#77452: 31.0.50; Wide characters in left margin on ttys
Date: Wed, 02 Apr 2025 17:52:27 +0300
> Cc: 77452 <at> debbugs.gnu.org
> Date: Wed, 02 Apr 2025 17:47:47 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> 
> > I tried to read and understand display_line etc. this morning, but I'm afraid
> > there is too much going on there for me to find the cause of this in
> > reasonable time.
> 
> Does the below look right to you?

Sorry, please try the slightly more safe change below:

diff --git a/src/xdisp.c b/src/xdisp.c
index 2c676c0..33d7314 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -25685,7 +25685,7 @@ #define RECORD_MAX_MIN_POS(IT)					\
 
       /* Now, get the metrics of what we want to display.  This also
 	 generates glyphs in `row' (which is IT->glyph_row).  */
-      n_glyphs_before = row->used[TEXT_AREA];
+      n_glyphs_before = row->used[it->area];
       x = it->current_x;
 
       /* Remember the line height so far in case the next element doesn't
@@ -25732,6 +25732,7 @@ #define RECORD_MAX_MIN_POS(IT)					\
 	 the next one.  */
       if (it->area != TEXT_AREA)
 	{
+	  enum glyph_row_area area = it->area;
 	  row->ascent = max (row->ascent, it->max_ascent);
 	  row->height = max (row->height, it->max_ascent + it->max_descent);
 	  row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent);
@@ -25740,6 +25741,15 @@ #define RECORD_MAX_MIN_POS(IT)					\
 	  row->extra_line_spacing = max (row->extra_line_spacing,
 					 it->max_extra_line_spacing);
 	  set_iterator_to_next (it, true);
+	  if (!FRAME_WINDOW_P (it->f)
+	      /* If we exhausted the glyphs of the marginal area...	 */
+	      it->area != area
+	      /* ...and the last character was multi-column...	*/
+	      && it->nglyphs > 1
+	      /* ...and not all of its glyphs fit in the marginalk area... */
+	      && row->used[area] < n_glyphs_before + it->nglyphs)
+	      /* ...then reset back to the previous character.	*/
+	    row->used[area] = n_glyphs_before;
 	  /* If we didn't handle the line/wrap prefix above, and the
 	     call to set_iterator_to_next just switched to TEXT_AREA,
 	     process the prefix now.  */




This bug report was last modified 49 days ago.

Previous Next


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