Subject: RE: bug#45428: 27.1; (quote (quote (quote ...))) unexpectedly works as anonymous face

From: Drew Adams <[email-masked]>
Date: Mon, 28 Dec 2020 12:44:11 -0800 (PST)

> > I see the same thing that I see when I use this:
> > (insert (propertize "hello" 'face '(:height 10.0)))
> 
> Not exactly the same, see below.
> 
> > The bug, IMO, is that this is not "a sequence of
> > PROPERY VALUE pairs...", which is what the doc
> > says it should be: (quote (quote '(:height 10.0)))
> 
> Right, it's not.
> 
> > I wouldn't think of this as a doc bug because (1)
> > this behavior is so unusual
> 
> Which behavior are you alluding to here? and what is the "doc bug",
> exactly?

I was alluding to the fact that the doc says that
"Remaining arguments form a sequence of PROPERTY
VALUE pairs", but the inserted text seems to show
the effect of the pair `face (:height 10.0)', even
though that pair isn't present.

Instead, the only pair is, in effect (by evaling
the outermost `quote'), `face (quote '(:height 10.0))'.
The value `(quote '(:height 10.0))' for text property
`face' is different from the value `(:height 10.0)',
but the effect seems to be the same.  Likewise, if
you use

 (quote (quote (quote (quote '(:height 10.0)))))

> > Wrt #1: nowhere else, AFAIK, do we accept
> >    (quote (quote (quote SEXP)))
> > or (quote (quote (quote (quote (quote SEXP)))))
> > or <add more `quote' ...> as a substitute for SEXP.
> 
> We don't "accept" it here, either.
> 
> > We don't do that anywhere else, and I don't see
> > why we should do it here (or anywhere)?
> 
> We don't.  Please look in *Messages*, and you will see that.

OK.  I see that if I click move point around in
*Messages*, and with repetitions presumably from
redisplay cycles, this is shown in *Messages*:

  Invalid face reference: quote

There's no doubt some explanation for why the pair
formed by nested `quote's doesn't just get rejected
but is reported as invalid and has the innermost
`(:height 10.0)' taken into account.  No doubt you'll
explain that (please), but at least I hope you can
see that it's not obvious.

Given an explanation, there's presumably no bug.

So far, without an explanation, I don't understand
the behavior.  It's surprising, at the least.  But
I guess it has something to do with what's allowed
as a face "reference" and how such are handled?

If this is entirely normal behavior then I don't,
off-hand, see a way to lessen the surprise by
changing the doc.  Do you?  Depending on the
explanation, maybe there's something that could or
should be added to the manual about the behavior
of anonymous face representations?

Having heard the misunderstanding that we've made
(still without my understanding, so far), do you
have a suggestion for how to dispel/prevent it?