From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#54156: [External] : bug#54156: 28.0.91; set-face-attribute with a nil FRAME doesn't change the default Date: Sat, 26 Feb 2022 16:17:19 +0000 Message-ID: References: <87ilt3456u.fsf@cassou.me> <87ee3rxhuj.fsf@gnus.org> <83ee3rqgia.fsf@gnu.org> <87y21zw2ll.fsf@gnus.org> <83bkyvqet5.fsf@gnu.org> <871qzrw0ni.fsf@gnus.org> <838rtzqdt4.fsf@gnu.org> <87bkytvfcz.fsf@gnus.org> <83h78lps6m.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2763"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "damien@cassou.me" , "54156@debbugs.gnu.org" <54156@debbugs.gnu.org> To: Eli Zaretskii , Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 26 17:18:11 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 1nNzlp-0000XJ-V1 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 26 Feb 2022 17:18:10 +0100 Original-Received: from localhost ([::1]:52292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nNzlo-0008HY-CF for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 26 Feb 2022 11:18:08 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:51964) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nNzli-0008HQ-D6 for bug-gnu-emacs@gnu.org; Sat, 26 Feb 2022 11:18:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34081) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nNzli-0005x6-4V for bug-gnu-emacs@gnu.org; Sat, 26 Feb 2022 11:18:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nNzlh-00018S-UC for bug-gnu-emacs@gnu.org; Sat, 26 Feb 2022 11:18:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 26 Feb 2022 16:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54156 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 54156-submit@debbugs.gnu.org id=B54156.16458922564326 (code B ref 54156); Sat, 26 Feb 2022 16:18:01 +0000 Original-Received: (at 54156) by debbugs.gnu.org; 26 Feb 2022 16:17:36 +0000 Original-Received: from localhost ([127.0.0.1]:56211 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNzlI-00017i-24 for submit@debbugs.gnu.org; Sat, 26 Feb 2022 11:17:36 -0500 Original-Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:62974) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNzlF-00017P-Uh for 54156@debbugs.gnu.org; Sat, 26 Feb 2022 11:17:35 -0500 Original-Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 21QAFRa7025481; Sat, 26 Feb 2022 16:17:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2021-07-09; bh=+TjiiUeol+xFo9xpwHr+dnf+XCRY2n0DcbASYgwWAlo=; b=Bm/H2jHntXPFmkfD5rHPc6FMH3sBltvtIUdxwqAo32MMRXiBfKREsBq1AOxz2lSfdRCG oLn9rgUCeDY9oXQYxd+7AwFNmm8J5p8nTBS67PO0/qGUyCZOFsWx6tmn/cPQXDDIzlxI D+R45f7n4pTi4Jlqeadk0UItwMD1zAi/PQgKjtmwgrfZD0As6gT4dz9rL3Bh8F72O1Ny PEHH87RZpbFQdeXKqSv6zaO7qeqiQD3mOKwnqObL7cdWASPcyn2R+8F7exUEqOa2Y0tD DwZ8H79n8mfnKOTsyzHCaTf5eJbP8W6obpUsm7GOOwvKvFlaCCgUX+DJLvONXALxzcTQ Pg== Original-Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 3efcrt8yut-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 26 Feb 2022 16:17:23 +0000 Original-Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 21QGBmmS018290; Sat, 26 Feb 2022 16:17:22 GMT Original-Received: from nam04-mw2-obe.outbound.protection.outlook.com (mail-mw2nam08lp2169.outbound.protection.outlook.com [104.47.73.169]) by userp3030.oracle.com with ESMTP id 3ef9asvcdf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 26 Feb 2022 16:17:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gpcrOjwrU7G3R4EyNI/Ri9Hyz2lrPIhZjvBzK67k0MSQRNndRKm9jl4Sgge1Fubjs/zC7W+l/Y67OIWTX9Z9S89sY12cC+Re02rPoCqNLwPq1p2cNg4NrBiewNP41HF+f0suX/AV338HuNc64nVLexMnF+rB4NjX9Eo1jlfmzVRzmTog3hydbYZh1jkvXC/Q0JTI9g40jjN/+xtmyaNhygXz6fiO8SDo7DLD6ZlCdP2oJQuRyAFVZdybqGFG0oI4B6mRiqfyePFB+RT6lHpac5TZlL0wxnMTKar7MwaoZM8BfspmP3sw4z5+AD19qz3zr6icMSKMPXAQWhK+5S14BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+TjiiUeol+xFo9xpwHr+dnf+XCRY2n0DcbASYgwWAlo=; b=VPHUF+yAVVC+/PCfDgpSmeEplmc6+MzgaqEMNkh4VtFqcmszwG60mRjEkli9fnmjtYPaqFm3j7yNgVmom9g0p1Ocr7pBzQruOrpEkbz6GXtnUL/drIrNzvNDuQs1xlMd55ajA3FJnrcfWnvJ+I8KNP31rQKQBthBGk5cC7h/Xdez0Bi4b1eR61/6kpnff/sH8WDFayJ1+Phi9NqId8/WNksw9CV3PuFN+sWqqg7kO04KHTAbaAGI44L6FeX5cUNfFhRj6t9muFCXETbfS049/BRt2eOLKN9jZfB8LJCZGDWqjsz/FfHb3vuavByxkB/x8+l+DYq9noTvK7zeWx3hMw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+TjiiUeol+xFo9xpwHr+dnf+XCRY2n0DcbASYgwWAlo=; b=QqWx/K92T48fnT8e5hvCTZJAkm1F5AHT1RYtW8QcSeswYToibN6jNhbDvfbrlv7lN+y3Iumu1DZo08eGHrgTYQ0p2cLtgo5LT2+zxXxUyDwO05/ipIvtCBusenTZMYfPdGsyRnW17IqG2zUsHLW1HRgkpLyI1XBp2LFDNfAFtYM= Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by BY5PR10MB3953.namprd10.prod.outlook.com (2603:10b6:a03:1b6::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.22; Sat, 26 Feb 2022 16:17:19 +0000 Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::f811:66c9:41ab:df79]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::f811:66c9:41ab:df79%7]) with mapi id 15.20.5017.026; Sat, 26 Feb 2022 16:17:19 +0000 Thread-Topic: [External] : bug#54156: 28.0.91; set-face-attribute with a nil FRAME doesn't change the default Thread-Index: AQHYKyULFHvBMI3KRkmaKYbulr/Re6yl+3GA In-Reply-To: <83h78lps6m.fsf@gnu.org> Accept-Language: en-US Content-Language: en-US x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 306c38ca-16bb-40e3-169f-08d9f9437681 x-ms-traffictypediagnostic: BY5PR10MB3953:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 3WjA8y55RKLFOxYuFs1EWw03XDDFVKfh2SFy17monvkwjT9konCM6gCSM70MZkVjtsAoiemT+n194oryoMIvN/00prt/D5d8T4nrE/4EG0sBXZMLLPWpnHG/j3yZd5TS3LSfRJi2ddEscRU6569dZgec2zmZ2dkwXBMEBS0THZP6zBZ/swZTadpJRjejXbRSd+ofAkp+/2ZkyOyiBxPgZAFzA64bbU4YDCDJZ18fajzkddfTJbcpkfZKIwc1oTbXDxe0qPyEQP3iY+9kj8Da3ZRsrgNh8156tNxXXhf6N2783cHKOelFVe5VI46iIeM6KRBzVx7QsNy/JXhrR6aIFIQy3fz+JfpyyNS0vtbmRnV3Wm4QBYdnoBsFIvtoIuBZXenzLjvfC2lAF9J+3aUh9Jhmn34n/aKqdKd/Sc7t7ILTlagavthg14E0OAJGEUXUjTLykeAyby6kbPCW44YjOinEVbxjayEoqnQ7SihArlzEY+8ATIweOopee7byrsougBNCh3zLr6+rWFUXRotP+PJSvWRfZ7qQAI8VvYn2crQswWXdb3TQVw72VYNczJwxcA3TtjV1X3ZodGjDjrraL7XmEa4qg6lnrc8Or6gNie1KZxDfiSXfnplXXFH/9iZDctaUqp87w/YL3baaAeVEuKDCC/+qsGtdZb6SGw0ucUIdEQcUf6dnWOIbmX7bDRbbrQlPcCk3h3NOAAmg2aPmSw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(66476007)(66446008)(8676002)(55016003)(54906003)(110136005)(71200400001)(76116006)(26005)(66556008)(83380400001)(316002)(66946007)(508600001)(5660300002)(2906002)(4326008)(52536014)(8936002)(44832011)(64756008)(33656002)(7696005)(38100700002)(6506007)(122000001)(38070700005)(9686003)(186003)(86362001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: /QKUwXLjZaOHMYYMQLBoE7np5yOTj1v+8ybkF5segwMn8OONE6kTETG3VKenjJ374M/crh0uuxPmSzAy2UeAVuiQE5b8xSzbFuGZfsfadl7QRFS8ob/NnSdq5+5ep4NFiLEf4g7VHkl4ErgqyOiSdv61gG3P5DjO54I9zvW2YdtpA4eR5cSSR5rJkKW3XRV+hkBJsN8j5IOFgeeiAWK8wQriq7UdimdpQJlVNgVGpeW6PxtA5ssz6K6J6xsVlNFLQRQcs+RvnVks/N/HRpCC1yEoadv3VHl8i8GT4BI6TIgCSmiz0dk5OoEMetIxX97Wko3LLjMc/sXA51a+fM1MmHQob4x3AbL97DBVRh7mwqZjpwe6u7ULiV6caAFhxmcZY4Qcg4xk88fL9db5xJ/9vCW/ISy9AnlUJ55wtzA19aO41fKQBsGFwg5D70UfYXuOWMTzD6Xi3J0ATWfbwjslW1NIiyS1QxUDL/hrYQ+hbi1EmZVmjzq2bF1D9KKwK64lb9atrlPMprBI2gJn2kg1lED73eq57jrS1m7As5OXs876gIqdDOq/a9pN+P2BwDSIXse/dIqEbtJWFR24yhA0CdRt2Jp5/vtW/mgwaFxjUhJxsz/tZvgEwPcg42TMPOjNpG5wil9468EpP5MFC2c9VfXOFnvcWaddX7u/MMCkqPRxzdxMH6kKNX4ZjCvgyMXRACSzTRIQqoR9GPWq09Ynk6WbAiqKKbdk24IXQn4bj1v0tV9wMWL2MOZkBs HVnzlFbpwZnQLWAZcncG2NXQt+Nxiw70H2Ibg5ix92yLWCXrAxcxxjc30FKd+0bgX/Ek5CP4BZOEESHqf59XaF0eGSf2l5lyQR X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 306c38ca-16bb-40e3-169f-08d9f9437681 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Feb 2022 16:17:19.4994 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: myZQuXBvp+oEE//cMrK0rQ3tHMeTWhe6mXMfhyayAIapE2MjGXjRtGwI/sEKAnpeX43nFVGZAVg4vrUfLgczWQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB3953 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10269 signatures=684655 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 bulkscore=0 malwarescore=0 mlxscore=0 phishscore=0 suspectscore=0 adultscore=0 mlxlogscore=953 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2202260115 X-Proofpoint-GUID: Fq7B7fo0xX80zRERxiBFteT4geVLZpkn X-Proofpoint-ORIG-GUID: Fq7B7fo0xX80zRERxiBFteT4geVLZpkn 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:227682 Archived-At: > > > So we need a special trick to override defface with 'unspecified', > > > and that trick is this call: > > > (set-face-attribute 'region t :background 'unspecified) > > > This is handled specially in internal-set-lisp-face-attribute > > > to do what Damien wants. > > > > So perhaps set-face-attribute should do that automatically when > > handed a nil value? >=20 > The fact that we handle nil as 'unspecified' in the case of the color > is for compatibility with Emacs 20. In Emacs 21 and later, a color > cannot be nil. This is well-documented: a color must be a string or > 'unspecified'. I don't think we want to resurrect that old convention > of nil; it's just that Damien and others will have to get used to not > using nil for a color. What Eli says here makes sense to me. We could also perhaps explicitly (more visibly) recommend that you always use an explicit `unspecified' rather than nil. ___ It does not make sense to me to change the longstanding behavior, to make `set-face-attibute' do something different (and backward-incompatible). As Eli said: "This is basic in how faces are handled in Emacs; we cannot easily change that without breaking gobs of code." ___ I'm not sure I understand this from Eli, however: The correct way to do what Damien wants (AFAIU) is this: (set-face-attribute 'region nil :background 'unspecified) (set-face-attribute 'region t :background 'unspecified) That is, one must explicitly call set-face-attribute with FRAME =3D t (as well as nil), and pass 'unspecified' ^^^^^^^^^^^^^^^^^^ (NOT nil!) as the value. Maybe we should document that, although it is a obscure and unusual thing to do. My impression is that it's enough to do this: (set-face-attribute 'region nil :background 'unspecified) I'm probably not testing/checking this correctly, but it seems to me that both the selected frame and new (future) frames are affected by using nil for the frame (and `unspecified' for the face attribute value). In any case, yes, whatever the correct message is for users, please do consider adding it to the doc. You might consider this an unusual thing to do (why so?), but misunderstanding this is a gotcha that we should help users avoid. Eli, you say "This is well-documented: a color must be a string or 'unspecified'." Still, it wouldn't hurt to add something to that effect in the doc of `set-face-attribute' - and say what the effect is of using nil (for the face color) - it's tolerated (no error) but it doesn't have the effect of `unspecified'.