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:21 -0400	[thread overview]
Message-ID: <E1Hd5GD-00008P-Hz@fencepost.gnu.org> (raw)
In-Reply-To: <87r6qof8ln.fsf@stupidchicken.com> (message from Chong Yidong on Fri, 13 Apr 2007 14:11:00 -0400)

You proposed a change in the code at 2010 in keyboard.c.
(I've copied it below.)  I don't see why it is correct,
so here are some questions.

    ! 	  && (OVERLAYP (overlay)
    ! 	      ? (beg = OVERLAY_POSITION (OVERLAY_START (overlay)),
    ! 		 end = OVERLAY_POSITION (OVERLAY_END (overlay)),
    ! 		 beg <= PT)

How can it ever happen that BEG <= PT is false?
If that were false, the overlay would not cover PT,
so it should not have been returned in the first place, right?

Anyway, your change is to replace 

             (beg < PT /* && end > PT   <- It's always the case.  */
 	      || (beg <= PT && STRINGP (val) && SCHARS (val) == 0))

with a condition that is always true.  Could you please explain the
motive for that change?  Why is it correct to adjust point when it
starts out at the beginning of an overlay with a `display' property?

Also, why is the condition

 	      || (beg <= PT && STRINGP (val) && SCHARS (val) == 0)

used at all?  What usage case is that meant to cover, and what is the
right behavior for that case?  Even if we don't change the code here
now, we need to put in a comment about that.



*** emacs/src/keyboard.c.~1.899.~	2007-04-04 13:05:31.000000000 -0400
--- emacs/src/keyboard.c	2007-04-13 14:04:15.000000000 -0400
***************
*** 2010,2021 ****
  	  && !NILP (val = get_char_property_and_overlay
  		              (make_number (PT), Qdisplay, Qnil, &overlay))
  	  && display_prop_intangible_p (val)
! 	  && (!OVERLAYP (overlay)
! 	      ? get_property_and_range (PT, Qdisplay, &val, &beg, &end, Qnil)
! 	      : (beg = OVERLAY_POSITION (OVERLAY_START (overlay)),
! 		 end = OVERLAY_POSITION (OVERLAY_END (overlay))))
! 	  && (beg < PT /* && end > PT   <- It's always the case.  */
! 	      || (beg <= PT && STRINGP (val) && SCHARS (val) == 0)))
  	{
  	  xassert (end > PT);
  	  SET_PT (PT < last_pt
--- 2010,2022 ----
  	  && !NILP (val = get_char_property_and_overlay
  		              (make_number (PT), Qdisplay, Qnil, &overlay))
  	  && display_prop_intangible_p (val)
! 	  && (OVERLAYP (overlay)
! 	      ? (beg = OVERLAY_POSITION (OVERLAY_START (overlay)),
! 		 end = OVERLAY_POSITION (OVERLAY_END (overlay)),
! 		 beg <= PT)
! 	      : (get_property_and_range (PT, Qdisplay, &val, &beg, &end, Qnil),
! 		 (beg < PT
! 		  || (beg <= PT && STRINGP (val) && SCHARS (val) == 0)))))
  	{
  	  xassert (end > PT);
  	  SET_PT (PT < last_pt

       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                 ` Richard Stallman [this message]
2007-04-15 15:45                   ` Display problems with `before-string' in overlay Chong Yidong
2007-04-16  4:31                     ` Richard Stallman
2007-04-16  4:32                     ` Richard Stallman
2007-04-15 13:59                 ` Richard Stallman
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=E1Hd5GD-00008P-Hz@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.