From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Felix Dietrich Newsgroups: gmane.emacs.bugs Subject: bug#58312: Improve =?UTF-8?Q?=E2=80=9CInvalid?= face =?UTF-8?Q?attribute=E2=80=9D?= error message Date: Wed, 05 Oct 2022 20:42:28 +0200 Message-ID: <87czb6p0x7.fsf@sperrhaken.name> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26345"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) To: 58312@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 05 20:43:43 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1og9Ms-0006gH-JP for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 05 Oct 2022 20:43:42 +0200 Original-Received: from localhost ([::1]:36752 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1og9Mr-0002p0-HI for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 05 Oct 2022 14:43:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49900) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1og9MQ-0002lv-86 for bug-gnu-emacs@gnu.org; Wed, 05 Oct 2022 14:43:14 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58981) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1og9MF-00048V-Fd for bug-gnu-emacs@gnu.org; Wed, 05 Oct 2022 14:43:13 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1og9ME-00005k-8K for bug-gnu-emacs@gnu.org; Wed, 05 Oct 2022 14:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Felix Dietrich Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 05 Oct 2022 18:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 58312 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.1664995359317 (code B ref -1); Wed, 05 Oct 2022 18:43:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 5 Oct 2022 18:42:39 +0000 Original-Received: from localhost ([127.0.0.1]:58058 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1og9Lr-000053-EX for submit@debbugs.gnu.org; Wed, 05 Oct 2022 14:42:39 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:49214) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1og9Lo-00004r-OT for submit@debbugs.gnu.org; Wed, 05 Oct 2022 14:42:38 -0400 Original-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 ) id 1og9Lo-0001gn-GG for bug-gnu-emacs@gnu.org; Wed, 05 Oct 2022 14:42:36 -0400 Original-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 ) id 1og9Lj-00044n-D8 for bug-gnu-emacs@gnu.org; Wed, 05 Oct 2022 14:42:35 -0400 Original-Received: from localhost ([77.11.160.112]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MFK8N-1oQVES16wT-00FlNz for ; Wed, 05 Oct 2022 20:42:29 +0200 X-Provags-ID: V03:K1:OEJNBZmpb3fwRaN2qglFRwD0hBb8FWQp3JhruYzTMHIzpRZPodv PL7H5Az2sKtBpL5DZ1ROcIjapl7P4uDHo9Nhl9WOYrLapt1OoZS+S943F/uGbW0ytujlh/o rvX2EResRJhtT79UBd1efqed+tdsIkdyx2sFcHPopAMQJhmUvaiBJzRJU/59JRo4ZZXglcr 8xvkaBbWERityYPDVJJKg== 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+DNQrm1SFXkmKEIex1MN7FZPaDqM3h1eaZ58XxtFPWbW8PkkhlaB Received-SPF: none client-ip=212.227.17.10; envelope-from=felix.dietrich@sperrhaken.name; 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:244555 Archived-At: 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 #>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 . 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@ucl.ac.uk> --=20 Felix Dietrich