all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Richard Stallman <rms@gnu.org>
To: Chong Yidong <cyd@stupidchicken.com>
Cc: emacs-devel@gnu.org
Subject: Display problems with `before-string' in overlay
Date: Sun, 15 Apr 2007 09:59:22 -0400	[thread overview]
Message-ID: <E1Hd5GE-00008Y-SF@fencepost.gnu.org> (raw)
In-Reply-To: <87r6qof8ln.fsf@stupidchicken.com> (message from Chong Yidong on Fri, 13 Apr 2007 14:11:00 -0400)

Most of your proposed change in xdisp.c is the addition of the OVERLAY
argument to `string_buffer_position'.  That is harmless.

It includes two substantial changes which could really alter Emacs's
behavior.  I've included them below.

Could you explain them more clearly, in a way that demonstrates
they are correct?



***************
*** 11933,11952 ****
        Lisp_Object string;
        struct glyph *stop = glyph;
        int pos;
  
        limit = make_number (pt_old + 1);
        glyph = string_start;
        x = string_start_x;
        string = glyph->object;
!       pos = string_buffer_position (w, string, string_before_pos);
!       /* If STRING is from overlay, LAST_POS == 0.  We skip such glyphs
! 	 because we always put cursor after overlay strings.  */
!       while (pos == 0 && glyph < stop)
  	{
  	  string = glyph->object;
  	  SKIP_GLYPHS (glyph, stop, x, EQ (glyph->object, string));
  	  if (glyph < stop)
! 	    pos = string_buffer_position (w, glyph->object, string_before_pos);
  	}
  
        while (glyph < stop)
--- 11934,11955 ----
        Lisp_Object string;
        struct glyph *stop = glyph;
        int pos;
+       Lisp_Object overlay = Qnil;
  
        limit = make_number (pt_old + 1);
        glyph = string_start;
        x = string_start_x;
        string = glyph->object;
!       pos = string_buffer_position (w, string, string_before_pos, &overlay);
!       /* If STRING is from overlay, skip its glyphs because we always
! 	 put cursor after overlay strings.  */
!       while ((pos == 0 || !NILP (overlay)) && glyph < stop)
  	{
  	  string = glyph->object;
  	  SKIP_GLYPHS (glyph, stop, x, EQ (glyph->object, string));
  	  if (glyph < stop)
! 	    pos = string_buffer_position (w, glyph->object,
! 					  string_before_pos, overlay);
  	}
  
        while (glyph < stop)

***************
*** 15854,15865 ****
    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));
        else if (MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row))
  	{
  	  /* If the row ends in middle of a real character,
--- 15857,15866 ----
    if (PT == MATRIX_ROW_END_CHARPOS (row))
      {
        /* If the row ends with a newline from a string, we don't want
! 	 the cursor there.
  	 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;
        else if (MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row))
  	{
  	  /* If the row ends in middle of a real character,

  parent reply	other threads:[~2007-04-15 13:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <461C10A0.1010309@gmail.com>
     [not found] ` <87y7kyvm6a.fsf@stupidchicken.com>
     [not found]   ` <u4pnmlpjc.fsf@gnu.org>
     [not found]     ` <461D49A2.5070803@gmail.com>
     [not found]       ` <uzm5ejn8d.fsf@gnu.org>
     [not found]         ` <461DCB05.7090204@gmail.com>
     [not found]           ` <m3ejmqj9la.fsf@kfs-l.imdomain.dk>
     [not found]             ` <E1HcAna-0001lJ-BS@fencepost.gnu.org>
     [not found]               ` <87r6qof8ln.fsf@stupidchicken.com>
2007-04-15 13:59                 ` Display problems with `before-string' in overlay Richard Stallman
2007-04-15 15:45                   ` Chong Yidong
2007-04-16  4:31                     ` Richard Stallman
2007-04-16  4:32                     ` Richard Stallman
2007-04-15 13:59                 ` Richard Stallman [this message]
2007-04-15 14:28                   ` Chong Yidong
2007-04-16  4:32                     ` Richard Stallman

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1Hd5GE-00008Y-SF@fencepost.gnu.org \
    --to=rms@gnu.org \
    --cc=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.