GNU bug report logs - #45264
26.3; `face-remap-set-base' seems to be bugged

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Wed, 16 Dec 2020 00:32:01 UTC

Severity: normal

Found in version 26.3

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Drew Adams <drew.adams <at> oracle.com>
Subject: bug#45264: closed (Re: bug#45264: 26.3; `face-remap-set-base'
 seems to be bugged)
Date: Sat, 19 Dec 2020 18:59:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#45264: 26.3; `face-remap-set-base' seems to be bugged

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 45264 <at> debbugs.gnu.org.

-- 
45264: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=45264
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 45264-done <at> debbugs.gnu.org
Subject: Re: bug#45264: 26.3; `face-remap-set-base' seems to be bugged
Date: Sat, 19 Dec 2020 20:58:02 +0200
> Date: Sat, 19 Dec 2020 10:32:16 -0800 (PST)
> From: Drew Adams <drew.adams <at> oracle.com>
> Cc: 45264 <at> debbugs.gnu.org
> 
> The confusion is from the doc not saying explicitly
> that each element of SPECS is a face spec, and NOT a
> face.

SPECS has no "elements".  SPECS stands for arguments to the function
beyond the 1st arg FACE.  Each such argument is either a face name or
a list of attribute/value pairs.

I changed the doc string to be more clear about that.

> 2. "why you thought the argument could be a list of
> one or more faces?"
> 
> The doc string explicitly says that elements of
> SPECS can be face names:
> 
>   Each list element should be either a face name or...

That's after it says that you should consider SPECS as "forming" a
list of elements.

[Message part 3 (message/rfc822, inline)]
From: Drew Adams <drew.adams <at> oracle.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.3; `face-remap-set-base' seems to be bugged
Date: Tue, 15 Dec 2020 16:31:31 -0800 (PST)
See https://emacs.stackexchange.com/a/62301/105

(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?


In GNU Emacs 26.3 (build 1, x86_64-w64-mingw32)
 of 2019-08-29
Repository revision: 96dd0196c28bc36779584e47fffcca433c9309cd
Windowing system distributor `Microsoft Corp.', version 10.0.18362
Configured using:
 `configure --without-dbus --host=x86_64-w64-mingw32
 --without-compress-install 'CFLAGS=-O2 -static -g3''



This bug report was last modified 4 years and 154 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.