unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: larsi@gnus.org, stefan@marxist.se, triska@metalevel.at,
	45428@debbugs.gnu.org
Subject: bug#45428: 27.1; (quote (quote (quote ...))) unexpectedly works as anonymous face
Date: Tue, 29 Dec 2020 10:27:11 -0800 (PST)	[thread overview]
Message-ID: <c4fc60ff-a821-4758-93e8-7c9eed0df6b7@default> (raw)
In-Reply-To: <83eej8k6jw.fsf@gnu.org>

> The original bug report said something different:...
> However, that original complaint is incorrectly assuming that a face
> can _only_ have the form of an anonymous face, which is a property
> list of attribute/value pairs.  The text it quotes from section 39.12
> of the ELisp manual is incomplete; here it is in its entirety:
> 
>   One way to represent a face is as a property list of attributes, like
>   ‘(:foreground "red" :weight bold)’.  Such a list is called an "anonymous
>   face".  For example, you can assign an anonymous face as the value of
>   the ‘face’ text property, and Emacs will display the underlying text
>   with the specified attributes.  *Note Special Properties::.

I think it would help if that simple "See Special Properties"
were called out explicitly as telling you to see that
node for a complete description of the `face' property.
The text before it and after it can indeed give a false
impression about property `face' and how a face can be
represented. 

> If you follow the cross-reference to "Special Properties", you will
> find that the value of the 'face' property can be one of the
> following:
> 
>   . a face symbol
>   . a property list of attribute/value pairs
>   . a cons cell of the form (foreground-color . COLOR)
>   . a cons cell of the form (background-color . COLOR)
>   . a list of faces, each one given by any of the above forms
>   . a cons cell of the form (:filtered FILTER FACE-SPEC), where
>     FACE-SPEC is one of the above forms
> 
> And now you should recognize that the strange format of the property
> value, which prompted the original bug report, fits the "list of
> faces" format as described by the 5th item in the above list.

Indeed.  I thought that's what you might say.  Yes,
that description is fine.  But I hope you'll recognize
that the (quote (quote '(...))) example is a gotcha,
especially given that the "Invalid face reference:
quote" message is shown in *Messages* only after some
action provokes redisplay, and it often is not seen
in the echo area.  Without your having piped up here
to say "Please look in *Messages*" I wouldn't have
noticed it, for example.

If this were a court of law, your argument that the
doc is fine would be convincing.  But if we're trying
to help and guide users, then I think this `quote'
gotcha could be handled better.

Better still perhaps, instead of trying to address
the specific `quote' gotcha (which is particularly
misleading), the "Invalid face..." interaction could
perhaps be improved.  If that msg were (1) more
visible and immediate and (2) said more about what
is invalid (even just pointing out that here `quote'
is taken as a face name or whatever), that might help.

> So I still don't see a problem with the documentation in this case.

See above.  We could maybe help users a bit more,
without giving up any of the exactness of the spec
given in `Special Properties' etc.

> I think the only problem/surprise here could be that Emacs acted
> according to a single valid part of the face spec and seemingly
> silently ignored the invalid ones, logging an error message in
> *Messages* instead of perhaps rejecting it wholesale, and the OP
> failed to look in *Messages*.  

Yes, now we're thinking along the same lines.  The
real problem is the interaction with the user and
the inadequacy of the message, IMO.

> However, that doesn't seem to be a bug:
> the face spec is invalid, 

Yes, but can we say why, in what way, what about
it is invalid?

(If the doc in question actually referred to
"face spec" instead of "face" or "face
representation", that would be a start.  It would
guide user toward the part of the doc that says
what can be in a face spec.)

> and so invokes undefined behavior, where we
> only have an obligation not to crash nor lock up Emacs (which is why
> the error message isn't displayed as such: the face merging happens at
> display time, and we cannot usefully signal an error from redisplay).

I was afraid you might say that.  All I can say
is that if we can possibly do something better
that would help.  There are gotchas in Emacs
that we can't really prevent or guide users away
from (e.g. using existing names of things in
perverted, misleading ways).  I was hoping this
is one where we might be able to help a bit.

> > 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?
> 
> Tell users to read the docs?  But we already know
> that doesn't really work...

In this case, the problem (IMO) is that the doc
they are led to doesn't guide them to the doc that
really helps with this.  See above.





  parent reply	other threads:[~2020-12-29 18:27 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <<<<<<m2tusa3vzm.fsf@metalevel.at>
     [not found] ` <<<<<<87eejc9pnm.fsf@gnus.org>
     [not found]   ` <<<<<<CADwFkm=Q9P-a+PJdiQzGWU9PkV1BhTEw9V4GPcFRAnuaFiUNVg@mail.gmail.com>
     [not found]     ` <<<<<<5e99c39b-b67b-4184-a890-2cae38fb40de@default>
     [not found]       ` <<<<<<87a6tzk5iv.fsf@metalevel.at>
     [not found]         ` <<<<<<83h7o7kufk.fsf@gnu.org>
     [not found]           ` <<<<<975c150b-99aa-4143-b057-8b5ec7caec19@default>
     [not found]             ` <<<<<838s9jkqh7.fsf@gnu.org>
     [not found]               ` <<<<fc9aea86-b07a-4f81-a442-019f610bb73a@default>
     [not found]                 ` <<<<835z4mkpvz.fsf@gnu.org>
     [not found]                   ` <<<5dfff982-e496-46fe-9efd-1e0edd4f0be8@default>
     [not found]                     ` <<<83o8idkehc.fsf@gnu.org>
     [not found]                       ` <<<83mtxxkcwk.fsf@gnu.org>
     [not found]                         ` <<9a600718-7caf-4ad0-a664-0ebafba63e57@default>
     [not found]                           ` <<83im8lk9lp.fsf@gnu.org>
2020-12-28 20:44                             ` bug#45428: 27.1; (quote (quote (quote ...))) unexpectedly works as anonymous face Drew Adams
2020-12-29 14:53                               ` Eli Zaretskii
2020-12-29 16:40                                 ` Markus Triska
2020-12-29 17:17                                   ` Eli Zaretskii
2020-12-29 18:39                                     ` Markus Triska
2020-12-29 19:41                                       ` Eli Zaretskii
2020-12-29 18:27                                 ` Drew Adams [this message]
2020-12-29 19:39                                   ` Eli Zaretskii
2020-12-30  2:54                                     ` Lars Ingebrigtsen
     [not found] <<<<<m2tusa3vzm.fsf@metalevel.at>
     [not found] ` <<<<<87eejc9pnm.fsf@gnus.org>
     [not found]   ` <<<<<CADwFkm=Q9P-a+PJdiQzGWU9PkV1BhTEw9V4GPcFRAnuaFiUNVg@mail.gmail.com>
     [not found]     ` <<<<<5e99c39b-b67b-4184-a890-2cae38fb40de@default>
     [not found]       ` <<<<<87a6tzk5iv.fsf@metalevel.at>
     [not found]         ` <<<<<83h7o7kufk.fsf@gnu.org>
     [not found]           ` <<<<975c150b-99aa-4143-b057-8b5ec7caec19@default>
     [not found]             ` <<<<838s9jkqh7.fsf@gnu.org>
     [not found]               ` <<<fc9aea86-b07a-4f81-a442-019f610bb73a@default>
     [not found]                 ` <<<835z4mkpvz.fsf@gnu.org>
     [not found]                   ` <<5dfff982-e496-46fe-9efd-1e0edd4f0be8@default>
     [not found]                     ` <<83o8idkehc.fsf@gnu.org>
     [not found]                       ` <<83mtxxkcwk.fsf@gnu.org>
2020-12-28 18:54                         ` Drew Adams
2020-12-28 19:34                           ` Eli Zaretskii
     [not found] <<<<m2tusa3vzm.fsf@metalevel.at>
     [not found] ` <<<<87eejc9pnm.fsf@gnus.org>
     [not found]   ` <<<<CADwFkm=Q9P-a+PJdiQzGWU9PkV1BhTEw9V4GPcFRAnuaFiUNVg@mail.gmail.com>
     [not found]     ` <<<<5e99c39b-b67b-4184-a890-2cae38fb40de@default>
     [not found]       ` <<<<87a6tzk5iv.fsf@metalevel.at>
     [not found]         ` <<<<83h7o7kufk.fsf@gnu.org>
     [not found]           ` <<<975c150b-99aa-4143-b057-8b5ec7caec19@default>
     [not found]             ` <<<838s9jkqh7.fsf@gnu.org>
     [not found]               ` <<fc9aea86-b07a-4f81-a442-019f610bb73a@default>
     [not found]                 ` <<835z4mkpvz.fsf@gnu.org>
2020-12-28 17:45                   ` Drew Adams
2020-12-28 17:49                     ` Eli Zaretskii
2020-12-28 18:23                       ` Eli Zaretskii
     [not found] <<<m2tusa3vzm.fsf@metalevel.at>
     [not found] ` <<<87eejc9pnm.fsf@gnus.org>
     [not found]   ` <<<CADwFkm=Q9P-a+PJdiQzGWU9PkV1BhTEw9V4GPcFRAnuaFiUNVg@mail.gmail.com>
     [not found]     ` <<<5e99c39b-b67b-4184-a890-2cae38fb40de@default>
     [not found]       ` <<<87a6tzk5iv.fsf@metalevel.at>
     [not found]         ` <<<83h7o7kufk.fsf@gnu.org>
     [not found]           ` <<975c150b-99aa-4143-b057-8b5ec7caec19@default>
     [not found]             ` <<838s9jkqh7.fsf@gnu.org>
2020-12-27 19:56               ` Drew Adams
2020-12-28 13:43                 ` Eli Zaretskii
     [not found] <<m2tusa3vzm.fsf@metalevel.at>
     [not found] ` <<87eejc9pnm.fsf@gnus.org>
     [not found]   ` <<CADwFkm=Q9P-a+PJdiQzGWU9PkV1BhTEw9V4GPcFRAnuaFiUNVg@mail.gmail.com>
     [not found]     ` <<5e99c39b-b67b-4184-a890-2cae38fb40de@default>
     [not found]       ` <<87a6tzk5iv.fsf@metalevel.at>
     [not found]         ` <<83h7o7kufk.fsf@gnu.org>
2020-12-27 19:06           ` Drew Adams
2020-12-27 19:18             ` Eli Zaretskii
2020-12-25 12:34 Markus Triska
2020-12-26 22:19 ` Lars Ingebrigtsen
2020-12-27  4:16   ` Stefan Kangas
2020-12-27  4:47     ` Drew Adams
2020-12-27  8:38       ` Markus Triska
2020-12-27 17:52         ` Eli Zaretskii
2020-12-28 19:58 ` Andreas Schwab

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=c4fc60ff-a821-4758-93e8-7c9eed0df6b7@default \
    --to=drew.adams@oracle.com \
    --cc=45428@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=larsi@gnus.org \
    --cc=stefan@marxist.se \
    --cc=triska@metalevel.at \
    /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).