emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Debugging printing to stderr prior glyph row values ....


From: Keith David Bershatsky
Subject: Re: Debugging printing to stderr prior glyph row values ....
Date: Thu, 23 May 2019 15:01:09 -0700

Thank you for mentioning the 4th case; i.e., when a row ends at ZV, but does 
have glyphs.  Testing for a differential between the start/end row bytepos, 
coupled with the row->ends_at_zv_p flag being true, appears to be sufficient 
for that particular case.

The multiple fake cursors feature places fake cursors at particular buffer 
positions from BEGV to ZV.  The crosshairs feature takes it one step further 
and draws fake cursors extending beyond ZV until the vertical ruler stops at 
the top of the mode-line.  As to the multiple fake cursors feature, there is a 
need to distinguish between a row containing _only_ ZV and subsequent rows so 
that fake cursors are not drawn there.

The test for row->ends_at_zv_p would be useful for a row containing _only_ ZV 
(last point in the buffer) if it were the only row with that flag enabled.  As 
far as I can tell, a row with _only_ ZV (last point in the buffer) is identical 
to rows that follow it because their ends_at_zv_p flag is true also.  I have 
not yet been able to figure out a way to programmatically distinguish between 
2, 3 and 4 in the following example:

1.  Every good boy deserves fudge.ΒΆ
2.  ZV<==
3.  [one or more ' ' space glyphs]
4.  [one or more ' ' space glyphs]
5.  Mode-Line

When the crashing sporadically occurred yesterday, I tried during a couple of 
crash sessions to call "pgrowx row - 1" and "pgrowx (row - 1)" from gdb, but 
gdb appeared to produce the output for ROW instead of ROW - 1.  I have now 
added the following definition in the code so that I can call "pgrowx 
previous_row" from gdb.

  struct glyph_row *previous_row = row - 1;

I spent several minutes this afternoon trying to make Emacs crash doing things 
similar to yesterday, but have not yet had any luck getting Emacs to crash ... 
I will keep trying ...

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

> Date: [05-23-2019 11:38:25] <23 May 2019 21:38:25 +0300>
> From: Eli Zaretskii <address@hidden>
> To: Keith David Bershatsky <address@hidden>
> CC: address@hidden
> Subject: Re: Debugging printing to stderr prior glyph row values ....
> 
> > Date:  Thu, 23 May 2019 10:23:03 -0700
> > From:  Keith David Bershatsky <address@hidden>
> > Cc:  address@hidden
> >
> > I will add a test for the `used` row member to ensure that it is positive.  
> > The crashing reported in the initial post only happens somtimes, so I'll 
> > need to do some further testing.
> 
> Did you look at the problematic row with the GDB command "pgrowx"?
> It's important to understand what kind of glyphs are in that row and
> how many of them do you have there.
> 
> > I am looking to programmatically distinguish between the following three 
> > types of consecutive rows:  (1) the penultimate row _not_ ending in ZV that 
> > immediately precedes a row with _only_ ZV; (2) the last row that contains 
> > _only_ ZV; and, (3) rows that follow a row with _only_ ZV.
> 
> There's a 4th case: when a row ends at ZV, but does have glyphs.  This
> happens, for example, when visiting a file that doesn't end in a
> newline.
> 
> > A better method of determining row_at_zv_p (without consulting ROW - 1) 
> > would be appreciated, if such a test exists.
> 
> I don't understand why you don't just look at the ends_at_zv_p flag,
> that's what it's for.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]