From unknown Thu Aug 21 12:10:09 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#34226 <34226@debbugs.gnu.org> To: bug#34226 <34226@debbugs.gnu.org> Subject: Status: Running (defface my-face-foo ...) just after emacs -Q creates a face whose face-id is 0 Reply-To: bug#34226 <34226@debbugs.gnu.org> Date: Thu, 21 Aug 2025 19:10:09 +0000 retitle 34226 Running (defface my-face-foo ...) just after emacs -Q creates= a face whose face-id is 0 reassign 34226 emacs submitter 34226 Eduardo Ochs severity 34226 normal tag 34226 fixed thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 27 16:42:58 2019 Received: (at submit) by debbugs.gnu.org; 27 Jan 2019 21:42:58 +0000 Received: from localhost ([127.0.0.1]:48016 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gnsCg-0002Id-1X for submit@debbugs.gnu.org; Sun, 27 Jan 2019 16:42:58 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53022) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gnsCc-0002IP-VW for submit@debbugs.gnu.org; Sun, 27 Jan 2019 16:42:56 -0500 Received: from lists.gnu.org ([209.51.188.17]:45182) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gnsCX-0003sF-MU for submit@debbugs.gnu.org; Sun, 27 Jan 2019 16:42:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34987) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gnsCW-0001Q7-DF for bug-gnu-emacs@gnu.org; Sun, 27 Jan 2019 16:42:49 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gnsCU-0003os-SA for bug-gnu-emacs@gnu.org; Sun, 27 Jan 2019 16:42:48 -0500 Received: from mail-qt1-x82e.google.com ([2607:f8b0:4864:20::82e]:46465) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gnsCU-0003j0-KR for bug-gnu-emacs@gnu.org; Sun, 27 Jan 2019 16:42:46 -0500 Received: by mail-qt1-x82e.google.com with SMTP id y20so16275315qtm.13 for ; Sun, 27 Jan 2019 13:42:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=exlxJON21nld8m2zCdQMSBNjWefJuajRePHuLUN6K88=; b=BKCt2TK6HrP8gOCYKOIWBQ6NhNrJz/AIw6z/WdI65CIA6dQgjgxnS/SshZAO/7CbkC DddiR7VZhLvSzqW1nMj2fm5D8wjmO+XT2ldm7fKWYo9Hy40i6iXp1gvY9+Z+XTM71Iwx IvHlgLk4Fszw9etsWI/UQXBMyL1tdL8VGb34/FXM5xrqCkJMFFQ9Cz1X/Wq2QLzDMwwT Dkj0y+k61Ky5mxqsqIq1sMz0F1nJJPx3qUB1zbk3tjtVLFzCc5E9aqQb45/PZ3z0W5Xm /FEI+3bg9W2Rf+LPJxqkRHymtdDr5fT53J+mAOnPHvsm6jFzkxb1XqCpDArmDbH5QNvt Wk9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=exlxJON21nld8m2zCdQMSBNjWefJuajRePHuLUN6K88=; b=WC4x4eY7oMvBwuoDrLAK+oiTbm65+9dr8zxUi/ms0JIoOPhtN9QcESQyWEKgsQ0egT zBPm3Q/s9Ao4bTHM9/4PJ7g1p+skB8oNL3qrCifr8NT347ixcurnj0BtSDANYL6SA52G fROggvH3+IHxD6e97TWc0VT2QWnZix7EQLUKjYh4Bqti8zwRLh+yqjPgLRhoMEtvtEoX tZ2C8JQ+f0jbSiJU1+Fsto11443ECblqM2VauczVzVq4xD24BXSTsKNv5AJpvDExcipr mmeri8AXP7jR0QbMoZLBWbGnhQP6TvujNac4sk74Tu/q1k4eExtVJ7/kOVHm5wmAc+te 6F5Q== X-Gm-Message-State: AJcUukcC2VCFa7CKsSk4d9P4RMxRnq1nt6/8e/7QAh3BTvwNM5CDz3LR dvamU6guTFOsHJW+L47F0AkrXc0oIdlt/0BS5PQVAjw5 X-Google-Smtp-Source: ALg8bN6XhdhGcq2plUniasvZ31RCc2eivsu7QxKeQVFE1wJALPmXFVlc2z+Aw33bbGy/xpCr9s76zNpzlH6JsM5YbqQ= X-Received: by 2002:a0c:89e9:: with SMTP id 38mr18482895qvs.31.1548625363566; Sun, 27 Jan 2019 13:42:43 -0800 (PST) MIME-Version: 1.0 From: Eduardo Ochs Date: Sun, 27 Jan 2019 19:42:32 -0200 Message-ID: Subject: Running (defface my-face-foo ...) just after emacs -Q creates a face whose face-id is 0 To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary="000000000000af884505807770b7" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::82e X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --000000000000af884505807770b7 Content-Type: text/plain; charset="UTF-8" In emacs from git the faces that are created in the .emacs receive bad face-ids - in particular, the first one gets face-id 0, which is the same as the face-id for the "default" face. I discovered this bug because the first face that my .emacs creates is used to make "^O"s be displayed as red stars, and in git emacs these red stars were not being displayed in red. The shell script below creates an elisp file - with some code in its comments meant be executed by hand - and loads and edits that elisp file from both emacs24 and emacs-27.0.50 with "-Q" to show the (bad) behaviour that I was getting from my .emacs. The relevant part of the M-x report-emacs-bug buffer is: In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2019-01-22 built on libreboot-ThinkPad-T400 Repository revision: fd943124439b7644392919bca8bc2a77e6316d92 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.11804000 System Description: Trisquel GNU/Linux Flidas (8.0) Cheers, Eduardo Ochs http://angg.twu.net/#eev --snip--snip-- cat > /tmp/face-id-bug.el <<'%%%' ;; A test file for the face id bug. ;; How to use this: run ;; emacs24 -Q -l /tmp/face-id-bug.el /tmp/face-id-bug.el ;; emacs27.0.50 -Q -l /tmp/face-id-bug.el /tmp/face-id-bug.el ;; and in each case execute the sexps in comments below. (defface my-face-red '((t (:foreground "red"))) "Face used for the red star glyph (char 15).") (defface my-face-green '((t (:foreground "green"))) "Face used for the green bang glyph (char 16).") (defun my-set-glyph (pos char face) (aset standard-display-table pos (vector (make-glyph-code char face)))) (if (not standard-display-table) (setq standard-display-table (make-display-table))) (my-set-glyph ?\^O ?* 'my-face-red) (my-set-glyph ?\^P ?! 'my-face-green) ;; Here's how to see the bug. Run this with C-x C-e: ;; (insert 10 15 16) ;; it will insert a newline, a char 15 - displayed as a red star ;; glyph - and a char 16 - displayed as a green bang glyph. ;; ;; PROBLEM: in Emacs 24 both glyphs display as expected; in Emacs from ;; git - at least on 2019jan27 - the red star glyph appears as a star ;; in the default face, that is not red. ;; ;; A GUESS: this MAY be related to how emacs attributes face-ids to ;; newly-create faces. In Emacs 24 all these face-ids are different: ;; (face-id 'default) ;; (face-id 'my-face-red) ;; (face-id 'my-face-green) ;; and in git Emacs the first two are zero - which means that ;; (make-glyph-code ?* 'my-face-red) ;; (make-glyph-code ?* 'default) ;; are indistinguishable. %%% emacs24 -Q -l /tmp/face-id-bug.el /tmp/face-id-bug.el emacs-27.0.50 -Q -l /tmp/face-id-bug.el /tmp/face-id-bug.el --000000000000af884505807770b7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
In emacs from git the faces that are= created in the .emacs receive bad
face-ids - in particular, the = first one gets face-id 0, which is the
same as the face-id for th= e "default" face.

I discovered this bug = because the first face that my .emacs creates is
used to make &qu= ot;^O"s be displayed as red stars, and in git emacs these
re= d stars were not being displayed in red.

The shell= script below creates an elisp file - with some code in its
comme= nts meant be executed by hand - and loads and edits that elisp
fi= le from both emacs24 and emacs-27.0.50 with "-Q" to show the (bad= )
behaviour that I was getting from my .emacs.

The relevant part of the M-x report-emacs-bug buffer is:
<= br>
In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Vers= ion 3.18.9)
=C2=A0of 2019-01-22 built on libreboot-ThinkPad-T400<= /div>
Repository revision: fd943124439b7644392919bca8bc2a77e6316d92
Repository branch: master
Windowing system distributor = 9;The X.Org Foundation', version 11.0.11804000
System Descrip= tion: Trisquel GNU/Linux Flidas (8.0)

=C2=A0 Cheer= s,
=C2=A0 =C2=A0 Eduardo Ochs

=

--snip--snip--


= cat > /tmp/face-id-bug.el <<'%%%'
;; A test file= for the face id bug.
;; How to use this: run
;;=C2=A0 = =C2=A0emacs24=C2=A0 =C2=A0 =C2=A0 -Q -l /tmp/face-id-bug.el /tmp/face-id-bu= g.el
;;=C2=A0 =C2=A0emacs27.0.50 -Q -l /tmp/face-id-bug.el /tmp/f= ace-id-bug.el
;; and in each case execute the sexps in comments b= elow.

(defface my-face-red
=C2=A0 '(= (t (:foreground "red")))
=C2=A0 "Face used for the= red star glyph (char 15).")

(defface my-face= -green
=C2=A0 '((t (:foreground "green")))
=C2=A0 "Face used for the green bang glyph (char 16).")

(defun my-set-glyph (pos char face)
=C2=A0 (ase= t standard-display-table pos
(vector (make-glyph-code char face))))

(if (no= t standard-display-table)
=C2=A0 =C2=A0 (setq standard-display-ta= ble (make-display-table)))

(my-set-glyph ?\^O ?* &= #39;my-face-red)
(my-set-glyph ?\^P ?! 'my-face-green)
<= div>
;; Here's how to see the bug. Run this with C-x C-e:=
;;=C2=A0 =C2=A0(insert 10 15 16)
;; it will insert a n= ewline, a char 15 - displayed as a red star
;; glyph - and a char= 16 - displayed as a green bang glyph.
;;
;; PROBLEM: i= n Emacs 24 both glyphs display as expected; in Emacs from
;; git = - at least on 2019jan27 - the red star glyph appears as a star
;;= in the default face, that is not red.
;;
;; A GUESS: t= his MAY be related to how emacs attributes face-ids to
;; newly-c= reate faces. In Emacs 24 all these face-ids are different:
;;=C2= =A0 (face-id 'default)
;;=C2=A0 (face-id 'my-face-red)
;;=C2=A0 (face-id 'my-face-green)
;; and in git Emacs= the first two are zero - which means that
;;=C2=A0 (make-glyph-c= ode ?* 'my-face-red)
;;=C2=A0 (make-glyph-code ?* 'defaul= t)
;; are indistinguishable.
%%%


emacs24=C2=A0 =C2=A0 =C2=A0 =C2=A0-Q -l /tmp/face-id-bug.= el /tmp/face-id-bug.el
emacs-27.0.50 -Q -l /tmp/face-id-bug.e= l /tmp/face-id-bug.el

--000000000000af884505807770b7-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 28 10:26:44 2019 Received: (at 34226) by debbugs.gnu.org; 28 Jan 2019 15:26:44 +0000 Received: from localhost ([127.0.0.1]:49289 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1go8o8-0006fD-1f for submit@debbugs.gnu.org; Mon, 28 Jan 2019 10:26:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44902) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1go8o7-0006f1-7W for 34226@debbugs.gnu.org; Mon, 28 Jan 2019 10:26:43 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:52763) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1go8nv-0007mQ-1l; Mon, 28 Jan 2019 10:26:34 -0500 Received: from [176.228.60.248] (port=3822 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1go8nt-00014P-9U; Mon, 28 Jan 2019 10:26:30 -0500 Date: Mon, 28 Jan 2019 17:26:14 +0200 Message-Id: <835zu84xd5.fsf@gnu.org> From: Eli Zaretskii To: Eduardo Ochs In-reply-to: (message from Eduardo Ochs on Sun, 27 Jan 2019 19:42:32 -0200) Subject: Re: bug#34226: Running (defface my-face-foo ...) just after emacs -Q creates a face whose face-id is 0 References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 34226 Cc: 34226@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > From: Eduardo Ochs > Date: Sun, 27 Jan 2019 19:42:32 -0200 > > In emacs from git the faces that are created in the .emacs receive bad > face-ids - in particular, the first one gets face-id 0, which is the > same as the face-id for the "default" face. > > I discovered this bug because the first face that my .emacs creates is > used to make "^O"s be displayed as red stars, and in git emacs these > red stars were not being displayed in red. > > The shell script below creates an elisp file - with some code in its > comments meant be executed by hand - and loads and edits that elisp > file from both emacs24 and emacs-27.0.50 with "-Q" to show the (bad) > behaviour that I was getting from my .emacs. Thanks for the easy test case. Should be fixed now. From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 16 20:14:28 2019 Received: (at 34226) by debbugs.gnu.org; 17 Apr 2019 00:14:28 +0000 Received: from localhost ([127.0.0.1]:38798 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hGYDb-0001TA-RB for submit@debbugs.gnu.org; Tue, 16 Apr 2019 20:14:28 -0400 Received: from mail-qk1-f175.google.com ([209.85.222.175]:43797) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hGYDY-0001Sq-OP; Tue, 16 Apr 2019 20:14:25 -0400 Received: by mail-qk1-f175.google.com with SMTP id c20so13327872qkc.10; Tue, 16 Apr 2019 17:14:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=xK2NHhQpZ6M2jfPSSWN+LkOBQPEi+fzNFtS0OaMkSmE=; b=VOY7HcjH1027YY7pn1fSaLZW+RnftPwIllWdmpjokBlsGz4iWpOJAhRBcOuiqEzc1P ltDAXLLRMNMCjagvRYtiIcgj/063h3t/qQb6obomPcXwOZCsDRDYXMgj3AF643nrdRZn zZwNBYaabI+VWC+X+uj2q/4hgU7UoHmNClI6OWkJ+iwZwKcq3TKmSyLzQ8Xe1suLSrek wM82ev7pa9e0nSw9oQB4AuXmV/dtPEa3KU5zoyBzOx4TzE1fF3UuGCWjxZMexISNK8gH gcJmhDjhLbNhvk44wiIueukqNcVrhsEVAPbffrbrEk6aqfvj+slPVqgoMd5BU6Gw3qaF UXIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=xK2NHhQpZ6M2jfPSSWN+LkOBQPEi+fzNFtS0OaMkSmE=; b=Yqcqx5IqaV4VrE6Jmw/Ynv3M/x9akhttVrLc0QLYwlBIrmzRmIu8JEASoOizGxJpb4 tQuP2zc3vEkoshwO3pnjcONPIvm+4wUnxSsmIKtO/EweN2l7fYtMFVo2IEdlFLJpWuD+ 4G63L1Vag0+Ag461Cf36RnUExN3xeOyiOp/RAqFBQKomHVyEl8SY6S2RVBe9I8SEdGGE +hMg98FIFI1okFOW6ZsDbZazvOZgRHCaQJHERroIb5W/0Z5MVnLr+BS+Ndi8FLSIrgu1 6VjxI4KTMlEBjmDytE8IqSXckBVeM1AMeNe+kzUDnzi5tN+eNkbHZHj2tk3YiJg//lTX hx+w== X-Gm-Message-State: APjAAAVi2yPF9zdHdHprCe7LpsTEoSbP0COV28lCwZ+oOTnq7WrGCXC3 giw0stZiialZIqA97Hvb9xrtfJD+ X-Google-Smtp-Source: APXvYqwCvbMezR++YHO7vx9F+Jp5qMdiAtdQjP/zfe97ciIQpfACcsaKjMw1jXmLjjxywCNNNPeOig== X-Received: by 2002:a05:620a:13e7:: with SMTP id h7mr39178504qkl.269.1555460059086; Tue, 16 Apr 2019 17:14:19 -0700 (PDT) Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id d205sm28670482qkg.66.2019.04.16.17.14.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Apr 2019 17:14:17 -0700 (PDT) From: Noam Postavsky To: Eli Zaretskii Subject: Re: bug#34226: Running (defface my-face-foo ...) just after emacs -Q creates a face whose face-id is 0 References: <835zu84xd5.fsf@gnu.org> Date: Tue, 16 Apr 2019 20:14:17 -0400 In-Reply-To: <835zu84xd5.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 28 Jan 2019 17:26:14 +0200") Message-ID: <87ef61xzc6.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34226 Cc: Eduardo Ochs , 34226@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 34226 fixed close 34226 quit Eli Zaretskii writes: >> In emacs from git the faces that are created in the .emacs receive bad >> face-ids - in particular, the first one gets face-id 0, which is the >> same as the face-id for the "default" face. >> >> I discovered this bug because the first face that my .emacs creates is >> used to make "^O"s be displayed as red stars, and in git emacs these >> red stars were not being displayed in red. >> >> The shell script below creates an elisp file - with some code in its >> comments meant be executed by hand - and loads and edits that elisp >> file from both emacs24 and emacs-27.0.50 with "-Q" to show the (bad) >> behaviour that I was getting from my .emacs. > > Thanks for the easy test case. Should be fixed now. No further comments, assuming it is fixed. cd06d173a6 2019-01-28T17:24:04+02:00 "Fix bug with face-id after restoring from pdump" From unknown Thu Aug 21 12:10:09 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 15 May 2019 11:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator