all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Chong Yidong <cyd@stupidchicken.com>
To: bug-gnu-emacs@gnu.org
Subject: Re: two display bugs involving interactions between after-string and display properties of adjacent overlays
Date: Fri, 29 Feb 2008 13:27:47 -0500	[thread overview]
Message-ID: <87ve47bot8.fsf@stupidchicken.com> (raw)
In-Reply-To: 86k5pi9wrg.fsf@macs.hw.ac.uk

Joe Wells <jbw@macs.hw.ac.uk> writes:

> BUG #2:  An overlay's display property and after-string property are
> not displayed if an immediately following overlay shares the same Lisp
> string as its display property.  (Using two distinct display strings
> with identical contents works around the bug.)
>
> Reproduce with this expression:
>
>   (test-in-fresh-buffer-and-window
>    (insert "ABCD")
>    (let ((o1 (make-overlay 2 3))
>          (o2 (make-overlay 3 4))
>          (s #1=" "))
>      (overlay-put o1 'after-string "1")
>      (overlay-put o1 'display #1#)
>      (overlay-put o2 'display #1#)))
>
> The above expression should display “A 1 D”.
> The above expression wrongly actually displays “A D”.

This occurs because, as stated in the Emacs Lisp manual, all
consecutive characters that have the same Lisp object as their
`display' property are replaced as a single unit.  In this case, it's
somewhat ambiguous what the behavior should be, but after looking at
the code I think the behavior you suggest would be much more difficult
to implement (and slower) than the current behavior.

Furthermore, you can trivially obtain the behavior you want by making
a copy of the string using copy-sequence, so that the two display
strings are different Lisp objects.

Therefore, let's leave this alone.

Thanks for the report, however.





      parent reply	other threads:[~2008-02-29 18:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-20  5:32 two display bugs involving interactions between after-string and display properties of adjacent overlays Joe Wells
2007-10-20  5:43 ` Joe Wells
2008-02-29  3:12 ` Chong Yidong
2008-02-29 18:27 ` Chong Yidong [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

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

  git send-email \
    --in-reply-to=87ve47bot8.fsf@stupidchicken.com \
    --to=cyd@stupidchicken.com \
    --cc=bug-gnu-emacs@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.