From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs Subject: bug#37806: 27.0.50; Need to "extend" face-remap.el Date: Sun, 20 Oct 2019 14:21:50 +0200 Message-ID: <87r237txnl.fsf@gmx.net> References: <875zkmmn4u.fsf@gmx.net> <835zkk7i8i.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="191225"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Ergus , 37806@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 20 14:23:58 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iMAFY-000nbU-Fw for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 Oct 2019 14:23:57 +0200 Original-Received: from localhost ([::1]:33378 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMAFX-0001NB-24 for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 Oct 2019 08:23:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41275) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMAEh-0001KV-U6 for bug-gnu-emacs@gnu.org; Sun, 20 Oct 2019 08:23:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMAEg-0007D5-BH for bug-gnu-emacs@gnu.org; Sun, 20 Oct 2019 08:23:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45166) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iMAEg-0007D1-8J for bug-gnu-emacs@gnu.org; Sun, 20 Oct 2019 08:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iMAEg-0000oE-2h for bug-gnu-emacs@gnu.org; Sun, 20 Oct 2019 08:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 20 Oct 2019 12:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37806 X-GNU-PR-Package: emacs Original-Received: via spool by 37806-submit@debbugs.gnu.org id=B37806.15715741293024 (code B ref 37806); Sun, 20 Oct 2019 12:23:02 +0000 Original-Received: (at 37806) by debbugs.gnu.org; 20 Oct 2019 12:22:09 +0000 Original-Received: from localhost ([127.0.0.1]:53987 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iMADo-0000mi-KJ for submit@debbugs.gnu.org; Sun, 20 Oct 2019 08:22:08 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]:37187) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iMADm-0000m6-8M for 37806@debbugs.gnu.org; Sun, 20 Oct 2019 08:22:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1571574115; bh=h2UyoilaDazaw94hF7ZUUBx11TpjCxVMIeJVk7hS3KI=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=TB64o3o/fLXAkboXzkh0xjEoNwQycNjyt3qMQ71oy6jwbBo6h0RQNsYKeNZmMZm5J GfVGmjTPAxvsdxdETg3pr+xFLE5i7/ZDoXbRFCr+khI1Jzmsz4l9yPwB1JfFTl/k/j 7VNj4UnT+yE4tpkKlJNPINM0bk0i4NVyhlHxPPO4= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from strobe-lfs84 ([188.109.159.139]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Mf0BM-1hpqbx1H1W-00gcVf; Sun, 20 Oct 2019 14:21:55 +0200 In-Reply-To: <835zkk7i8i.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 19 Oct 2019 20:33:33 +0300") X-Provags-ID: V03:K1:MgCNo2QXHpzSZPrii4vEl2PyumJ79rYl4TLda1gZR2YZwy6Dna0 7Dt2K6NwlxxcqxdSU/ziQrPiKY7SyuL7XANjKys3dhBNamH46LQNw4pCkU+TaXh3mxF+3MQ iL9NQbTi/GK8WVIDcazKIK90LWKGVVaifFpQe4z4M/GEPpra/F+F6nRx2hwFqL5tQ4jRLzw /p3hJhBuqOPjNpGOXVl7Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:+7F2hIp2R6s=:CToKSvbM/LgLg0NBoQ0aJA iLeEcsU8kHcmRHiv/r1rjrnVMCZxAqMWkrIsC1ZOARdgmjg/ZSroibev/Z8mm7NRTwcw5xEKc q4a9Hvu4tFVHG9qHf2wLx0mgI63r5MgEQHC65Ekkcp81VtDwPVt2UznG5htCdXx0m8BR3T2bd 6evf/7rxv7S/ya6QEo1itM58Qo9pnRDZF4wMvIKrxffW2q/BJavRW+tNwfB2g8DcCpBEdk62d Kgcf8q+dvx9uJNRtS9mlPUt0kmR2nL7OpYBS/jgpJeTzQo50m0hMzJt0I3XpAAzmwGMdCCUzr uklIehJNbfvKMWxt+kCtXB63dH6IrJWuga67CYCnH01sIX88VY1NT/E35uUxX6U2EGz/BcycK XWv481fgSSmRJXrPXNtjUZU5eCB3zvQFYqLarnm2Mr8D5XtRsNg8Boh1S/g5vQuqBNicBSyox op7r5kZZoC4Pm6d2nG6z0ePuZDlkLkQ/3TNbDWSqk1MWO1L5B0DTqas0b+lpDtjeAPnjtfJNL MVz0MJnymQeAo+yflxC+e6fdDOQGDv3baCFDnyWkSr/ZPYgGSR3d3yJSsx6TEWtYOf+ZHGZjx 3BloPhM7r8SIiNeV7pzTNSxpbZoutiiH4t8rKJsYcjRnX7wHT78SbQsS4DQggBOD1L+aBNKGs j9mUENTGytjcxHECMagppIpN7Kwra9ODLtk68r/OaP1+XEpiYQHRfvRPUspKNarzgt4/EPf4M ecCxo3XqEr8GjdN7TU1aA7LXCqnMcTAeRxL+I3kH1mGp+7YGU2AfMaQeWmKBNrgEcJ4UELUz X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:169803 Archived-At: On Sat, 19 Oct 2019 20:33:33 +0300 Eli Zaretskii wrote: >> From: Stephen Berman >> Date: Fri, 18 Oct 2019 11:14:09 +0200 >> >> 0. emacs -Q >> 1. C-x C-+ (i.e. M-x text-scale-adjust) >> 2. M-x variable-pitch-mode or M-x buffer-face-mode >> =3D> Args out of range: [nil :family :foundry :swidth :height :weight := slant :underline :inverse :foreground ...], 19 >> >> The error happens because the vector of face attributes defined in >> face-remap.el is missing the recently added :extend attribute, so it is >> too short. This also breaks the MELPA package charmap.el (that's where >> I hit the error). The patch below fixes this, though perhaps now would >> be a good time to do what the comment above the definition of the vecto= r >> says: "This variable should probably be defined in C code where the >> actual definitions are available." Or is this simple fix good enough? >> >> (The vector is also missing the :distant-foreground attribute, so the >> patch adds that as well. This absence happened to be innocuous because >> the first element of the vector is nil, in order to make the attribute >> indices match those of the enum lface_attribute_index defined in >> dispextern.h, so the vector was long enough; but after the addition of >> the :extend attribute, it wasn't anymore (only the indices of the vecto= r >> are used in face-remap.el).) >> >> In GNU Emacs 27.0.50 (build 17, x86_64-pc-linux-gnu, GTK+ Version 3.24.= 5, cairo version 1.16.0) >> of 2019-10-18 built on strobe-lfs84 >> Repository revision: 2d13a3f68d4724af52e47675bedf60709c7b5171 >> Repository branch: master >> Windowing system distributor 'The X.Org Foundation', version 11.0.12003= 000 >> System Description: Linux From Scratch >> >> >> diff --git a/lisp/face-remap.el b/lisp/face-remap.el >> index 5cdecb92ee..8e565264fe 100644 >> --- a/lisp/face-remap.el >> +++ b/lisp/face-remap.el >> @@ -69,7 +69,7 @@ internal-lisp-face-attributes >> [nil >> :family :foundry :swidth :height :weight :slant :underline :inverse >> :foreground :background :stipple :overline :strike :box >> - :font :inherit :fontset :vector]) >> + :font :inherit :fontset :distant :extend :vector]) >> >> (defun face-attrs-more-relative-p (attrs1 attrs2) >> "Return true if ATTRS1 contains a greater number of relative > > Thanks. > > Jimmy, could you please take a look? This bug (and bug#37824, which is the same) isn't due to the addition of the :extend attribute per se, but to that addition increasing the length of lface_attribute_index, which makes it necessary to adjust the length of internal-lisp-face-attributes, only the indices of which face-remap.el actually uses, as I noted above. Indeed, the following patch also fixes this bug: diff --git a/lisp/face-remap.el b/lisp/face-remap.el index 5cdecb92ee..e429752df9 100644 =2D-- a/lisp/face-remap.el +++ b/lisp/face-remap.el @@ -66,7 +66,7 @@ ;; definitions are available. ;; (defvar internal-lisp-face-attributes - [nil + [nil nil :family :foundry :swidth :height :weight :slant :underline :inverse :foreground :background :stipple :overline :strike :box :font :inherit :fontset :vector]) But then we might as well just use a vector with all nil (or arbitrary) elements whose length is LFACE_VECTOR_SIZE (maybe that's even how the comment in face-remap.el quoted above could be understood). The simplest fix is to just add the missing attributes, as my first patch does, but then on any future changes to lface_vector_size internal-lisp-face-attributes will have to be correspondingly adjusted. Steve Berman