emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: Display problems with 'before-string in overlay


From: Lennart Borgman (gmail)
Subject: Re: Display problems with 'before-string in overlay
Date: Thu, 12 Apr 2007 02:44:30 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.10) Gecko/20070221 Thunderbird/1.5.0.10 Mnenhy/0.7.5.666

Chong Yidong wrote:
"Lennart Borgman (gmail)" <address@hidden> writes:

  if (PT == MATRIX_ROW_END_CHARPOS (row))
    {
      /* If the row ends with a newline from a string, we don't want
         the cursor there, but we still want it at the start of the
         string if the string starts in this row.
         If the row is continued it doesn't end in a newline.  */
      if (CHARPOS (row->end.string_pos) >= 0)
        cursor_row_p = (row->continued_p
                        || PT >= MATRIX_ROW_START_CHARPOS (row));

Changing this last line to `cursor_row_p = row->continued_p;', as it
was before, eliminates the bug.  I haven't thought about how to fix
this, though.
FWIW, I wouldn't touch this so close to the release: if no one noticed
this since July 2005, it's hardly a grave bug.

How do you know? This just looks so strange so it could well be a
grave bug.

Its only effect is that if a before-string spans multiple lines then
the cursor ends up being displayed on the end of the first line.  It
does not have any further implications, such as crashing Emacs or
corrupting data.

As for whether or not to change the code, I guess it's up to KFS.


Looking at the logic it seems like it perhaps should be like below instead? This at least works in my case. The current test just seems useless. Or perhaps I am just very bad at reading C code?


Index: xdisp.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/xdisp.c,v
retrieving revision 1.1146
diff -c -r1.1146 xdisp.c
*** xdisp.c     10 Apr 2007 15:57:25 -0000      1.1146
--- xdisp.c     12 Apr 2007 00:40:36 -0000
***************
*** 15859,15865 ****
         If the row is continued it doesn't end in a newline.  */
        if (CHARPOS (row->end.string_pos) >= 0)
        cursor_row_p = (row->continued_p
!                       || PT >= MATRIX_ROW_START_CHARPOS (row));
        else if (MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row))
        {
          /* If the row ends in middle of a real character,
--- 15859,15865 ----
         If the row is continued it doesn't end in a newline.  */
        if (CHARPOS (row->end.string_pos) >= 0)
        cursor_row_p = (row->continued_p
!                       || PT < MATRIX_ROW_START_CHARPOS (++row));
        else if (MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row))
        {
          /* If the row ends in middle of a real character,





reply via email to

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