From: Eli Zaretskii <eliz@gnu.org>
To: michael@kleehammer.com
Cc: 11367-done@debbugs.gnu.org
Subject: bug#11367: 24.0.95.1 Crash: Windows 7 using egg
Date: Sun, 29 Apr 2012 20:30:31 +0300 [thread overview]
Message-ID: <83397m78eg.fsf@gnu.org> (raw)
In-Reply-To: <8362cj7fj4.fsf@gnu.org>
> Date: Sat, 28 Apr 2012 23:44:15 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: 11367@debbugs.gnu.org
>
> > From: Michael Kleehammer <michael@kleehammer.com>
> > Date: Sat, 28 Apr 2012 14:27:00 -0500
> >
> > > I see I will need to install msysgit and debug this locally. Last
> > > request:
> > >
> > > (gdb) p (g-2)->object
> >
> > $13 = 60228101
> >
> > > (gdb) xtype
> >
> > Lisp_Vectorlike
> > PVEC_BUFFER
> >
> > > (gdb) p it3.object
> >
> > $14 = 84618657
> >
> > > (gdb) xtype
> >
> > Lisp_String
>
> Thanks. I've reproduced the problem, and will debug it (probably
> tomorrow; gray hair says it's unwise to try fixing redisplay after
> 11PM ;-).
I think I fixed this (revision 107922 on the emacs-24 branch). The
diffs are below, in case you want (and are able) to try them now.
Thanks.
=== modified file 'src/ChangeLog'
--- src/ChangeLog 2012-04-24 02:58:26 +0000
+++ src/ChangeLog 2012-04-29 17:19:08 +0000
@@ -1,3 +1,10 @@
+2012-04-29 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (pos_visible_p): If already at a newline from the
+ display string before the 'while' loop, don't walk back the glyphs
+ from it3.glyph_row. Solves assertion violation when the display
+ string begins with a newline (egg.el). (Bug#11367)
+
2012-04-24 Chong Yidong <cyd@gnu.org>
* xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
=== modified file 'src/xdisp.c'
--- src/xdisp.c 2012-04-23 16:22:23 +0000
+++ src/xdisp.c 2012-04-29 17:19:08 +0000
@@ -1375,6 +1375,7 @@ pos_visible_p (struct window *w, EMACS_I
Lisp_Object startpos, endpos;
EMACS_INT start, end;
struct it it3;
+ int it3_moved;
/* Find the first and the last buffer positions
covered by the display string. */
@@ -1431,6 +1432,15 @@ pos_visible_p (struct window *w, EMACS_I
begins. */
start_display (&it3, w, top);
move_it_to (&it3, -1, 0, top_y, -1, MOVE_TO_X | MOVE_TO_Y);
+ /* If it3_moved stays zero after the 'while' loop
+ below, that means we already were at a newline
+ before the loop (e.g., the display string begins
+ with a newline), so we don't need to (and cannot)
+ inspect the glyphs of it3.glyph_row, because
+ PRODUCE_GLYPHS will not produce anything for a
+ newline, and thus it3.glyph_row stays at its
+ stale content it got at top of the window. */
+ it3_moved = 0;
/* Finally, advance the iterator until we hit the
first display element whose character position is
CHARPOS, or until the first newline from the
@@ -1442,6 +1452,7 @@ pos_visible_p (struct window *w, EMACS_I
if (IT_CHARPOS (it3) == charpos
|| ITERATOR_AT_END_OF_LINE_P (&it3))
break;
+ it3_moved = 1;
set_iterator_to_next (&it3, 0);
}
top_x = it3.current_x - it3.pixel_width;
@@ -1452,7 +1463,8 @@ pos_visible_p (struct window *w, EMACS_I
display string, move back over the glyphs
produced from the string, until we find the
rightmost glyph not from the string. */
- if (IT_CHARPOS (it3) != charpos && EQ (it3.object, string))
+ if (it3_moved
+ && IT_CHARPOS (it3) != charpos && EQ (it3.object, string))
{
struct glyph *g = it3.glyph_row->glyphs[TEXT_AREA]
+ it3.glyph_row->used[TEXT_AREA];
prev parent reply other threads:[~2012-04-29 17:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-27 20:03 bug#11367: 24.0.95.1 Crash: Windows 7 using egg Michael Kleehammer
2012-04-28 7:13 ` Eli Zaretskii
2012-04-28 14:55 ` Michael Kleehammer
2012-04-28 15:34 ` Eli Zaretskii
2012-04-28 16:32 ` Michael Kleehammer
2012-04-28 17:22 ` Eli Zaretskii
2012-04-28 17:56 ` Michael Kleehammer
2012-04-28 18:52 ` Eli Zaretskii
2012-04-28 19:17 ` Michael Kleehammer
2012-04-28 19:24 ` Eli Zaretskii
2012-04-28 19:27 ` Michael Kleehammer
2012-04-28 20:44 ` Eli Zaretskii
2012-04-29 17:30 ` Eli Zaretskii [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83397m78eg.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=11367-done@debbugs.gnu.org \
--cc=michael@kleehammer.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).