GNU bug report logs - #58312
Improve “Invalid face attribute” error message

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: Felix Dietrich <felix.dietrich@HIDDEN>; Keywords: moreinfo; dated Wed, 5 Oct 2022 18:43:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 58312 <at> debbugs.gnu.org:


Received: (at 58312) by debbugs.gnu.org; 6 Oct 2022 12:44:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 06 08:44:49 2022
Received: from localhost ([127.0.0.1]:59326 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ogQF7-0001Yx-Gd
	for submit <at> debbugs.gnu.org; Thu, 06 Oct 2022 08:44:49 -0400
Received: from quimby.gnus.org ([95.216.78.240]:41228)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1ogQF5-0001Yj-Op
 for 58312 <at> debbugs.gnu.org; Thu, 06 Oct 2022 08:44:48 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID
 :Date:References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-ID:
 Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
 :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=a4MadW5D9uQOHfn9KvDm3zcg7yVuFTkwrAv6V2ZlgV8=; b=Y8OJy2EddjIGan9+giT99CWZ63
 B/zibPqa6FFydbbU7F6d93wa65jrj9Qc9BUigVcxfIU+7WcnZ9hH/921gM7gHseF6uZQvwxiQhhoM
 fNwQf57FGdOnRbNhr0Tb36MCBdELoKiiVVoEzlW0SWlLPqISvotl4GhChMrZROVNWG0E=;
Received: from [84.212.220.105] (helo=downe)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1ogQEx-0002uW-S4; Thu, 06 Oct 2022 14:44:41 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Felix Dietrich <felix.dietrich@HIDDEN>
Subject: Re: bug#58312: Improve =?utf-8?Q?=E2=80=9CInvalid?= face
 =?utf-8?Q?attribute=E2=80=9D?= error message
In-Reply-To: <87czb6p0x7.fsf@HIDDEN> (Felix Dietrich's message of
 "Wed, 05 Oct 2022 20:42:28 +0200")
References: <87czb6p0x7.fsf@HIDDEN>
X-Now-Playing: Alan Vega's _Collision Drive_: "Viet vet"
Date: Thu, 06 Oct 2022 14:44:39 +0200
Message-ID: <87pmf5xgso.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 
 Content preview:  Felix Dietrich <felix.dietrich@HIDDEN> writes: >
   Could the log message “Invalid face attribute” created by > “xfaces.c:merge_face_ref”
    be extended to also include the buffer or > other identifying information
    about its origin? 
 
 Content analysis details:   (-2.9 points, 5.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
                             [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 58312
Cc: 58312 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Felix Dietrich <felix.dietrich@HIDDEN> writes:

> Could the log message =E2=80=9CInvalid face attribute=E2=80=9D created by
> =E2=80=9Cxfaces.c:merge_face_ref=E2=80=9D be extended to also include the=
 buffer or
> other identifying information about its origin?

Perhaps include the window name?  That would be less ambiguous than the
buffer name.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#58312; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 5 Oct 2022 18:42:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 05 14:42:39 2022
Received: from localhost ([127.0.0.1]:58058 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1og9Lr-000053-EX
	for submit <at> debbugs.gnu.org; Wed, 05 Oct 2022 14:42:39 -0400
Received: from lists.gnu.org ([209.51.188.17]:49214)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <felix.dietrich@HIDDEN>) id 1og9Lo-00004r-OT
 for submit <at> debbugs.gnu.org; Wed, 05 Oct 2022 14:42:38 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:35044)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <felix.dietrich@HIDDEN>)
 id 1og9Lo-0001gn-GG
 for bug-gnu-emacs@HIDDEN; Wed, 05 Oct 2022 14:42:36 -0400
Received: from mout.kundenserver.de ([212.227.17.10]:37675)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <felix.dietrich@HIDDEN>)
 id 1og9Lj-00044n-D8
 for bug-gnu-emacs@HIDDEN; Wed, 05 Oct 2022 14:42:35 -0400
Received: from localhost ([77.11.160.112]) by mrelayeu.kundenserver.de
 (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id
 1MFK8N-1oQVES16wT-00FlNz for <bug-gnu-emacs@HIDDEN>; Wed, 05 Oct 2022
 20:42:29 +0200
From: Felix Dietrich <felix.dietrich@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: Improve =?utf-8?Q?=E2=80=9CInvalid?= face =?utf-8?Q?attribute?=
 =?utf-8?Q?=E2=80=9D?= error message
Date: Wed, 05 Oct 2022 20:42:28 +0200
Message-ID: <87czb6p0x7.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Provags-ID: V03:K1:OEJNBZmpb3fwRaN2qglFRwD0hBb8FWQp3JhruYzTMHIzpRZPodv
 PL7H5Az2sKtBpL5DZ1ROcIjapl7P4uDHo9Nhl9WOYrLapt1OoZS+S943F/uGbW0ytujlh/o
 rvX2EResRJhtT79UBd1efqed+tdsIkdyx2sFcHPopAMQJhmUvaiBJzRJU/59JRo4ZZXglcr
 8xvkaBbWERityYPDVJJKg==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:tDnoc/wlsnI=:cKahZYqJ0rBu/jWGVsEh//
 ZQs95nascWSZn/2iOjxEOf5ckacIH/Tdk1/jWGJnSZKbSdTdCjeu5U97rdyOU/UmmWEq/iksn
 eqYWZGxE3s5QMVgK8q6yHsJgFqzUZPHcPuAvHInQGAkkz1o/iBoJXhqGFlQ654UMaoT4LfsD+
 P8UQmNvNUMnUxPXsdUmqO4ZgFpjmEDHF5nUqhziB2mJk5904yuHnhAQqi5jgNXiup5Uouw1+q
 PV8hGceZQOlqoWEGVG9VcUVKMOeJI0d2Vgx/gJnaLJmLoFUcYEf17Y8K9H5fmWnQdVqFPVOyP
 ajBfj/g0RemHc2RdGdeCsNrpfURMM59+NglCzupxl5H9hLHAK9++uurxIMoPtckIbW+ZdtXem
 +lA+YYOWIN0DYgoK9g9Z0xn7J+Sepc8zYik0DsKiOARh8QuvqGJY1Svw/VfhcEcVRsJWmTY6K
 j1tFoLjInL0CqYZfFBZyC2Mqz4uB18cca8n/3/yQVKrEjptvJVQk5QQyNH3rcNgaGfiI9gJw1
 ELmcaGPn61alTsTpXbLbdsxKifxvqVCFDnnuUh6BzFyaZj2qyIajgZisBzokYTSEnuNX6bVGr
 Ol6SJh+VD6loc6VBGx5lVI94bhvN0SB3WBwu4+2WfTFxPPcYy0aqaQUtWI1u+6EHnY0Md8Pch
 YOznpD4jHDoWTZUbUSudNyCUHTLoWgQpL21IXEB4spk/NefT9m4luzDFJKhUWAAzH7NhPdAGF
 59ILEWmXo/TSBKb309NI+DNQrm1SFXkmKEIex1MN7FZPaDqM3h1eaZ58XxtFPWbW8PkkhlaBS
 B2r6vBd6FLFXo1A82P3ZF43zXgGJQ==
Received-SPF: none client-ip=212.227.17.10;
 envelope-from=felix.dietrich@HIDDEN; helo=mout.kundenserver.de
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, RCVD_IN_MSPIKE_H2=-0.001,
 SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Package: emacs
Severity: wishlist

Could the log message =E2=80=9CInvalid face attribute=E2=80=9D created by
=E2=80=9Cxfaces.c:merge_face_ref=E2=80=9D be extended to also include the b=
uffer or
other identifying information about its origin?  This request is
motivated by a recent issue posted to the help-gnu-emacs list [1].

When Emacs encounters an anonymous face with an invalid face attribute
value in a buffer, it will write a log entry to the =E2=80=9C*Messages*=E2=
=80=9D buffer.
This message takes the form =E2=80=9CInvalid face attribute ATTRIBUTE VALUE=
=E2=80=9D and
lacks any information that would allow easy identification of the
invalid face=CA=BCs place of origin.  The log entry is induced by the
function =E2=80=9Cxfaces.c:merge_face_ref=E2=80=9D.  This function takes as=
 its first
argument a =E2=80=9Cstruct window=E2=80=9D which could potentially be used =
to retrieve
the causing buffer using its =E2=80=9Ccontents=E2=80=9D member (note, thoug=
h, that it
may be NULL).

Here is a snippet that will cause the =E2=80=9CInvalid face attribute=E2=80=
=9D message
to be written to the =E2=80=9C*Messages*=E2=80=9D buffer when evaluated:

#+begin_src emacs-lisp
  (let ((buf (generate-new-buffer "*test*"))
        (s (propertize "Hello World" 'face '(:foreground nil))))
    (with-current-buffer buf
      (insert s))
    (display-buffer buf))
#+end_src

#+begin_example
#<window 54 on *test*<2>>Invalid face attribute :foreground nil
Invalid face attribute :foreground nil
#+end_example

Two things I noticed exploring the issue:

1. the value I use in the above example for the :foreground attribute
nil is handled specially in =E2=80=9Cxfaces.c:internal-set-lisp-face-attrib=
ute=E2=80=9D
(accompanied by a comment stating =E2=80=9CCompatibility with 20.x.=E2=80=
=9D): it is
changed to =E2=80=98unspecified=E2=80=99, but in =E2=80=9Cxfaces.c:merge_fa=
ce_ref=E2=80=9D nil is
considered an error;

2. there is a newline missing between the log entries for the result of
the evaluation and the error entries in the =E2=80=9C*Messages*=E2=80=9D bu=
ffer.  This
is bug #58311 <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D58311>.


Footnotes:
[1]  From: Eric S Fraga
     Subject: how to track down "invalid face attribute" errors?
     Date: Sun, 25 Sep 2022 13:03:03 +0100
     Message-ID: <87k05rr79k.fsf@HIDDEN>

     <https://lists.gnu.org/archive/html/help-gnu-emacs/2022-09/msg00415.ht=
ml>

--=20
Felix Dietrich




Acknowledgement sent to Felix Dietrich <felix.dietrich@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#58312; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 6 Oct 2022 13:00:02 UTC

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