From unknown Wed Sep 10 20:43:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61521: "default" is now the first item returned from (font-faces), breaking various code. Resent-From: Brennan Vincent Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Feb 2023 00:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 61521 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 61521@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167642110330690 (code B ref -1); Wed, 15 Feb 2023 00:32:01 +0000 Received: (at submit) by debbugs.gnu.org; 15 Feb 2023 00:31:43 +0000 Received: from localhost ([127.0.0.1]:57401 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pS5i3-0007yw-8h for submit@debbugs.gnu.org; Tue, 14 Feb 2023 19:31:43 -0500 Received: from lists.gnu.org ([209.51.188.17]:34246) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pS5i1-0007yo-Fo for submit@debbugs.gnu.org; Tue, 14 Feb 2023 19:31:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pS5i1-00085b-7D for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2023 19:31:41 -0500 Received: from smtp.umanwizard.com ([54.203.248.109]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pS5hx-0006n4-CH for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2023 19:31:40 -0500 Received: from [192.168.1.253] ([70.18.6.196]) by umanwizard.com ; 15 Feb 2023 00:31:33 +0000 X-Fes-Received-For: bug-gnu-emacs@gnu.org X-Fes-Received-From: Message-ID: <7fe5e80d-761f-cc2d-12a1-65b2b5781c39@umanwizard.com> Date: Tue, 14 Feb 2023 19:31:30 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Content-Language: en-US From: Brennan Vincent Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Fes-Encrypted: true X-Fes-Ehlo-Domain: [192.168.1.253] Received-SPF: pass client-ip=54.203.248.109; envelope-from=brennan@umanwizard.com; helo=smtp.umanwizard.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) 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: -2.4 (--) Various code seems to expect "default" to be the /last/ item in the list returned by that function, not the first. For example, this comment in faces.el: ;; The `reverse' is so that `default' goes first. (dolist (face (nreverse (face-list))) Also, org-html-htmlize-generate-css does not work when default comes first in the list (as it skips processing all fonts after default). I am not sure why this was changed and if the change was intentional, but it can be fixed by changing the "<" to a ">" in the last line of face-list, so I suspect it might have been a mistake. diff --git lisp/faces.el lisp/faces.el index 4933b495a6c..e998dc504e5 100644 --- lisp/faces.el +++ lisp/faces.el @@ -199,7 +199,7 @@ face-list (maphash (lambda (face spec) (push `(,(car spec) . ,face) faces)) face--new-frame-defaults) - (mapcar #'cdr (sort faces (lambda (f1 f2) (< (car f1) (car f2))))))) + (mapcar #'cdr (sort faces (lambda (f1 f2) (> (car f1) (car f2))))))) (defun make-face (face) "Define a new face with name FACE, a symbol. From unknown Wed Sep 10 20:43:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61521: "default" is now the first item returned from (font-faces), breaking various code. Resent-From: Brennan Vincent Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Feb 2023 00:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61521 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 61521@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.1676422352532 (code B ref -1); Wed, 15 Feb 2023 00:53:02 +0000 Received: (at submit) by debbugs.gnu.org; 15 Feb 2023 00:52:32 +0000 Received: from localhost ([127.0.0.1]:57406 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pS62C-00008W-9z for submit@debbugs.gnu.org; Tue, 14 Feb 2023 19:52:32 -0500 Received: from lists.gnu.org ([209.51.188.17]:60432) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pS62A-00008O-Ii for submit@debbugs.gnu.org; Tue, 14 Feb 2023 19:52:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pS62A-0004wv-8w for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2023 19:52:30 -0500 Received: from smtp.umanwizard.com ([54.203.248.109]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pS628-0000e4-7W for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2023 19:52:29 -0500 Received: from [192.168.1.253] ([70.18.6.196]) by umanwizard.com ; 15 Feb 2023 00:52:26 +0000 X-Fes-Received-For: bug-gnu-emacs@gnu.org X-Fes-Received-From: Message-ID: Date: Tue, 14 Feb 2023 19:52:23 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Content-Language: en-US From: Brennan Vincent References: <7fe5e80d-761f-cc2d-12a1-65b2b5781c39@umanwizard.com> In-Reply-To: <7fe5e80d-761f-cc2d-12a1-65b2b5781c39@umanwizard.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Fes-Encrypted: true X-Fes-Ehlo-Domain: [192.168.1.253] Received-SPF: pass client-ip=54.203.248.109; envelope-from=brennan@umanwizard.com; helo=smtp.umanwizard.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-0.35, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.5 (--) 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: -3.5 (---) I suspect frame-face-alist needs to be changed in a similar way. On 2023-02-14 19:31, Brennan Vincent wrote: > Various code seems to expect "default" to be the /last/ item in the list > returned by that function, not the first. For example, this comment in faces.el: > > ;; The `reverse' is so that `default' goes first. > (dolist (face (nreverse (face-list))) > > > Also, org-html-htmlize-generate-css does not work when default comes first in > the list (as it skips processing all fonts after default). > > I am not sure why this was changed and if the change was intentional, but it can > be fixed by changing the "<" to a ">" in the last line of face-list, so I > suspect it might have been a mistake. > > diff --git lisp/faces.el lisp/faces.el > index 4933b495a6c..e998dc504e5 100644 > --- lisp/faces.el > +++ lisp/faces.el > @@ -199,7 +199,7 @@ face-list > (maphash (lambda (face spec) > (push `(,(car spec) . ,face) faces)) > face--new-frame-defaults) > - (mapcar #'cdr (sort faces (lambda (f1 f2) (< (car f1) (car f2))))))) > + (mapcar #'cdr (sort faces (lambda (f1 f2) (> (car f1) (car f2))))))) > > (defun make-face (face) > "Define a new face with name FACE, a symbol. From unknown Wed Sep 10 20:43:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61521: "default" is now the first item returned from (font-faces), breaking various code. Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Feb 2023 01:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61521 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Brennan Vincent Cc: 61521@debbugs.gnu.org Received: via spool by 61521-submit@debbugs.gnu.org id=B61521.16764228541469 (code B ref 61521); Wed, 15 Feb 2023 01:01:02 +0000 Received: (at 61521) by debbugs.gnu.org; 15 Feb 2023 01:00:54 +0000 Received: from localhost ([127.0.0.1]:57414 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pS6AI-0000Nd-HC for submit@debbugs.gnu.org; Tue, 14 Feb 2023 20:00:54 -0500 Received: from heytings.org ([95.142.160.155]:57300) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pS6AG-0000NT-Dd for 61521@debbugs.gnu.org; Tue, 14 Feb 2023 20:00:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1676422851; bh=qBsZyWuUtfcdU55Iqr/WG4NDoz/E56+0vapsmjgEDhg=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=oQoYkH3CsBlo/x8h/eqhUPrm8DvuQGths99RMLenhp1+gtbvpkZ4xwHyBXlTT2xE3 7OOM9sogTZQioW+c7Nv0ukB7SEz1+VwLJW3Lh2CnHxfKy7i3KviOZ+DHsWn4pN9Oxg mFfXrWLQezEmbTbShiZRe46QZcmRkp29+/Xzw6JOK4Y2Bb6kETXKjwVg0vunRXDQ7y i5WWvWN2/z4cs7G250K1NC16xFv5/th5WB7XTWUNo3dvE1V1ylOgHuJImkRRZWKlUX ktltjlTmqdRxEjIL0AT3Ufu7+7YNkM0ndXEgqcW6OMnb8lZxqOOWPi1BjnGas2G7zZ xJTqVlq9aoS4g== Date: Wed, 15 Feb 2023 01:00:50 +0000 From: Gregory Heytings In-Reply-To: <7fe5e80d-761f-cc2d-12a1-65b2b5781c39@umanwizard.com> Message-ID: <9e9ed8043f57226204db@heytings.org> References: <7fe5e80d-761f-cc2d-12a1-65b2b5781c39@umanwizard.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed X-Spam-Score: -0.0 (/) 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 (-) > > Various code seems to expect "default" to be the /last/ item in the list > returned by that function, not the first. For example, this comment in > faces.el: > Can you perhaps clarify what you mean by "that function"? The subject line of your bug report mentions 'font-faces', but no such function exists in Emacs. From unknown Wed Sep 10 20:43:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61521: "default" is now the first item returned from (font-faces), breaking various code. Resent-From: Brennan Vincent Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Feb 2023 01:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61521 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Gregory Heytings Cc: 61521@debbugs.gnu.org Received: via spool by 61521-submit@debbugs.gnu.org id=B61521.16764232412120 (code B ref 61521); Wed, 15 Feb 2023 01:08:02 +0000 Received: (at 61521) by debbugs.gnu.org; 15 Feb 2023 01:07:21 +0000 Received: from localhost ([127.0.0.1]:57421 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pS6GW-0000Y7-Ly for submit@debbugs.gnu.org; Tue, 14 Feb 2023 20:07:20 -0500 Received: from smtp.umanwizard.com ([54.203.248.109]:16926) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pS6GV-0000Xu-20 for 61521@debbugs.gnu.org; Tue, 14 Feb 2023 20:07:19 -0500 Received: from [192.168.1.253] ([70.18.6.196]) by umanwizard.com ; 15 Feb 2023 01:06:55 +0000 X-Fes-Received-For: 61521@debbugs.gnu.org X-Fes-Received-From: Message-ID: <3b75cf10-6125-608c-a506-323ce09846c7@umanwizard.com> Date: Tue, 14 Feb 2023 20:06:51 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Content-Language: en-US References: <7fe5e80d-761f-cc2d-12a1-65b2b5781c39@umanwizard.com> <9e9ed8043f57226204db@heytings.org> From: Brennan Vincent In-Reply-To: <9e9ed8043f57226204db@heytings.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Fes-Encrypted: true X-Fes-Ehlo-Domain: [192.168.1.253] X-Spam-Score: -1.1 (-) 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: -2.1 (--) On 2023-02-14 20:00, Gregory Heytings wrote: > >> >> Various code seems to expect "default" to be the /last/ item in the list >> returned by that function, not the first. For example, this comment in faces.el: >> > > Can you perhaps clarify what you mean by "that function"?  The subject line of > your bug report mentions 'font-faces', but no such function exists in Emacs. > Apologies: I meant to write "face-list". From unknown Wed Sep 10 20:43:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61521: "default" is now the first item returned from (font-faces), breaking various code. Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Feb 2023 09:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61521 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Brennan Vincent Cc: 61521@debbugs.gnu.org Received: via spool by 61521-submit@debbugs.gnu.org id=B61521.167645164718415 (code B ref 61521); Wed, 15 Feb 2023 09:01:02 +0000 Received: (at 61521) by debbugs.gnu.org; 15 Feb 2023 09:00:47 +0000 Received: from localhost ([127.0.0.1]:57745 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSDeh-0004mx-6F for submit@debbugs.gnu.org; Wed, 15 Feb 2023 04:00:47 -0500 Received: from heytings.org ([95.142.160.155]:57676) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSDef-0004mo-RW for 61521@debbugs.gnu.org; Wed, 15 Feb 2023 04:00:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1676451644; bh=SHl242mhQobRE6wgS+yOMDrt/Om2xbAooJMZoJN/Nso=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=3HaoccjGsThWcdfizlVfXx6T9SJYVOYONFR4RGBbxOqUEaqK3UDrh9xwAofTw9c30 0wc+EM+vsDA1IBzP4ApwIYbxUafDibozSY90HxCOKuDbG2BW/kOcEQjVd7+weXrfdi 4N4L+PHomKMt95xzM97hnf2ffd2cD9X19mX/z+03sCzU3pUZkPzzb7h0eIroZYovXZ cywRkTm69VYUVjXifoHalFpejCV4aoVfmkzoIrqsw4WLfWnaOzN75VvkDi9rqo+Zpx mF9BK4HsYkmNnKcxYlF2ajLg2As0HFPLpDPgEqMG/SZmssHFmqdZScA2XIS3lkyY8y m0FYX4LXG8xjg== Date: Wed, 15 Feb 2023 09:00:44 +0000 From: Gregory Heytings In-Reply-To: <3b75cf10-6125-608c-a506-323ce09846c7@umanwizard.com> Message-ID: <9e9ed8043fd479390a2a@heytings.org> References: <7fe5e80d-761f-cc2d-12a1-65b2b5781c39@umanwizard.com> <9e9ed8043f57226204db@heytings.org> <3b75cf10-6125-608c-a506-323ce09846c7@umanwizard.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="w6SvSCzNze" Content-ID: <9e9ed8043f7368284538@heytings.org> X-Spam-Score: -0.0 (/) 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 (-) --w6SvSCzNze Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-ID: <9e9ed8043f126b97f3d5@heytings.org> >>> Various code seems to expect "default" to be the /last/ item in the=20 >>> list returned by that function, not the first. For example, this=20 >>> comment in faces.el: >> >> Can you perhaps clarify what you mean by "that function"?=C2=A0 The subj= ect=20 >> line of your bug report mentions 'font-faces', but no such function=20 >> exists in Emacs. > > Apologies: I meant to write "face-list". > Thanks. It seems the change you describe is not a recent one: the first=20 element of the list returned by 'face-list' is 'default' in Emacs 27, 28,= =20 29 and 30. (This is caused by e3b8ddd500, since which frame faces are=20 stored in a hash table instead of an alist.) Given this, and the fact that the docstring of 'face-list' does not=20 specify the order in which the faces are returned, it's not clear to me=20 that there is a bug here. Code that assumes a given order should probably= =20 be fixed. --w6SvSCzNze-- From unknown Wed Sep 10 20:43:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61521: "default" is now the first item returned from (font-faces), breaking various code. Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Feb 2023 12:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61521 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Brennan Vincent Cc: 61521@debbugs.gnu.org Received: via spool by 61521-submit@debbugs.gnu.org id=B61521.167646590822312 (code B ref 61521); Wed, 15 Feb 2023 12:59:02 +0000 Received: (at 61521) by debbugs.gnu.org; 15 Feb 2023 12:58:28 +0000 Received: from localhost ([127.0.0.1]:58164 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSHMi-0005no-3S for submit@debbugs.gnu.org; Wed, 15 Feb 2023 07:58:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45186) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSHMe-0005nV-SW for 61521@debbugs.gnu.org; Wed, 15 Feb 2023 07:58:26 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSHMZ-0003KC-It; Wed, 15 Feb 2023 07:58:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=UqRsvk0+tQ9Qv3y/YkvVn9rFVhJopwJlZIfiL6vaTng=; b=UzAnLGKNPCYW jyX8zFgorlEsrkumfteQZkCpWptEpAD0c+Dv9GguXdqhkUJMMnalTHUKmrm/Sfx3okCACJjoHj3jf klbom5XiEgXehbUt1VWA+TSui2aetxzns+4jANkDgtNe9qCPErLoalDWxxj7DATLztj3DOyKVQwIB u5zbn+ISP4qNWe5SCzt+08dDtW3kcZHzbZlJFe0iBHvI8eQ0qJOvrlfXxGmop7agAmiMf/cUv0OGB vJUx/LBDom+zSGl4AYE9L+ctHuBBA8HVJPhjnSYMIRYOEoI8CPc6XlZHcYdkAPmXIZwQk9Fd5AgnX 1w0QrPcDApAasza7iWksEQ==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSHMZ-0000UX-1N; Wed, 15 Feb 2023 07:58:19 -0500 Date: Wed, 15 Feb 2023 14:58:00 +0200 Message-Id: <831qmrcch3.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <7fe5e80d-761f-cc2d-12a1-65b2b5781c39@umanwizard.com> (message from Brennan Vincent on Tue, 14 Feb 2023 19:31:30 -0500) References: <7fe5e80d-761f-cc2d-12a1-65b2b5781c39@umanwizard.com> X-Spam-Score: -2.3 (--) 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: -3.3 (---) > Date: Tue, 14 Feb 2023 19:31:30 -0500 > From: Brennan Vincent > > Various code seems to expect "default" to be the /last/ item in the list > returned by that function, not the first. For example, this comment in faces.el: > > ;; The `reverse' is so that `default' goes first. > (dolist (face (nreverse (face-list))) That comment is obsolete and needs to be changed (and the call to nreverse should perhaps be removed). > Also, org-html-htmlize-generate-css does not work when default comes first in > the list (as it skips processing all fonts after default). Isn't that a bug in that Org function? It shouldn't rely on any particular order. From unknown Wed Sep 10 20:43:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61521: "default" is now the first item returned from (font-faces), breaking various code. Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Feb 2023 13:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61521 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Gregory Heytings Cc: brennan@umanwizard.com, 61521@debbugs.gnu.org Received: via spool by 61521-submit@debbugs.gnu.org id=B61521.16764686404201 (code B ref 61521); Wed, 15 Feb 2023 13:44:01 +0000 Received: (at 61521) by debbugs.gnu.org; 15 Feb 2023 13:44:00 +0000 Received: from localhost ([127.0.0.1]:58260 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSI4m-00015h-2O for submit@debbugs.gnu.org; Wed, 15 Feb 2023 08:44:00 -0500 Received: from eggs.gnu.org ([209.51.188.92]:40102) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSI4j-00015P-O7 for 61521@debbugs.gnu.org; Wed, 15 Feb 2023 08:43:58 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSI4e-00019G-EH; Wed, 15 Feb 2023 08:43:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=JBo2FeSl6Z2ofARPqCb687j4nTQkGAyIQKCiLmn7oBU=; b=XhdhHcjxW2gd Tb8WKZz5ASZafnHlXvgfK7WISq0DWGHMNM9z9ohWEn9t4XkK9CyRlLvT4xEjN5BoQTijiwhb12KLH DPR41UiGIiSbemA6jnjCicsZLHjZJ624Zj6OoexZLWL13wZv92guxFplxXUZYreV4yGca5Tkv7CwS rnAzT84fHVQ+LjolmDe3I5RrrzTg/BnHGK7vlhyXreGHVFxFIp1JMymikK8WhFjk5+PNxc0jnZWJX q5P7MiWSkB7aLrFQtw1TVdxyhQ2sWiscQNh32Uv6OozPsP3eK3rQYT09pwIGR3NS582eVRNNzBTNG 9qUeXoAG/6wHjgFv4l7fGg==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSI4d-0001Al-O9; Wed, 15 Feb 2023 08:43:52 -0500 Date: Wed, 15 Feb 2023 15:43:34 +0200 Message-Id: <83ttznavsp.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <9e9ed8043fd479390a2a@heytings.org> (message from Gregory Heytings on Wed, 15 Feb 2023 09:00:44 +0000) References: <7fe5e80d-761f-cc2d-12a1-65b2b5781c39@umanwizard.com> <9e9ed8043f57226204db@heytings.org> <3b75cf10-6125-608c-a506-323ce09846c7@umanwizard.com> <9e9ed8043fd479390a2a@heytings.org> X-Spam-Score: -2.3 (--) 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: -3.3 (---) > Cc: 61521@debbugs.gnu.org > Date: Wed, 15 Feb 2023 09:00:44 +0000 > From: Gregory Heytings > > Thanks. It seems the change you describe is not a recent one: the first > element of the list returned by 'face-list' is 'default' in Emacs 27, 28, > 29 and 30. (This is caused by e3b8ddd500, since which frame faces are > stored in a hash table instead of an alist.) Right. So I wonder whether we should remove the nreverse call in face-set-after-frame-default. WDYT? > Given this, and the fact that the docstring of 'face-list' does not > specify the order in which the faces are returned, it's not clear to me > that there is a bug here. Code that assumes a given order should probably > be fixed. I agree. From unknown Wed Sep 10 20:43:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61521: "default" is now the first item returned from (font-faces), breaking various code. Resent-From: Brennan Vincent Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Feb 2023 14:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61521 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 61521@debbugs.gnu.org Received: via spool by 61521-submit@debbugs.gnu.org id=B61521.167646971915629 (code B ref 61521); Wed, 15 Feb 2023 14:02:01 +0000 Received: (at 61521) by debbugs.gnu.org; 15 Feb 2023 14:01:59 +0000 Received: from localhost ([127.0.0.1]:58307 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSIMB-000441-2x for submit@debbugs.gnu.org; Wed, 15 Feb 2023 09:01:59 -0500 Received: from smtp.umanwizard.com ([54.203.248.109]:35777) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSIM6-00043a-D7 for 61521@debbugs.gnu.org; Wed, 15 Feb 2023 09:01:58 -0500 Received: from smtpclient.apple ([70.18.6.196]) by umanwizard.com ; 15 Feb 2023 14:01:45 +0000 X-Fes-Received-For: 61521@debbugs.gnu.org X-Fes-Received-From: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Brennan Vincent Mime-Version: 1.0 (1.0) Date: Wed, 15 Feb 2023 09:01:31 -0500 Message-Id: <2485DA7C-3614-4182-BC29-7EFCF5C86A45@umanwizard.com> References: <831qmrcch3.fsf@gnu.org> In-Reply-To: <831qmrcch3.fsf@gnu.org> X-Mailer: iPhone Mail (20D67) X-Fes-Encrypted: true X-Fes-Ehlo-Domain: smtpclient.apple X-Spam-Score: -0.0 (/) 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 (-) > On Feb 15, 2023, at 07:58, Eli Zaretskii wrote: >=20 > =EF=BB=BF >>=20 >> Date: Tue, 14 Feb 2023 19:31:30 -0500 >> From: Brennan Vincent >>=20 >> Various code seems to expect "default" to be the /last/ item in the list >> returned by that function, not the first. For example, this comment in fa= ces.el: >>=20 >> ;; The `reverse' is so that `default' goes first. >> (dolist (face (nreverse (face-list))) >=20 > That comment is obsolete and needs to be changed (and the call to > nreverse should perhaps be removed). If the order returned by face-list is not guaranteed, then why does it do so= rting at all? >> Also, org-html-htmlize-generate-css does not work when default comes firs= t in >> the list (as it skips processing all fonts after default). >=20 > Isn't that a bug in that Org function? It shouldn't rely on any > particular order. In that case, we can consider this bug report to relate to the broken Org fu= nction, which is how I initially discovered the face-list issue.= From unknown Wed Sep 10 20:43:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61521: "default" is now the first item returned from (font-faces), breaking various code. Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Feb 2023 14:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61521 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: brennan@umanwizard.com, 61521@debbugs.gnu.org Received: via spool by 61521-submit@debbugs.gnu.org id=B61521.167647031916729 (code B ref 61521); Wed, 15 Feb 2023 14:12:01 +0000 Received: (at 61521) by debbugs.gnu.org; 15 Feb 2023 14:11:59 +0000 Received: from localhost ([127.0.0.1]:58334 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSIVr-0004Ll-BA for submit@debbugs.gnu.org; Wed, 15 Feb 2023 09:11:59 -0500 Received: from heytings.org ([95.142.160.155]:58116) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSIVo-0004LZ-No for 61521@debbugs.gnu.org; Wed, 15 Feb 2023 09:11:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1676470315; bh=xoK4NmLStQKG/MDA2z/KgK8YGpYzPdWj7kDR16+F7gY=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=5ZVDVNyhMl7EDUsfoR3kwTIESnEgAyPVHjQon4zQ/GxLupfWUOhF3SdFrf+e3U1Et 67JYoG/vJVzczlPNLbb62lBxQEWZw64k91S1wfB0JTws+NX3fFE0fH9WaAvIg9KBJW vUPf0cdLumMPy3GimxPq7sShZvhGoDuhaoYV/8dEteBx5lrj1TD4vNzpO2qcuwA9uz emIN0RzLhl5dRCZJFKqCi2Wq4Us7dihEkE2FqvPEccLBUlnNwGETQrxXFjgxybFLPr qr7wHJIJvJamYFJEPH8kx+Oira7m6ExQbfhr72v2mXVa7XuiRX9FCXnok2p6v4twgd 2ft28VJtQ36yg== Date: Wed, 15 Feb 2023 14:11:55 +0000 From: Gregory Heytings In-Reply-To: <83ttznavsp.fsf@gnu.org> Message-ID: <9e9ed8043fd6413e6183@heytings.org> References: <7fe5e80d-761f-cc2d-12a1-65b2b5781c39@umanwizard.com> <9e9ed8043f57226204db@heytings.org> <3b75cf10-6125-608c-a506-323ce09846c7@umanwizard.com> <9e9ed8043fd479390a2a@heytings.org> <83ttznavsp.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii X-Spam-Score: -0.0 (/) 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 (-) >> Thanks. It seems the change you describe is not a recent one: the >> first element of the list returned by 'face-list' is 'default' in Emacs >> 27, 28, 29 and 30. (This is caused by e3b8ddd500, since which frame >> faces are stored in a hash table instead of an alist.) > > Right. So I wonder whether we should remove the nreverse call in > face-set-after-frame-default. WDYT? > There are three occurrences of '(nreverse (face-list))': one in facemenu-complete-face-list, which seems to date from the 1990s, one in x-create-frame-with-faces, which was added by e3b8ddd500 "to handle subtle semantic change to how frame faces propagate, which otherwise breaks frame creation with reverse video enabled (bug#41200)", and the third one in 'face-set-after-frame-default'. The comment there is definitely outdated and should be removed, but given that '(nreverse (face-list))' is placed in a dolist whose body starts with '(face-spec-recalc face frame)', like in x-create-frame-with-faces, I'm not sure the nreverse can be removed without introducing a subtle bug. It is probably safer to leave the code unchanged. From unknown Wed Sep 10 20:43:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61521: "default" is now the first item returned from (font-faces), breaking various code. Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Feb 2023 14:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61521 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Brennan Vincent Cc: Eli Zaretskii , 61521@debbugs.gnu.org Received: via spool by 61521-submit@debbugs.gnu.org id=B61521.167647079817612 (code B ref 61521); Wed, 15 Feb 2023 14:20:02 +0000 Received: (at 61521) by debbugs.gnu.org; 15 Feb 2023 14:19:58 +0000 Received: from localhost ([127.0.0.1]:58354 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSIdZ-0004Zz-QI for submit@debbugs.gnu.org; Wed, 15 Feb 2023 09:19:58 -0500 Received: from heytings.org ([95.142.160.155]:58148) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSIdY-0004Zq-MN for 61521@debbugs.gnu.org; Wed, 15 Feb 2023 09:19:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1676470795; bh=OV+Yf9vIqLBgf7rshMf3zPDDHlCAOCgl3jhWUm+Jp4w=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=OYVp01cLLaqSwBF5pvIKaus5yyjNjbkpP+dK9Y33xGaeYGLR64xVU13BTuyRkA9jV 1NJg1fjbNgYPWG0/6n13WL5nIXXnqhmAjIInyqNK6CygNBJA78g9wpubVlLC4dTb1/ XRibrUfXuklsSFxhKxGf/Yn72RLy3b+zO/eCYxhC/ck2ryjihrxT+HaEI/KGPQ3vh1 zD/h8IkzsKSXEurDGkEeyue9eJ2zNfUt+jGzmiPxnEL785OBl0s75V8628llavZAdx wMZP4YTvRja2+NJZ4vnSxl5vLf05bvp8BEjQnplZyR8ztCxdWO80wr1TUg/u47P1qH S/g7HM2hZqslw== Date: Wed, 15 Feb 2023 14:19:55 +0000 From: Gregory Heytings In-Reply-To: <2485DA7C-3614-4182-BC29-7EFCF5C86A45@umanwizard.com> Message-ID: <9e9ed8043fb165a7be40@heytings.org> References: <831qmrcch3.fsf@gnu.org> <2485DA7C-3614-4182-BC29-7EFCF5C86A45@umanwizard.com> MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii X-Spam-Score: -0.0 (/) 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 (-) >> That comment is obsolete and needs to be changed (and the call to >> nreverse should perhaps be removed). > > If the order returned by face-list is not guaranteed, then why does it > do sorting at all? > Note that the sorting was added recently, in e3b8ddd500. Before that there was no sorting, it just happened that 'default' was the last element of that alist. It's not clear to me why the sorting is there, apparently it was added to fix bug#41200. From unknown Wed Sep 10 20:43:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61521: "default" is now the first item returned from (font-faces), breaking various code. Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Feb 2023 14:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61521 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Brennan Vincent Cc: 61521@debbugs.gnu.org Received: via spool by 61521-submit@debbugs.gnu.org id=B61521.167647111318198 (code B ref 61521); Wed, 15 Feb 2023 14:26:01 +0000 Received: (at 61521) by debbugs.gnu.org; 15 Feb 2023 14:25:13 +0000 Received: from localhost ([127.0.0.1]:58366 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSIie-0004jR-S6 for submit@debbugs.gnu.org; Wed, 15 Feb 2023 09:25:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51442) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSIid-0004jA-Bw for 61521@debbugs.gnu.org; Wed, 15 Feb 2023 09:25:11 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSIiX-0003m2-OL; Wed, 15 Feb 2023 09:25:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=tEyw0UIBBd2m5wSLRzI+oeB5CfGm4mwY0tpClh+nAPA=; b=YnB0oodqEnCdIXm7++cP iUZ2lCbAZwqaGaQ4r30s4478QXAb4M1/cpRdI07m/p6HZEMTSWucUcmNPV+1dwv73vvBaCodE8zqv +lvGF+nFIBPPUk+GHACBu60tozoEpzu4VPksOl5bGwJbJcv2a1Pxi6WSIIo2VOV+7+O3TEOLxoPB9 WVu3RuhakPvpW1ymnBnYHPXMwWnlQyzuW68Cf8XSCOGt9+vjQrhgEm6Mqc/WAqJr/IPbVemqRb4FJ qb5gbafJPg7nAAIAjFfoemOyyA0UWo1Xg4ubGyMiM6yW4jtbhURUu0/a5bXYDcVL06qeyBpfq6Kn+ 22Gs+wf/5pU9EQ==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSIiW-0001It-TR; Wed, 15 Feb 2023 09:25:05 -0500 Date: Wed, 15 Feb 2023 16:24:46 +0200 Message-Id: <83cz6batw1.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <2485DA7C-3614-4182-BC29-7EFCF5C86A45@umanwizard.com> (message from Brennan Vincent on Wed, 15 Feb 2023 09:01:31 -0500) References: <831qmrcch3.fsf@gnu.org> <2485DA7C-3614-4182-BC29-7EFCF5C86A45@umanwizard.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) 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: -3.3 (---) > From: Brennan Vincent > Date: Wed, 15 Feb 2023 09:01:31 -0500 > Cc: 61521@debbugs.gnu.org > > > On Feb 15, 2023, at 07:58, Eli Zaretskii wrote: > > > >  > >> > >> Date: Tue, 14 Feb 2023 19:31:30 -0500 > >> From: Brennan Vincent > >> > >> Various code seems to expect "default" to be the /last/ item in the list > >> returned by that function, not the first. For example, this comment in faces.el: > >> > >> ;; The `reverse' is so that `default' goes first. > >> (dolist (face (nreverse (face-list))) > > > > That comment is obsolete and needs to be changed (and the call to > > nreverse should perhaps be removed). > > If the order returned by face-list is not guaranteed, then why does it do sorting at all? Good question. AFAICT, the sorting was added when we switched from storing faces in alists to storing them in hash tables. It probably sorted faces to be more compatible with what face-list returned before the switch to hash table. So I suspect the order we have now is simply a bug, and we do need to change the order of sorting to get back the original order. Gregory, any counter-arguments? From unknown Wed Sep 10 20:43:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61521: "default" is now the first item returned from (font-faces), breaking various code. Resent-From: Brennan Vincent Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Feb 2023 16:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61521 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 61521@debbugs.gnu.org Received: via spool by 61521-submit@debbugs.gnu.org id=B61521.16764780112956 (code B ref 61521); Wed, 15 Feb 2023 16:21:02 +0000 Received: (at 61521) by debbugs.gnu.org; 15 Feb 2023 16:20:11 +0000 Received: from localhost ([127.0.0.1]:33735 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSKVv-0000lc-2V for submit@debbugs.gnu.org; Wed, 15 Feb 2023 11:20:11 -0500 Received: from smtp.umanwizard.com ([54.203.248.109]:51387) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSKVr-0000kz-Aq for 61521@debbugs.gnu.org; Wed, 15 Feb 2023 11:20:10 -0500 Received: from [10.10.1.60] ([173.205.212.102]) by umanwizard.com ; 15 Feb 2023 16:19:57 +0000 X-Fes-Received-For: 61521@debbugs.gnu.org X-Fes-Received-From: Message-ID: <05d313ea-7355-189f-62b0-1ba439ff0acf@umanwizard.com> Date: Wed, 15 Feb 2023 11:19:54 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 References: <831qmrcch3.fsf@gnu.org> <2485DA7C-3614-4182-BC29-7EFCF5C86A45@umanwizard.com> <83cz6batw1.fsf@gnu.org> Content-Language: en-US From: Brennan Vincent In-Reply-To: <83cz6batw1.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Fes-Encrypted: true X-Fes-Ehlo-Domain: [10.10.1.60] X-Spam-Score: -1.1 (-) 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: -2.1 (--) On 2023-02-15 09:24, Eli Zaretskii wrote: >> From: Brennan Vincent >> Date: Wed, 15 Feb 2023 09:01:31 -0500 >> Cc: 61521@debbugs.gnu.org >> >>> On Feb 15, 2023, at 07:58, Eli Zaretskii wrote: >>> >>>  >>>> >>>> Date: Tue, 14 Feb 2023 19:31:30 -0500 >>>> From: Brennan Vincent >>>> >>>> Various code seems to expect "default" to be the /last/ item in the list >>>> returned by that function, not the first. For example, this comment in faces.el: >>>> >>>> ;; The `reverse' is so that `default' goes first. >>>> (dolist (face (nreverse (face-list))) >>> >>> That comment is obsolete and needs to be changed (and the call to >>> nreverse should perhaps be removed). >> >> If the order returned by face-list is not guaranteed, then why does it do sorting at all? > > Good question. AFAICT, the sorting was added when we switched from > storing faces in alists to storing them in hash tables. It probably > sorted faces to be more compatible with what face-list returned before > the switch to hash table. So I suspect the order we have now is > simply a bug, and we do need to change the order of sorting to get > back the original order. I tend to agree. Sorry for not explaining this reasoning more fully in my original message. Here's what I suspect happened (not 100% sure, it's just a theory): (1) Initially set of faces was stored as a list, so it was naturally maintained in the inverse order that things were added to it (thus default would be at the end). (2) Now faces are stored in a hash table whose key is the face and whose value contains various pieces of data, including the face ID. (3) This face ID is allocated in increasing order (see e.g. this code in xfaces.c: Lisp_Object face_id = make_fixnum (next_lface_id); lface_id_to_name[next_lface_id] = face; Fput (face, Qface, face_id); ++next_lface_id; (4) Thus, `face-list` and `frame-face-alist` sorted the faces by face ID in order to maintain the old ordering behavior. However, the author accidentally inverted the comparison when doing so. > Gregory, any counter-arguments? From unknown Wed Sep 10 20:43:05 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Brennan Vincent Subject: bug#61521: closed (Re: bug#61521: "default" is now the first item returned from (font-faces), breaking various code.) Message-ID: References: <83pma81yq4.fsf@gnu.org> <7fe5e80d-761f-cc2d-12a1-65b2b5781c39@umanwizard.com> X-Gnu-PR-Message: they-closed 61521 X-Gnu-PR-Package: emacs Reply-To: 61521@debbugs.gnu.org Date: Fri, 17 Feb 2023 08:30:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1676622603-26329-1" This is a multi-part message in MIME format... ------------=_1676622603-26329-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #61521: "default" is now the first item returned from (font-faces), breakin= g various code. 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 61521@debbugs.gnu.org. --=20 61521: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D61521 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1676622603-26329-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 61521-done) by debbugs.gnu.org; 17 Feb 2023 08:29:47 +0000 Received: from localhost ([127.0.0.1]:38411 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSw7m-0006ps-SQ for submit@debbugs.gnu.org; Fri, 17 Feb 2023 03:29:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36982) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSw7l-0006pf-BZ for 61521-done@debbugs.gnu.org; Fri, 17 Feb 2023 03:29:45 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSw7f-0006Jf-S9; Fri, 17 Feb 2023 03:29:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=ynDnIMrLltS1ETM/gbYtIJ7GbEJyZ2TxGrzh/V6VqZE=; b=B8m5fwm4m1q4 fnaG56bBSG5GsViwu1NtVtNK9Xgfb3sNfl5FF5hPotP2DYobO0cC6HX9QnN9UAH7jcvx/oF3pOJoi lz35dQVviSV2l5NGUvP/H3aZ1xLRDoCjEX1D8pv/QoEpyCid4pi1w2SXIoXm5UTiz15Bu4Ko5Sk5i ZqyGVDjnmksMEkCdQEP4KilwH9P/f16q3awJdqUbipIFE59RZxRv5DmsXWVS9vXNClXSpzk6zG3Oa EBEG5lZtddd7Zmt8DeCSwPHzpgaXacoYNvcAvGz48xa+fLtKVw/CnCfGKTXyFK2SO/G3CFqv4fNwV 56qmD4028xb0q+OUTNqzNg==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSw7f-000555-CX; Fri, 17 Feb 2023 03:29:39 -0500 Date: Fri, 17 Feb 2023 10:29:39 +0200 Message-Id: <83pma81yq4.fsf@gnu.org> From: Eli Zaretskii To: Brennan Vincent In-Reply-To: <05d313ea-7355-189f-62b0-1ba439ff0acf@umanwizard.com> (message from Brennan Vincent on Wed, 15 Feb 2023 11:19:54 -0500) Subject: Re: bug#61521: "default" is now the first item returned from (font-faces), breaking various code. References: <831qmrcch3.fsf@gnu.org> <2485DA7C-3614-4182-BC29-7EFCF5C86A45@umanwizard.com> <83cz6batw1.fsf@gnu.org> <05d313ea-7355-189f-62b0-1ba439ff0acf@umanwizard.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61521-done Cc: 61521-done@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: -3.3 (---) > Date: Wed, 15 Feb 2023 11:19:54 -0500 > Cc: 61521@debbugs.gnu.org > From: Brennan Vincent > > > Good question. AFAICT, the sorting was added when we switched from > > storing faces in alists to storing them in hash tables. It probably > > sorted faces to be more compatible with what face-list returned before > > the switch to hash table. So I suspect the order we have now is > > simply a bug, and we do need to change the order of sorting to get > > back the original order. > > I tend to agree. Sorry for not explaining this reasoning more fully in my > original message. > > Here's what I suspect happened (not 100% sure, it's just a theory): > > (1) Initially set of faces was stored as a list, so it was naturally maintained > in the inverse order that things were added to it (thus default would be at the > end). > > (2) Now faces are stored in a hash table whose key is the face and whose value > contains various pieces of data, including the face ID. > > (3) This face ID is allocated in increasing order (see e.g. this code in xfaces.c: > Lisp_Object face_id = make_fixnum (next_lface_id); > lface_id_to_name[next_lface_id] = face; > Fput (face, Qface, face_id); > ++next_lface_id; > > (4) Thus, `face-list` and `frame-face-alist` sorted the faces by face ID in > order to maintain the old ordering behavior. However, the author accidentally > inverted the comparison when doing so. > > > > Gregory, any counter-arguments? No further comments, so I've now installed the proposed changes on the emacs-29 branch, and I'm boldly closing this bug as done. ------------=_1676622603-26329-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 15 Feb 2023 00:31:43 +0000 Received: from localhost ([127.0.0.1]:57401 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pS5i3-0007yw-8h for submit@debbugs.gnu.org; Tue, 14 Feb 2023 19:31:43 -0500 Received: from lists.gnu.org ([209.51.188.17]:34246) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pS5i1-0007yo-Fo for submit@debbugs.gnu.org; Tue, 14 Feb 2023 19:31:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pS5i1-00085b-7D for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2023 19:31:41 -0500 Received: from smtp.umanwizard.com ([54.203.248.109]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pS5hx-0006n4-CH for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2023 19:31:40 -0500 Received: from [192.168.1.253] ([70.18.6.196]) by umanwizard.com ; 15 Feb 2023 00:31:33 +0000 X-Fes-Received-For: bug-gnu-emacs@gnu.org X-Fes-Received-From: Message-ID: <7fe5e80d-761f-cc2d-12a1-65b2b5781c39@umanwizard.com> Date: Tue, 14 Feb 2023 19:31:30 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Content-Language: en-US To: bug-gnu-emacs@gnu.org From: Brennan Vincent Subject: "default" is now the first item returned from (font-faces), breaking various code. Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Fes-Encrypted: true X-Fes-Ehlo-Domain: [192.168.1.253] Received-SPF: pass client-ip=54.203.248.109; envelope-from=brennan@umanwizard.com; helo=smtp.umanwizard.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) 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: -2.4 (--) Various code seems to expect "default" to be the /last/ item in the list returned by that function, not the first. For example, this comment in faces.el: ;; The `reverse' is so that `default' goes first. (dolist (face (nreverse (face-list))) Also, org-html-htmlize-generate-css does not work when default comes first in the list (as it skips processing all fonts after default). I am not sure why this was changed and if the change was intentional, but it can be fixed by changing the "<" to a ">" in the last line of face-list, so I suspect it might have been a mistake. diff --git lisp/faces.el lisp/faces.el index 4933b495a6c..e998dc504e5 100644 --- lisp/faces.el +++ lisp/faces.el @@ -199,7 +199,7 @@ face-list (maphash (lambda (face spec) (push `(,(car spec) . ,face) faces)) face--new-frame-defaults) - (mapcar #'cdr (sort faces (lambda (f1 f2) (< (car f1) (car f2))))))) + (mapcar #'cdr (sort faces (lambda (f1 f2) (> (car f1) (car f2))))))) (defun make-face (face) "Define a new face with name FACE, a symbol. ------------=_1676622603-26329-1-- From unknown Wed Sep 10 20:43:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61521: "default" is now the first item returned from (font-faces), breaking various code. Resent-From: Kai Ma Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 17 Feb 2023 22:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61521 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Gregory Heytings Cc: brennan@umanwizard.com, Eli Zaretskii , 61521@debbugs.gnu.org Received: via spool by 61521-submit@debbugs.gnu.org id=B61521.167667225915578 (code B ref 61521); Fri, 17 Feb 2023 22:18:02 +0000 Received: (at 61521) by debbugs.gnu.org; 17 Feb 2023 22:17:39 +0000 Received: from localhost ([127.0.0.1]:41796 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pT92x-00043C-9D for submit@debbugs.gnu.org; Fri, 17 Feb 2023 17:17:39 -0500 Received: from mail-pj1-f66.google.com ([209.85.216.66]:42817) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pT92v-00042z-BW for 61521@debbugs.gnu.org; Fri, 17 Feb 2023 17:17:37 -0500 Received: by mail-pj1-f66.google.com with SMTP id i10-20020a17090a7e0a00b002341a2656e5so2639168pjl.1 for <61521@debbugs.gnu.org>; Fri, 17 Feb 2023 14:17:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=KEnm0GClWGhF9APcRHt6r49/2TsVxCfhDGrTAxGq01I=; b=eqsWtEVIEcZUc+oyKnIMKONnbiKMFTod7nuoJ8XzJYWSyXkZSi2o5Yq1v3z4bA/gVa mmkHxKnAh1zRXKZs1giw5JE4ctMsJyBXI7eCIeBTm4MXaFMFyrhKb8Pgsdp+LQMDK408 2wvSjAK1fhU4ekwllaFu3cBtr+FBg2h6pVb/2I6hylTDTsu0zKLFHsuk7NSbkpsRNrq7 lJRGrspphd/55s4lc1cUSES6XiCr10sBtU4onYs/Mbz1l8cnnONXBEWsPIsIEFQPyiHa 9AMXNLJl+3C37BVEXivixDRVBT5++aSFcq0VZpWHveSOD4fSVYPoL6amWqnCDFBdSKTS wsHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=KEnm0GClWGhF9APcRHt6r49/2TsVxCfhDGrTAxGq01I=; b=QRt/7dJy3qtyUPcq+OcsTfdZOmY+CvROU7j+lH5WICbI2SnlSMP4CwwuNvxjRl7gNl 2zO2FNlrEnurIFic/b/hM93+9il/4VKQoSz1GZpd9PfTGtyEfPlXJMZClf+Hsi8quvU7 h86THrxkOn6AF/6JO9yxPNUYwF/Cbms2JovQOdxMmtBxKR5cMagTs/pjCS9mm+7fXQ2H yxUNcc0q6dGoTf1nyBIjIcwN48Ez7YVshhJExrpnd1o8c4hQKhhrmU40bm3hASzx/0p9 iBt7A4KGl6s+v7keVYRynuhQRPWMk9asYZhZPtpwD1vFSfc/Z54QLLniVM1qRBPyaUr4 JSlQ== X-Gm-Message-State: AO0yUKX3iU51e6HCDGIJ7VqcKwFZRNTNZtyaTPT2wybFUd7Kc0OulI3V /T+D+fFi8RvUwPZWin+nRsfYUPhtgAnoNTc32Ko= X-Google-Smtp-Source: AK7set8CYfCpV0BEg4GRFXFCMVYxz7E92htlNTmYsCE8ef4ul5x8/O4xml6dmjsh6ru0w8P9uUuJdQ== X-Received: by 2002:a05:6a20:914a:b0:bf:3def:16cd with SMTP id x10-20020a056a20914a00b000bf3def16cdmr622574pzc.59.1676672250483; Fri, 17 Feb 2023 14:17:30 -0800 (PST) Received: from Kais-MacBook.local ([134.209.106.31]) by smtp.gmail.com with ESMTPSA id d7-20020a656207000000b004fadb547d0csm3168824pgv.61.2023.02.17.14.17.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Feb 2023 14:17:29 -0800 (PST) From: Kai Ma In-Reply-To: <9e9ed8043fd6413e6183@heytings.org> (Gregory Heytings's message of "Wed, 15 Feb 2023 14:11:55 +0000") References: <7fe5e80d-761f-cc2d-12a1-65b2b5781c39@umanwizard.com> <9e9ed8043f57226204db@heytings.org> <3b75cf10-6125-608c-a506-323ce09846c7@umanwizard.com> <9e9ed8043fd479390a2a@heytings.org> <83ttznavsp.fsf@gnu.org> <9e9ed8043fd6413e6183@heytings.org> User-Agent: Gnus/5.13 (Gnus v5.13) Date: Sat, 18 Feb 2023 06:17:25 +0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.5 (/) 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.5 (/) Gregory Heytings writes: >>> Thanks. It seems the change you describe is not a recent one: the >>> first element of the list returned by 'face-list' is 'default' in >>> Emacs 27, 28, 29 and 30. (This is caused by e3b8ddd500, since >>> which frame faces are stored in a hash table instead of an alist.) >> >> Right. So I wonder whether we should remove the nreverse call in >> face-set-after-frame-default. WDYT? >> > > There are three occurrences of '(nreverse (face-list))': one in > facemenu-complete-face-list, which seems to date from the 1990s, one > in x-create-frame-with-faces, which was added by e3b8ddd500 "to handle > subtle semantic change to how frame faces propagate, which otherwise > breaks frame creation with reverse video enabled (bug#41200)", and the > third one in 'face-set-after-frame-default'. > > The comment there is definitely outdated and should be removed, but > given that '(nreverse (face-list))' is placed in a dolist whose body > starts with '(face-spec-recalc face frame)', like in > x-create-frame-with-faces, I'm not sure the nreverse can be removed > without introducing a subtle bug. It is probably safer to leave the > code unchanged. My config becomes broken after pulling this change: the child frame of vertico-posframe does not appear under certain themes, and signals errors like: Error in post-command-hook (vertico--exhibit): (error "Invalid face" consult-separator) Error in post-command-hook (vertico--exhibit): (error "Invalid face" hl-todo) I'm not sure if this is a downstream issue, but this problem can be solved by either reverting this commit or removing the nreverse in x-create-frame-with-faces: diff --git a/lisp/faces.el b/lisp/faces.el index 4933b495a6c..e91107e98cc 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -2226,7 +2226,7 @@ x-create-frame-with-faces (unwind-protect (progn (x-setup-function-keys frame) - (dolist (face (nreverse (face-list))) + (dolist (face (face-list))) (face-spec-recalc face frame)) (x-handle-reverse-video frame parameters) (frame-set-background-mode frame t) This piece of code (w/ nreverse) was written as part of the hash table rewrite, and at that time (face-list) did not sort its results. I don't know why nreverse is significant here though. From unknown Wed Sep 10 20:43:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61521: "default" is now the first item returned from (font-faces), breaking various code. Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Feb 2023 06:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61521 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Kai Ma Cc: brennan@umanwizard.com, gregory@heytings.org, 61521@debbugs.gnu.org Received: via spool by 61521-submit@debbugs.gnu.org id=B61521.16767029765005 (code B ref 61521); Sat, 18 Feb 2023 06:50:02 +0000 Received: (at 61521) by debbugs.gnu.org; 18 Feb 2023 06:49:36 +0000 Received: from localhost ([127.0.0.1]:42241 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pTH2O-0001If-8e for submit@debbugs.gnu.org; Sat, 18 Feb 2023 01:49:36 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56140) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pTH2M-0001IS-Q4 for 61521@debbugs.gnu.org; Sat, 18 Feb 2023 01:49:35 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pTH2H-0008LP-2G; Sat, 18 Feb 2023 01:49:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=0/CkIMGPtEmFmOIeMFKB6AmoDIXy/ztYC9hWV0vCF78=; b=X6XY/ZuvQm4v mDg8KPyxHOtSSKJ/1BAyk+CclcBxnXExHyuB4nwYADj/RJ+yXWQ07jLwAxeKm5dDN33UbbYpXXObQ 6GADZvcD1lfoTFPJqNEj5wcRc77sYU+fc74JCz8KEVG87plQrxxZmiDgwtruSCxbEbEdntQghw6Q8 XASbST2bt5VpBGZ6HbwebIVwlDHYDrZeoVQ0S/ZjzfGiI3TZRBxQfGQZNorN4nqrUySWmiWFCpFm2 d+bxUawH6sGS7KmeFmXmbr8yKGWXkmGMTnLeIEJdZXpSqZF+rEepSITdrhd2cxEV85/b5qUub/K7K DAIlT8V1PNkmeUeenrgdUg==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pTH2G-0008QY-Cv; Sat, 18 Feb 2023 01:49:28 -0500 Date: Sat, 18 Feb 2023 08:49:29 +0200 Message-Id: <83y1ovzcw6.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Kai Ma on Sat, 18 Feb 2023 06:17:25 +0800) References: <7fe5e80d-761f-cc2d-12a1-65b2b5781c39@umanwizard.com> <9e9ed8043f57226204db@heytings.org> <3b75cf10-6125-608c-a506-323ce09846c7@umanwizard.com> <9e9ed8043fd479390a2a@heytings.org> <83ttznavsp.fsf@gnu.org> <9e9ed8043fd6413e6183@heytings.org> X-Spam-Score: -2.3 (--) 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: -3.3 (---) > From: Kai Ma > Cc: Eli Zaretskii , brennan@umanwizard.com, > 61521@debbugs.gnu.org > Date: Sat, 18 Feb 2023 06:17:25 +0800 > > My config becomes broken after pulling this change: the child frame of > vertico-posframe does not appear under certain themes, and signals > errors like: > > Error in post-command-hook (vertico--exhibit): (error "Invalid face" consult-separator) > Error in post-command-hook (vertico--exhibit): (error "Invalid face" hl-todo) > > I'm not sure if this is a downstream issue, but this problem can be > solved by either reverting this commit or removing the nreverse in > x-create-frame-with-faces: > > diff --git a/lisp/faces.el b/lisp/faces.el > index 4933b495a6c..e91107e98cc 100644 > --- a/lisp/faces.el > +++ b/lisp/faces.el > @@ -2226,7 +2226,7 @@ x-create-frame-with-faces > (unwind-protect > (progn > (x-setup-function-keys frame) > - (dolist (face (nreverse (face-list))) > + (dolist (face (face-list))) > (face-spec-recalc face frame)) > (x-handle-reverse-video frame parameters) > (frame-set-background-mode frame t) > > This piece of code (w/ nreverse) was written as part of the hash table > rewrite, and at that time (face-list) did not sort its results. I don't > know why nreverse is significant here though. Which change are you talking about? Please clarify. The original problem was solved recently on the emacs-29 branch by reversing the order in which face-list sorts the faces, to make it similar to what we had before the hash table rewrite. So there should be no reason to change any other code anywhere else. Thanks. From unknown Wed Sep 10 20:43:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61521: "default" is now the first item returned from (font-faces), breaking various code. Resent-From: Kai Ma Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Feb 2023 06:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61521 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: brennan@umanwizard.com, gregory@heytings.org, 61521@debbugs.gnu.org Received: via spool by 61521-submit@debbugs.gnu.org id=B61521.16767032765467 (code B ref 61521); Sat, 18 Feb 2023 06:55:01 +0000 Received: (at 61521) by debbugs.gnu.org; 18 Feb 2023 06:54:36 +0000 Received: from localhost ([127.0.0.1]:42246 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pTH7E-0001Q6-0j for submit@debbugs.gnu.org; Sat, 18 Feb 2023 01:54:36 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:38531) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pTH7B-0001Pt-JQ for 61521@debbugs.gnu.org; Sat, 18 Feb 2023 01:54:34 -0500 Received: by mail-pf1-f193.google.com with SMTP id j1so3667pfu.5 for <61521@debbugs.gnu.org>; Fri, 17 Feb 2023 22:54:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=K6VJWRhDicVGTdKimcEPea8P9ku1fF2jbDbX4tG+NUs=; b=dm3MUZTHE3WyryZ1/WkdcykgB2MikE/go+4WdFvohnZZ2rakt//K2V4FjHsariNl8r I1LgDkJlwGsI+rvfSRmIO8P7BtrvWGan9h3AbySN6lYY7K4lZDbZ+vooKpjtB4pWg2k+ hXThEB+QFmTkk/4B5brrAni9vJ6ds9kLo2d5ywHsQ9nZuwYJ0niMgdz6O0onG+WIz+4t Q65EHk5hot8O3rYJnXomU0C54BXAIHjK1fVzOgOxcGu84hIM5doIiJjVsTLwBekA+3eO KSKzWp4TpQQ0s5QjnWtEO+mt9iLRN9XtXA6wqH9tk+L1RBQBf1RQkfc4nALDRxfhm3H9 xM4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=K6VJWRhDicVGTdKimcEPea8P9ku1fF2jbDbX4tG+NUs=; b=Z1H6lbq4vdMxRhAsHhxUzsIjRmyuarozVWakyyY+srp6udywDjZ+k9/qNyh3hHb2Ce NDf8RSXlPdSBCMzw2GhGbGebWFxTAYC0j9ofMMNeOeHo5wuYW1gAPNi554+YmA3mPxwf tRBeJyIUIKIBnDux/cyiz8zksYsl+eGE6nSVWjaLpDTimo4NI/zjZ90Fm19HLpOC0aSe tZ2juahmK7356Lp1RGq/bSav/ep4i8clDAoOT+au5woES4aRVl7TdbpZUNfioQp0P/Gk AVCvYAq0utmYIaP4+Z7qhnUtY5GgSgAskpizJ9iRNAna7Q5PbngZR3hZe42VG9EVMhpQ xQHA== X-Gm-Message-State: AO0yUKVL81GJCcLLyYgp1xJ6LJ4+jruzdApjxhE0eQtDVQTlys7j91CG oLT3S/JMkiSNcKJ1WNqTqjQ= X-Google-Smtp-Source: AK7set8qErsoGuq7l+JvEjvMrPQzAzW0wu+SemdKmFiyVtF9MTsBilk8WzfTlteXvSV+4ADEJ+jM1A== X-Received: by 2002:a62:31c7:0:b0:5a9:d734:7d2 with SMTP id x190-20020a6231c7000000b005a9d73407d2mr3907322pfx.32.1676703267355; Fri, 17 Feb 2023 22:54:27 -0800 (PST) Received: from smtpclient.apple (36-238-6-26.dynamic-ip.hinet.net. [36.238.6.26]) by smtp.gmail.com with ESMTPSA id m9-20020aa78a09000000b005a8ae0c52cfsm2436349pfa.16.2023.02.17.22.54.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Feb 2023 22:54:26 -0800 (PST) From: Kai Ma Message-Id: <24615FB3-774C-4D53-A72B-4FFF53E22EAF@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_5AAC2BF3-95CD-4629-9510-2DA594B03449" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.101.1.3\)) Date: Sat, 18 Feb 2023 14:54:12 +0800 In-Reply-To: <83y1ovzcw6.fsf@gnu.org> References: <7fe5e80d-761f-cc2d-12a1-65b2b5781c39@umanwizard.com> <9e9ed8043f57226204db@heytings.org> <3b75cf10-6125-608c-a506-323ce09846c7@umanwizard.com> <9e9ed8043fd479390a2a@heytings.org> <83ttznavsp.fsf@gnu.org> <9e9ed8043fd6413e6183@heytings.org> <83y1ovzcw6.fsf@gnu.org> X-Mailer: Apple Mail (2.3731.300.101.1.3) X-Spam-Score: 0.5 (/) 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.5 (/) --Apple-Mail=_5AAC2BF3-95CD-4629-9510-2DA594B03449 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Feb 18, 2023, at 14:49, Eli Zaretskii wrote: >=20 >> From: Kai Ma > >> Cc: Eli Zaretskii >, = brennan@umanwizard.com , >> 61521@debbugs.gnu.org >> Date: Sat, 18 Feb 2023 06:17:25 +0800 >>=20 >> My config becomes broken after pulling this change: the child frame = of >> vertico-posframe does not appear under certain themes, and signals >> errors like: >>=20 >> Error in post-command-hook (vertico--exhibit): (error "Invalid face" = consult-separator) >> Error in post-command-hook (vertico--exhibit): (error "Invalid face" = hl-todo) >>=20 >> I'm not sure if this is a downstream issue, but this problem can be >> solved by either reverting this commit or removing the nreverse in >> x-create-frame-with-faces: >>=20 >> diff --git a/lisp/faces.el b/lisp/faces.el >> index 4933b495a6c..e91107e98cc 100644 >> --- a/lisp/faces.el >> +++ b/lisp/faces.el >> @@ -2226,7 +2226,7 @@ x-create-frame-with-faces >> (unwind-protect >> (progn >> (x-setup-function-keys frame) >> - (dolist (face (nreverse (face-list))) >> + (dolist (face (face-list))) >> (face-spec-recalc face frame)) >> (x-handle-reverse-video frame parameters) >> (frame-set-background-mode frame t) >>=20 >> This piece of code (w/ nreverse) was written as part of the hash = table >> rewrite, and at that time (face-list) did not sort its results. I = don't >> know why nreverse is significant here though. >=20 > Which change are you talking about? Please clarify. The fix of this bug, commit a555abc56d5 on branch emacs-29. > The original problem was solved recently on the emacs-29 branch by > reversing the order in which face-list sorts the faces, to make it > similar to what we had before the hash table rewrite. So there should > be no reason to change any other code anywhere else. >=20 > Thanks. --Apple-Mail=_5AAC2BF3-95CD-4629-9510-2DA594B03449 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii

On Feb = 18, 2023, at 14:49, Eli Zaretskii <eliz@gnu.org> wrote:

From: Kai Ma = <justksqsf@gmail.com>
Cc: = Eli Zaretskii <eliz@gnu.org>, =  brennan@umanwizard.com,
&nbs= p;61521@debbugs.gnu.org
Date: = Sat, 18 Feb 2023 06:17:25 +0800

My config becomes broken after = pulling this change: the child frame of
vertico-posframe does not = appear under certain themes, and signals
errors = like:

 Error in post-command-hook (vertico--exhibit): (error = "Invalid face" consult-separator)
 Error in post-command-hook = (vertico--exhibit): (error "Invalid face" hl-todo)

I'm not sure = if this is a downstream issue, but this problem can be
solved by = either reverting this commit or removing the nreverse = in
x-create-frame-with-faces:

diff --git a/lisp/faces.el = b/lisp/faces.el
index 4933b495a6c..e91107e98cc 100644
--- = a/lisp/faces.el
+++ b/lisp/faces.el
@@ -2226,7 +2226,7 @@ = x-create-frame-with-faces
    (unwind-protect
= (progn
  (x-setup-function-keys = frame)
- =   (dolist = (face (nreverse (face-list)))
+   (dolist (face = (face-list)))
    (face-spec-= recalc face frame))
  (x-handle-reverse-video= frame parameters)
  (frame-set-background-m= ode frame t)

This piece of code (w/ nreverse) was written as part = of the hash table
rewrite, and at that time (face-list) did not sort = its results.  I don't
know why nreverse is significant here = though.

Which = change are you talking about?  Please clarify.

The fix of this bug, = commit a555abc56d5 on branch = emacs-29.

The original problem was = solved recently on the emacs-29 branch by
reversing the order in which face-list sorts the faces, to = make it
similar to what we had = before the hash table rewrite.  So there should
be no reason to change = any other code anywhere else.

Thanks.

= --Apple-Mail=_5AAC2BF3-95CD-4629-9510-2DA594B03449-- From unknown Wed Sep 10 20:43:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61521: "default" is now the first item returned from (font-faces), breaking various code. Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Feb 2023 07:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61521 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Kai Ma Cc: brennan@umanwizard.com, gregory@heytings.org, 61521@debbugs.gnu.org Received: via spool by 61521-submit@debbugs.gnu.org id=B61521.167670604210409 (code B ref 61521); Sat, 18 Feb 2023 07:41:02 +0000 Received: (at 61521) by debbugs.gnu.org; 18 Feb 2023 07:40:42 +0000 Received: from localhost ([127.0.0.1]:42348 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pTHpp-0002hp-TS for submit@debbugs.gnu.org; Sat, 18 Feb 2023 02:40:42 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51222) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pTHpo-0002hX-Go for 61521@debbugs.gnu.org; Sat, 18 Feb 2023 02:40:40 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pTHpi-0000ei-UR; Sat, 18 Feb 2023 02:40:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=uJdjl9vqpbogxvjT8Db+isM3WMDqAeJhRs6DteseEE0=; b=eun7WGy6sllh gARZ0clH8sjuqbY7e8bwV4fYKswP+ZpdbZx8iamynkha0vBlNpShHveWCIZzWBq2J/k3d4B1Lso4v QoETNaZUshE0TQFh/MBu1CUyZGdcwogYGf9+ByJxgCcYEaT/O1me5JR9zGLKPE08HNeoNOqkqNrvi zhwQhMdwioUKDmcmUZ2CFQWmipxklmsrXWaYLsfVtBluUKK2qlg2HG+5hVymi5Dpo7ugaTaRHZVFZ uvcyYyJ6DKenRgrvojntcHwKoQsKe/rsSoWjv7x2rxAXOebhhI1cZYGL2dNFDwZRMCIgd+QW1OZmI MdzPQZlCerJMr8tNH5xACw==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pTHph-0004Hi-Kk; Sat, 18 Feb 2023 02:40:34 -0500 Date: Sat, 18 Feb 2023 09:40:35 +0200 Message-Id: <83o7przaj0.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <24615FB3-774C-4D53-A72B-4FFF53E22EAF@gmail.com> (message from Kai Ma on Sat, 18 Feb 2023 14:54:12 +0800) References: <7fe5e80d-761f-cc2d-12a1-65b2b5781c39@umanwizard.com> <9e9ed8043f57226204db@heytings.org> <3b75cf10-6125-608c-a506-323ce09846c7@umanwizard.com> <9e9ed8043fd479390a2a@heytings.org> <83ttznavsp.fsf@gnu.org> <9e9ed8043fd6413e6183@heytings.org> <83y1ovzcw6.fsf@gnu.org> <24615FB3-774C-4D53-A72B-4FFF53E22EAF@gmail.com> X-Spam-Score: -2.3 (--) 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: -3.3 (---) > From: Kai Ma > Date: Sat, 18 Feb 2023 14:54:12 +0800 > Cc: gregory@heytings.org, > brennan@umanwizard.com, > 61521@debbugs.gnu.org > > Which change are you talking about? Please clarify. > > The fix of this bug, commit a555abc56d5 on branch emacs-29. Ah, thanks. So I've now removed the call to nreverse from x-create-frame-with-faces, as you suggested. I agree that the call to nreverse was probably added as part of the hash table rewrite due to the wrong order returned by face-list back then.