unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Redisplay bug in latest CVS
@ 2002-05-14  9:43 Kim F. Storm
  2002-05-16 20:15 ` [FOUND CAUSE] " Kim F. Storm
  2002-05-23 21:57 ` Redisplay bug in latest CVS [FIXED] Kim F. Storm
  0 siblings, 2 replies; 4+ messages in thread
From: Kim F. Storm @ 2002-05-14  9:43 UTC (permalink / raw)



This is with latest CVS emacs on GNU/Linux 2.4 (redhat 7.2)
with Xfree 4.(something) running under X:

Save this file in x.c:

-------------------------------------------------
f()
{
  switch (a)
    {
    case 1:
		break;
    case 1:
		break;
    }
}
------------------------------------------------

[Notice that the "break;" lines are indented by two TABs].

Start emacs -q and do C-x C-f x.c RET

Now move the cursor _below_ the space in "case 1:", ie.

    case 1:
	X	      break;
here....^

Hit TAB.

The screen now looks like (cursor is on the `b'):

    case 1:
      br ak;
?.......^

Doing C-l brings back the missing `e'.


My guess is that if the cursor was on a TAB, the position
occupied by that TAB will be left blank after redisplay.

To see this, indent the "break;" by "TAB SPACE TAB" and
put the cursor on the SPACE and press TAB => correct redisplay.

.. but there must be more to it than that.

I don't have time to investigate this further right now.

-- 
Kim F. Storm  <storm@cua.dk>      http://www.cua.dk

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [FOUND CAUSE] Redisplay bug in latest CVS
  2002-05-14  9:43 Redisplay bug in latest CVS Kim F. Storm
@ 2002-05-16 20:15 ` Kim F. Storm
  2002-05-17 14:05   ` Gerd Moellmann
  2002-05-23 21:57 ` Redisplay bug in latest CVS [FIXED] Kim F. Storm
  1 sibling, 1 reply; 4+ messages in thread
From: Kim F. Storm @ 2002-05-16 20:15 UTC (permalink / raw)
  Cc: gerd

"Kim F. Storm" <storm@cua.dk> writes:

> 
> Now move the cursor _below_ the space in "case 1:", ie.
> 
>     case 1:
> 	X	      break;
> here....^
> 
> Hit TAB.
> 
> The screen now looks like (cursor is on the `b'):
> 
>     case 1:
>       br ak;
> ?.......^
> 
> Doing C-l brings back the missing `e'.

I've tracked this bug down to a problem with x_erase_phys_cursor.

When it calls get_phys_cursor_glyph to get the glyph under the (old)
cursor, the contents of w->phys_cursor.hpos is 1 - corresponding to
the character position of the TAB the cursor was on before hitting
tab... but in the updated line, row->glyphs[][1] contains a SPACE --
so that is what x_erase_phys_cursor prints to erase the old cursor.

I'm not quite sure whether this is really the problem, or whether
some earlier code should have cleared w->phys_cursor_on_p (in
case the cursor position has been written over -- which it has
been in this case -- but that may not be true in other cases).

There are more places in the code where w->phys_cursor.hpos
is compared to row->used[TEXT_AREA] ... which seems completely
bogus to me, as hpos does not in any way take the width of
the old and new glyphs in the line into account.
To me, it seems better to compare w->phys_cursor.x
to row->x + row->pixel_width, but that doesn't account for
the widths of the old and new character(s) that were / will be
displayed at that position.

I'll try to work out a proper fix for this.  Any ideas will
be appreciated...

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [FOUND CAUSE] Redisplay bug in latest CVS
  2002-05-16 20:15 ` [FOUND CAUSE] " Kim F. Storm
@ 2002-05-17 14:05   ` Gerd Moellmann
  0 siblings, 0 replies; 4+ messages in thread
From: Gerd Moellmann @ 2002-05-17 14:05 UTC (permalink / raw)
  Cc: emacs-devel

storm@cua.dk (Kim F. Storm) writes:

> I'm not quite sure whether this is really the problem, or whether
> some earlier code should have cleared w->phys_cursor_on_p

I think that should be the case.  Normally, bugs aside, the flag
should have been cleared.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Redisplay bug in latest CVS [FIXED]
  2002-05-14  9:43 Redisplay bug in latest CVS Kim F. Storm
  2002-05-16 20:15 ` [FOUND CAUSE] " Kim F. Storm
@ 2002-05-23 21:57 ` Kim F. Storm
  1 sibling, 0 replies; 4+ messages in thread
From: Kim F. Storm @ 2002-05-23 21:57 UTC (permalink / raw)


"Kim F. Storm" <storm@cua.dk> writes:

> This is with latest CVS emacs on GNU/Linux 2.4 (redhat 7.2)
> with Xfree 4.(something) running under X:
> 
> Save this file in x.c:
> 
> -------------------------------------------------
> f()
> {
>   switch (a)
>     {
>     case 1:
> 		break;
>     case 1:
> 		break;
>     }
> }
> ------------------------------------------------
> 
> [Notice that the "break;" lines are indented by two TABs].
> 
> Start emacs -q and do C-x C-f x.c RET
> 
> Now move the cursor _below_ the space in "case 1:", ie.
> 
>     case 1:
> 	X	      break;
> here....^
> 
> Hit TAB.
> 
> The screen now looks like (cursor is on the `b'):
> 
>     case 1:
>       br ak;
> ?.......^
> 
> Doing C-l brings back the missing `e'.
> 


I have committed a fix for this problem (to xterm.c).

I suspect that the fix should be merged to w32term.c and
macterm.c, but I haven't got any indications of whether
the problem exists on those platforms.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-05-23 21:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-14  9:43 Redisplay bug in latest CVS Kim F. Storm
2002-05-16 20:15 ` [FOUND CAUSE] " Kim F. Storm
2002-05-17 14:05   ` Gerd Moellmann
2002-05-23 21:57 ` Redisplay bug in latest CVS [FIXED] Kim F. Storm

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