unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: 20254@debbugs.gnu.org
Subject: bug#20254: 25.0.50; `face' overlays with equal priority at the same location
Date: Fri, 3 Apr 2015 14:44:49 -0700 (PDT)	[thread overview]
Message-ID: <841dbe06-ed20-4d8d-8bb3-c9245a2a65ed@default> (raw)

I add a new overlay with a given `face' value to some text in a buffer.
I add another overlay with a different `face' to the same text.

The two overlays have the same `priority' value.  The appearance
presumably follows what rule?  There is this description in (elisp)
`Overlay Properties', but it covers only the case where different
priorities are involved:

  For the `face' property, the higher priority overlay's value does not
  completely override the other value; instead, its face attributes
  override the face attributes of the lower priority `face' property.

I do the same thing to the same sequence of chars appearing elsewhere in
the same buffer.  The appearance is sometimes the same and sometimes
different.  One of the two faces "wins", it seems, but perhaps with more
testing I would find that there is indeed some face merging(?).  But
in any case, which one wins seems to be arbitrary (random).

If I have several such overlays, each with a different face, at the same
set of places, different ones seem to "win" here and there, again,
seemingly arbitrarily.

If I check `overlays-at' and `C-u C-x =', the overlays listed at each
place are the same, and in the same order.  (They were added to the
locations in sequence, i.e., overlays with a given face were added to
all locations, then overlays with the next face were added to the same
locations, etc.)

Is there a rule behind this behavior?  Can users control which overlay
among several with the same priority "wins"?  It doesn't seem to be the
first or last created, and I haven't found any other rule behind the
behavior either.

Note that the context is not one where I want to use different
priorities.  I'm just asking about the case where multiple overlays
apply to a given sequence of text, and they have the same priority but
different `face' property values.

Is this a bug?  Or could an enhancement be made, to make the behavior
predictable and controllable?

In GNU Emacs 25.0.50.1 (i686-pc-mingw32)
 of 2014-10-20 on LEG570
Bzr revision: 118168 rgm@gnu.org-20141020195941-icp42t8ttcnud09g
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --enable-checking=yes,glyphs CPPFLAGS=-DGLYPH_DEBUG=1'





             reply	other threads:[~2015-04-03 21:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-03 21:44 Drew Adams [this message]
2015-04-03 22:14 ` bug#20254: 25.0.50; `face' overlays with equal priority at the same location Stefan Monnier
2015-04-03 22:24   ` Drew Adams
2015-04-04  1:07     ` Stefan Monnier
2015-04-04  1:55       ` Drew Adams
2015-04-04  2:48         ` Stefan Monnier
2015-04-04  3:02           ` Drew Adams

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=841dbe06-ed20-4d8d-8bb3-c9245a2a65ed@default \
    --to=drew.adams@oracle.com \
    --cc=20254@debbugs.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 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).