From unknown Sun Aug 10 00:25:44 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#67404 <67404@debbugs.gnu.org> To: bug#67404 <67404@debbugs.gnu.org> Subject: Status: 30.0.50; Issue with :box face attribute Reply-To: bug#67404 <67404@debbugs.gnu.org> Date: Sun, 10 Aug 2025 07:25:44 +0000 retitle 67404 30.0.50; Issue with :box face attribute reassign 67404 emacs submitter 67404 David Ponce severity 67404 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 23 10:23:36 2023 Received: (at submit) by debbugs.gnu.org; 23 Nov 2023 15:23:36 +0000 Received: from localhost ([127.0.0.1]:34682 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r6BYG-0002Yx-7X for submit@debbugs.gnu.org; Thu, 23 Nov 2023 10:23:36 -0500 Received: from lists.gnu.org ([2001:470:142::17]:48760) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r6BYD-0002Yc-M4 for submit@debbugs.gnu.org; Thu, 23 Nov 2023 10:23:34 -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 1r6BY3-00019o-Dh for bug-gnu-emacs@gnu.org; Thu, 23 Nov 2023 10:23:23 -0500 Received: from smtp-18.smtpout.orange.fr ([80.12.242.18] helo=smtp.smtpout.orange.fr) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r6BXz-0004ha-TQ for bug-gnu-emacs@gnu.org; Thu, 23 Nov 2023 10:23:22 -0500 Received: from [192.168.1.15] ([2.7.71.181]) by smtp.orange.fr with ESMTPA id 6BXvrMPxvCV996BXvr9hQE; Thu, 23 Nov 2023 16:23:15 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=orange.fr; s=t20230301; t=1700752995; bh=ManRPz/h911fTbzzjtgXDHcy03bJ84kdR6+6ZX3VpKU=; h=Date:To:From:Subject; b=l5qnNS8LVSH6wV+MARhSN0uqpqoFfOaIJJzKsJMxyLYXY9MI+NxAW1ykbpUBT9zIT iUXkbSodx7EPYD0aYH2InHdIP+EPeUQmPYHnx5EZT+MEXLRwLNCEOTpxknWuLl/MFG tVXWdL10jvyjhs9kE9Heo9ufzrdPbJcoPiVvnYumlkzP81HZGiWtudJYFHgnYLeYf3 Z8DR+EMB7QvWB/EW8HtyBsCMmTQCWfLCMmJSaIIH3VeW6Z78e52lPWTNYGWPBiClNK hrVwd3Px2a7k+Tl1EMDBTk0ard9x9J8j4B0wsveUFJL1TFYbqWo7QjaZ2YCOVFbCiG qKkOdUNjwl28Q== X-ME-Helo: [192.168.1.15] X-ME-Auth: ZGFfdmlkQHdhbmFkb28uZnI= X-ME-Date: Thu, 23 Nov 2023 16:23:15 +0100 X-ME-IP: 2.7.71.181 Message-ID: <986eaa76-521b-4325-a510-e9a8e374bf49@orange.fr> Date: Thu, 23 Nov 2023 16:23:15 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: bug-gnu-emacs@gnu.org Content-Language: fr, en-US From: David Ponce Subject: 30.0.50; Issue with :box face attribute Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=80.12.242.18; envelope-from=da_vid@orange.fr; helo=smtp.smtpout.orange.fr X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.6 (/) 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.4 (/) Hello, The below face with specified :box attribute can be defined and further used without problem: (defface test-face '((t (:box (:style released-button :line-width (3 . 0))) )) "Test face.") (insert (propertize "XXXXX" 'face 'test-face)) However, it is not possible to apply any change to this face with `customize-face', for example to change :line-width (3 . 0) to :line-width (2 . 0), or to add a :foreground color, etc. This fails with the message "set-face-attribute: Invalid face box: :line-width, , :style, ", and the :box attribute is discarded. AFAICS, :box attribute with any zero :line-width value works as expected: the box line with zero width is not displayed. But zero is not considered as a valid value by `set-face-attribute' (in fact, the internal function `internal-set-lisp-face-attribute'). For consistency, a zero :line-width value either should be accepted by `internal-set-lisp-face-attribute', or never accepted at all. Thanks In GNU Emacs 30.0.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.18.0) of 2023-11-21 Repository revision: 3328c327254b5846782990f6171175bea216eba9 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12014000 System Description: Fedora Linux 39 (KDE Plasma) Configured using: 'configure --with-x-toolkit=gtk3 --with-cairo-xcb --with-native-compilation=no PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings: value of $LC_TIME: fr_FR.utf8 value of $LANG: fr_FR.UTF-8 locale-coding-system: utf-8-unix From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 26 05:27:56 2023 Received: (at 67404) by debbugs.gnu.org; 26 Nov 2023 10:27:56 +0000 Received: from localhost ([127.0.0.1]:40731 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r7CMm-0006r2-Db for submit@debbugs.gnu.org; Sun, 26 Nov 2023 05:27:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52948) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r7CMj-0006qk-Lf for 67404@debbugs.gnu.org; Sun, 26 Nov 2023 05:27:55 -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 1r7CMX-0003cF-Tc; Sun, 26 Nov 2023 05:27:41 -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=GAaAccVDwjMWRUwWMoXl4NkLOj5FErt35/al+F+Mf1Q=; b=qCGA3O3S8ycL uXLjTkeDi2Mt3rLJuGcwBh8VWGdr7K5N3Q/bHi3kL3be7OO/XnDAQotTFM6CLFKRlmpzVAYiBWg+L Mibmxocmv3t2xTiNUUGtVRvIvpgeIcYgP/04XfpDe+KfxLrclB+8swmw4hd591Nalka8EXAcKAhDu GOPH+zkEabxTjcSHVH5mcoLbZUsZddZx5ffKalrdz//1TKlJ6aWdlAv06SWeAkbWlig6o4F55wso9 9LmzOgdWipqcc7ZEw/cilSTblWUyUHM/6UAA2vvl0jFunoDpH+oGKFYX4edrjvgARHzXYhro5RwO8 8ErojoWNLB0pjXtzrv36/w==; Date: Sun, 26 Nov 2023 12:27:23 +0200 Message-Id: <83cyvwbyic.fsf@gnu.org> From: Eli Zaretskii To: David Ponce , Mauro Aranda In-Reply-To: <986eaa76-521b-4325-a510-e9a8e374bf49@orange.fr> (message from David Ponce on Thu, 23 Nov 2023 16:23:15 +0100) Subject: Re: bug#67404: 30.0.50; Issue with :box face attribute References: <986eaa76-521b-4325-a510-e9a8e374bf49@orange.fr> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 67404 Cc: 67404@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: Thu, 23 Nov 2023 16:23:15 +0100 > From: David Ponce > > Hello, > > The below face with specified :box attribute can be defined and further > used without problem: > > (defface test-face > '((t > (:box (:style released-button :line-width (3 . 0))) > )) > "Test face.") > > (insert (propertize "XXXXX" 'face 'test-face)) > > However, it is not possible to apply any change to this face with > `customize-face', for example to change :line-width (3 . 0) to > :line-width (2 . 0), or to add a :foreground color, etc. This fails > with the message "set-face-attribute: Invalid face box: :line-width, > , :style, ", and the :box attribute is discarded. > > AFAICS, :box attribute with any zero :line-width value works as > expected: the box line with zero width is not displayed. But zero is > not considered as a valid value by `set-face-attribute' (in fact, the > internal function `internal-set-lisp-face-attribute'). > > For consistency, a zero :line-width value either should be accepted by > `internal-set-lisp-face-attribute', or never accepted at all. Mauro, any comments about these issues? From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 30 05:46:22 2023 Received: (at 67404) by debbugs.gnu.org; 30 Nov 2023 10:46:22 +0000 Received: from localhost ([127.0.0.1]:52413 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r8eYn-0004Bq-Px for submit@debbugs.gnu.org; Thu, 30 Nov 2023 05:46:22 -0500 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]:52575) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r8eYl-0004Ba-UG for 67404@debbugs.gnu.org; Thu, 30 Nov 2023 05:46:20 -0500 Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-5c5ff5a69f0so662202a12.1 for <67404@debbugs.gnu.org>; Thu, 30 Nov 2023 02:46:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701341166; x=1701945966; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=UaS1DtWA4YtnDXBaqnH0uX9eZleWw2zvKzhBbsTuaos=; b=jY2NVsClrB24K0WRxdwPG3Zmiug5VKDBHQHuMnXXVhVpO6sfQU9RZ8sOjJQZ9ZNdaZ 5uek0gD46UpbgXa80PiDKCvXxSlw3M/98Vb+A02jrYPCzVuKgWz2/zPYtnnAzRkHzAmi nyQwx3jLGIQyNK87tnDPTu+ezlW6h8Ay4raiAgGCg1VabvGtDBd60bykDSv9EXegkj/A YVV8UfwfVeHgYwtX2En5aCsQ5H5cnySynapI+C/he363A5CQkij3xuETAIwPp7R1p0Ee YUK6FQfeOY/jZmhgTRsSpelvX/TMtfi/NCS/+CtlOGRx8BQkOb0FORPggzSuCQAt7oRM cVJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701341166; x=1701945966; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=UaS1DtWA4YtnDXBaqnH0uX9eZleWw2zvKzhBbsTuaos=; b=u4HKGNfCbWJY98QD9S0Dt/hMoNPC/m0uu2gN0x3kgJHQBZK9gdocbr9KIMlaMGmPE4 ZlMpeXuvpUzqLtI/Hx5uZkXr5JuZmvCF8m5bTgeNgcZeUa1g18xn1v1OunqvZJpMjBQE Tl7/QQveZFvo02cde+0xyLwJVbjh0ieM2cqdsTSSUITgNlPI2QawBmTGer5YIH7reEQ4 QkdpAd6UcjJ4bvxQt/5LWh0xecXtln2Np369SyurnW4m2lS+CHi40zIRAXlr9ko5ioJb /vdTJ81xjQTfzNmwK25MM+pBGYwlqdwrSixHBtn2Tgo9Xa3Hs1pxPOkTEpTCNXNWkNDS 1JlA== X-Gm-Message-State: AOJu0YwoF9I28PS4QgOmymHJisK5eCvdB+dufH79Xek/YrBBaDeQtruT LvuJmm87UNVSV9y50v6KuI8= X-Google-Smtp-Source: AGHT+IEDJaIIyt4j1Za6WP+CqO3skIRKek8vtIgXcuan1MWFr+XMNFF/YmnXLUxoY+Dg5wofYe46ww== X-Received: by 2002:a05:6a20:2451:b0:18b:90fc:c266 with SMTP id t17-20020a056a20245100b0018b90fcc266mr24707991pzc.38.1701341166027; Thu, 30 Nov 2023 02:46:06 -0800 (PST) Received: from [192.168.0.234] ([152.168.142.156]) by smtp.gmail.com with ESMTPSA id v5-20020aa78505000000b006cbadbf20ddsm893728pfn.187.2023.11.30.02.46.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 Nov 2023 02:46:05 -0800 (PST) Message-ID: Date: Thu, 30 Nov 2023 07:46:02 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#67404: 30.0.50; Issue with :box face attribute To: Eli Zaretskii , David Ponce References: <986eaa76-521b-4325-a510-e9a8e374bf49@orange.fr> <83cyvwbyic.fsf@gnu.org> Content-Language: en-US From: Mauro Aranda In-Reply-To: <83cyvwbyic.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 67404 Cc: 67404@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 (-) On 26/11/23 07:27, Eli Zaretskii wrote: >> Date: Thu, 23 Nov 2023 16:23:15 +0100 >> From: David Ponce >> >> Hello, >> >> The below face with specified :box attribute can be defined and further >> used without problem: >> >> (defface test-face >>    '((t >>       (:box (:style released-button :line-width (3 . 0))) >>       )) >>    "Test face.") >> >> (insert (propertize "XXXXX" 'face 'test-face)) >> >> However, it is not possible to apply any change to this face with >> `customize-face', for example to change :line-width (3 . 0) to >> :line-width (2 . 0), or to add a :foreground color, etc. This fails >> with the message "set-face-attribute: Invalid face box: :line-width, >> , :style, ", and the :box attribute is discarded. >> >> AFAICS, :box attribute with any zero :line-width value works as >> expected: the box line with zero width is not displayed. But zero is >> not considered as a valid value by `set-face-attribute' (in fact, the >> internal function `internal-set-lisp-face-attribute'). >> >> For consistency, a zero :line-width value either should be accepted by >> `internal-set-lisp-face-attribute', or never accepted at all. > > Mauro, any comments about these issues? Hi Eli, Not really, no.  The widget used for line-width just assumes 0 is a valid value.  I don't know if that's the case or not, it is not explicitly documented in the ELisp manual and I don't really know the xfaces.c code. For some reason, the code that rejects a value of 0 in Finternal_set_lisp_face_attribute doesn't complain (maybe it does not get to run?) when using defface, but it does complain when Customize tries to set it, by calling face-spec-set. Sorry I can't be of any more help right now. From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 30 10:20:50 2023 Received: (at 67404) by debbugs.gnu.org; 30 Nov 2023 15:20:50 +0000 Received: from localhost ([127.0.0.1]:54379 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r8iqP-0001GW-Qm for submit@debbugs.gnu.org; Thu, 30 Nov 2023 10:20:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60420) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r8iqO-0001GI-HW for 67404@debbugs.gnu.org; Thu, 30 Nov 2023 10:20:49 -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 1r8iqA-0002Gy-J3; Thu, 30 Nov 2023 10:20:34 -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=hr68iEnNovhH8y+Dj2FzQ6iSUssT2LcPEs9xLNIiCpo=; b=DbuGASISI+FTmJGWqMVo bQudKuzs/D7LaZ3ab12WVkOO/q7BKIHyD9lYhr6yuLzY31dmAlhFYJ2QXPGPJ5LNoDTpTnz0ZBKmf TwTjujFhmcuNhd9u3WTlWO2dbqWwJ85G1speGHwJcZjRA+q5U1vJKUMOiKhh3oa4Pg4kVh0HQ3nin xF0mkRuvI5tC4IZ+Mf4PZSOpGnxLlp8xTkE15xAJD/fjlQeTcAalbSlO7WiZAFP3F2W+HjkfNH2EW rhMNOCYZn9M3DwCR0jjnj63tbFz7oQVk84wykwIHeWt9ehkQhl5wGOBwrqvMEKa0chC1eUP+ICDTd Nx1w7xclJs/HYQ==; Date: Thu, 30 Nov 2023 17:20:17 +0200 Message-Id: <83ttp3b74e.fsf@gnu.org> From: Eli Zaretskii To: Mauro Aranda In-Reply-To: (message from Mauro Aranda on Thu, 30 Nov 2023 07:46:02 -0300) Subject: Re: bug#67404: 30.0.50; Issue with :box face attribute References: <986eaa76-521b-4325-a510-e9a8e374bf49@orange.fr> <83cyvwbyic.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 67404 Cc: 67404@debbugs.gnu.org, da_vid@orange.fr 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: Thu, 30 Nov 2023 07:46:02 -0300 > Cc: 67404@debbugs.gnu.org > From: Mauro Aranda > > On 26/11/23 07:27, Eli Zaretskii wrote: > > >> Date: Thu, 23 Nov 2023 16:23:15 +0100 > >> From: David Ponce > >> > >> Hello, > >> > >> The below face with specified :box attribute can be defined and further > >> used without problem: > >> > >> (defface test-face > >>    '((t > >>       (:box (:style released-button :line-width (3 . 0))) > >>       )) > >>    "Test face.") > >> > >> (insert (propertize "XXXXX" 'face 'test-face)) > >> > >> However, it is not possible to apply any change to this face with > >> `customize-face', for example to change :line-width (3 . 0) to > >> :line-width (2 . 0), or to add a :foreground color, etc. This fails > >> with the message "set-face-attribute: Invalid face box: :line-width, > >> , :style, ", and the :box attribute is discarded. > >> > >> AFAICS, :box attribute with any zero :line-width value works as > >> expected: the box line with zero width is not displayed. But zero is > >> not considered as a valid value by `set-face-attribute' (in fact, the > >> internal function `internal-set-lisp-face-attribute'). > >> > >> For consistency, a zero :line-width value either should be accepted by > >> `internal-set-lisp-face-attribute', or never accepted at all. > > > > Mauro, any comments about these issues? > > Hi Eli, > > Not really, no.  The widget used for line-width just assumes 0 is a > valid value.  I don't know if that's the case or not, it is not > explicitly documented in the ELisp manual and I don't really know the > xfaces.c code. > > For some reason, the code that rejects a value of 0 in > Finternal_set_lisp_face_attribute doesn't complain (maybe it does not > get to run?) when using defface, but it does complain when Customize > tries to set it, by calling face-spec-set. Thanks for the hints. This is a (very old) bug in Finternal_set_lisp_face_attribute. The value zero for line-width is not valid, but because of the bug it (and invalid values of other box attributes) could be accepted, but only if the invalid attribute is the last attribute of :box. Try this equivalent definition: (defface test-face '((t (:box (:line-width (3 . 0) :style released-button)) )) "Test face.") which just swaps the :box attributes, and you will see that defface signals an error. Customizing the :line-width attribute just happens to move that attribute to the front of the list, and then you get the error. I've now fixed this on the master branch, and now zero width values will always be rejected. From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 30 11:20:58 2023 Received: (at 67404) by debbugs.gnu.org; 30 Nov 2023 16:20:58 +0000 Received: from localhost ([127.0.0.1]:54407 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r8jmb-0003AR-Lc for submit@debbugs.gnu.org; Thu, 30 Nov 2023 11:20:58 -0500 Received: from smtp-18.smtpout.orange.fr ([80.12.242.18]:55201 helo=smtp.smtpout.orange.fr) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r8jmY-0003AH-Kc for 67404@debbugs.gnu.org; Thu, 30 Nov 2023 11:20:56 -0500 Received: from [192.168.1.15] ([2.7.71.181]) by smtp.orange.fr with ESMTPA id 8jmOr7XZB66Vq8jmOrAZ3g; Thu, 30 Nov 2023 17:20:45 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=orange.fr; s=t20230301; t=1701361245; bh=QZIFolyNGxpILlHsqza20wrxpxESrmk3MwdTXeVXzGU=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=OJg8bnloGj1QIAiYkKa+eWINc0vT5pTYWjBOmWCRfqs4aNj3XE6Gy5nkmNFtOd3wW y5tAnDrddMZinT4rWnL04ELGQdBc6zSH/2XP1Yy58kyPVmZohkVX+6vB5/WNPQz5Es pBovviOi+OmwV83rg2pqpW/rKE4+51sHODtq6SXs5isenazYYJh5By5IJ0Y8N3l8ye yyPNIQ734GuGoniEbqDRa6iohnOOZ/UEsEzEZBIb54xSOBkjxOStAaCwguwNGrVn2y i/NgbhFy3ohzfoRHKa/q/jvYgRy7HjJRznqzWfKdOyuruT8UNxPrED+0m/Xki8Vyne EV1tw4ECUs+Tw== X-ME-Helo: [192.168.1.15] X-ME-Auth: ZGFfdmlkQHdhbmFkb28uZnI= X-ME-Date: Thu, 30 Nov 2023 17:20:45 +0100 X-ME-IP: 2.7.71.181 Message-ID: <0275e8ba-efe6-41bc-8380-0baa08c562e9@orange.fr> Date: Thu, 30 Nov 2023 17:20:44 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#67404: 30.0.50; Issue with :box face attribute Content-Language: fr, en-US To: Eli Zaretskii , Mauro Aranda References: <986eaa76-521b-4325-a510-e9a8e374bf49@orange.fr> <83cyvwbyic.fsf@gnu.org> <83ttp3b74e.fsf@gnu.org> From: David Ponce In-Reply-To: <83ttp3b74e.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 67404 Cc: 67404@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 (-) On 30/11/2023 16:20, Eli Zaretskii wrote: >> Date: Thu, 30 Nov 2023 07:46:02 -0300 >> Cc: 67404@debbugs.gnu.org >> From: Mauro Aranda >> >> On 26/11/23 07:27, Eli Zaretskii wrote: >> >> >> Date: Thu, 23 Nov 2023 16:23:15 +0100 >> >> From: David Ponce >> >> >> >> Hello, >> >> >> >> The below face with specified :box attribute can be defined and further >> >> used without problem: >> >> >> >> (defface test-face >> >>    '((t >> >>       (:box (:style released-button :line-width (3 . 0))) >> >>       )) >> >>    "Test face.") >> >> >> >> (insert (propertize "XXXXX" 'face 'test-face)) >> >> >> >> However, it is not possible to apply any change to this face with >> >> `customize-face', for example to change :line-width (3 . 0) to >> >> :line-width (2 . 0), or to add a :foreground color, etc. This fails >> >> with the message "set-face-attribute: Invalid face box: :line-width, >> >> , :style, ", and the :box attribute is discarded. >> >> >> >> AFAICS, :box attribute with any zero :line-width value works as >> >> expected: the box line with zero width is not displayed. But zero is >> >> not considered as a valid value by `set-face-attribute' (in fact, the >> >> internal function `internal-set-lisp-face-attribute'). >> >> >> >> For consistency, a zero :line-width value either should be accepted by >> >> `internal-set-lisp-face-attribute', or never accepted at all. >> > >> > Mauro, any comments about these issues? >> >> Hi Eli, >> >> Not really, no.  The widget used for line-width just assumes 0 is a >> valid value.  I don't know if that's the case or not, it is not >> explicitly documented in the ELisp manual and I don't really know the >> xfaces.c code. >> >> For some reason, the code that rejects a value of 0 in >> Finternal_set_lisp_face_attribute doesn't complain (maybe it does not >> get to run?) when using defface, but it does complain when Customize >> tries to set it, by calling face-spec-set. > > Thanks for the hints. This is a (very old) bug in > Finternal_set_lisp_face_attribute. The value zero for line-width is > not valid, but because of the bug it (and invalid values of other box > attributes) could be accepted, but only if the invalid attribute is > the last attribute of :box. Try this equivalent definition: > > (defface test-face > '((t > (:box (:line-width (3 . 0) :style released-button)) > )) > "Test face.") > > which just swaps the :box attributes, and you will see that defface > signals an error. Customizing the :line-width attribute just happens > to move that attribute to the front of the list, and then you get the > error. > > I've now fixed this on the master branch, and now zero width values > will always be rejected. Hi Eli, I confirm that with your fix on master branch, the behavior is now consistent between defface and customize-face: both signal an error on value zero for line-width :-) However, please note that it remains possible to use a value zero for line-width on an anonymous face. For example, in the *scratch* buffer you still can eval the below expression without error: (insert (propertize "xxxx" 'font-lock-face '(:box (:style released-button :line-width (3 . 0))))) Thanks! From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 30 12:54:04 2023 Received: (at 67404-done) by debbugs.gnu.org; 30 Nov 2023 17:54:04 +0000 Received: from localhost ([127.0.0.1]:54445 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r8lEh-0005dW-PD for submit@debbugs.gnu.org; Thu, 30 Nov 2023 12:54:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39508) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r8lEf-0005cy-V4 for 67404-done@debbugs.gnu.org; Thu, 30 Nov 2023 12:54:02 -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 1r8lER-0004Lm-67; Thu, 30 Nov 2023 12:53:47 -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=KAlrRqKgddUmuSVjcRRyTvtCLBxEpoeOQ+abORGqPYY=; b=Bv6WTyZRBiai VtFc+rMjc1bUaZio0ouEJpIyNRFd9TVQ/9C5N6dOz/Ofp2sVN7Ug34Fa+zRQzoCRWAJcCaIURZvfv GHkiVDzvZV93QhtekbDjzMiWHFfLyO4nYs1JB1KQg4KFMMek8x80dj/o9eoppbrfatu/GwxE5gkpl uaJxikt8aFe/yHhR27thNsll7uuClKLeSxfrdHSuCZ6ZwZIIswxdXqTmqAeSPGgKWAf934r5WiQ7o 1midDKSGCPCeAeK8JGp+Ip7eLqWU4u9i3YjH9Zi9se01sv3IDS7i87x4/mhyEe6QTStVWv3HyQM5L +b7lBXHAtZgmRbnWTQhtaA==; Date: Thu, 30 Nov 2023 19:53:40 +0200 Message-Id: <83msuvb00r.fsf@gnu.org> From: Eli Zaretskii To: David Ponce In-Reply-To: <0275e8ba-efe6-41bc-8380-0baa08c562e9@orange.fr> (message from David Ponce on Thu, 30 Nov 2023 17:20:44 +0100) Subject: Re: bug#67404: 30.0.50; Issue with :box face attribute References: <986eaa76-521b-4325-a510-e9a8e374bf49@orange.fr> <83cyvwbyic.fsf@gnu.org> <83ttp3b74e.fsf@gnu.org> <0275e8ba-efe6-41bc-8380-0baa08c562e9@orange.fr> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 67404-done Cc: 67404-done@debbugs.gnu.org, maurooaranda@gmail.com 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: Thu, 30 Nov 2023 17:20:44 +0100 > Cc: 67404@debbugs.gnu.org > From: David Ponce > > I confirm that with your fix on master branch, the behavior is now > consistent between defface and customize-face: both signal an error > on value zero for line-width :-) Thanks for testing, I'm therefore closing this bug. > However, please note that it remains possible to use a value zero for > line-width on an anonymous face. For example, in the *scratch* buffer > you still can eval the below expression without error: > > (insert > (propertize "xxxx" 'font-lock-face > '(:box (:style released-button :line-width (3 . 0))))) This seems to be a general issue with anonymous faces: their attributes are validated much more leniently than those of defface. For example, try: (insert (propertize "xxxx" 'font-lock-face '(:box (:style foobar :line-width 'bogus)))) or (insert (propertize "xxxx" 'font-lock-face '(:underline (foo bar :style bogus :position)))) You get a face that effectively ignores the invalid attributes. I'm not sure we need to change that. From unknown Sun Aug 10 00:25:44 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 29 Dec 2023 12:24:05 +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