unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Drew Adams <drew.adams@oracle.com>
Cc: 45264@debbugs.gnu.org
Subject: bug#45264: 26.3; `face-remap-set-base' seems to be bugged
Date: Sat, 19 Dec 2020 12:20:04 +0200	[thread overview]
Message-ID: <833602umgb.fsf@gnu.org> (raw)
In-Reply-To: <dbc9cd7f-c4da-4137-a972-aada49e0f1f1@default> (message from Drew Adams on Tue, 15 Dec 2020 16:31:31 -0800 (PST))

> Date: Tue, 15 Dec 2020 16:31:31 -0800 (PST)
> From: Drew Adams <drew.adams@oracle.com>
> 
> (defface foo '((t (:background "red"))) "...")
> 
> (face-remap-set-base 'font-lock-keyword-face 'foo)
> 
> The &rest arg SPECS is `(foo)', which is, as required, a list of
> (one) face.
> 
> But the code actually expects `foo' itself to be a list.  It raises
> an error, because it sets SPECS to just `foo' and then tries to
> take the car of it.
> 
> (while (and (consp specs)
>             (not (null (car specs)))
>             (null (cdr specs)))
>   (setq specs (car specs))) ; <=========
> 
> (if (or (null specs)
>     (and (eq (car specs) face) ; <=========
>          (null (cdr specs))))
> 
> Is there a doc bug (both manual and doc string)?  Or is there a code
> bug?  Or am I missing something?

I don't see anything wrong with the documentation yet.  One needs to
know and understand what is a "face spec", and then everything falls
into its place.  The &rest part is also a big hint.

Can I turn the table and ask you why you thought the argument could be
a list of one or more faces?  The doc string says "should FORM a list
of faces", it doesn't say it should BE a list of faces.  And since
when does &rest specify a single argument that is a list?





  reply	other threads:[~2020-12-19 10:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-16  0:31 bug#45264: 26.3; `face-remap-set-base' seems to be bugged Drew Adams
2020-12-19 10:20 ` Eli Zaretskii [this message]
     [not found] <<dbc9cd7f-c4da-4137-a972-aada49e0f1f1@default>
     [not found] ` <<833602umgb.fsf@gnu.org>
2020-12-19 18:32   ` Drew Adams
2020-12-19 18:58     ` Eli Zaretskii
     [not found] <<<dbc9cd7f-c4da-4137-a972-aada49e0f1f1@default>
     [not found] ` <<<833602umgb.fsf@gnu.org>
     [not found]   ` <<4efb5c63-6636-449f-8e2b-4b8533a9cc8c@default>
     [not found]     ` <<83a6u9tyh1.fsf@gnu.org>
2020-12-19 19:28       ` Drew Adams
2020-12-19 19:40         ` Eli Zaretskii

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=833602umgb.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=45264@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    /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).