From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#74091: 31.0.50; string-pixel-width in mode line disables region Date: Wed, 06 Nov 2024 15:12:24 +0100 Message-ID: References: <86y1254owq.fsf@gnu.org> <86ldy54m2g.fsf@gnu.org> <86ed3w33g1.fsf@gnu.org> <865xp82vd2.fsf@gnu.org> <86ldxwsf11.fsf@gnu.org> Reply-To: Eshel Yaron Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5213"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 74091@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 06 15:13:22 2024 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 1t8gmf-0001Bs-MB for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 06 Nov 2024 15:13:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t8gmO-0003uk-EY; Wed, 06 Nov 2024 09:13:04 -0500 Original-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 1t8gmM-0003uc-Eh for bug-gnu-emacs@gnu.org; Wed, 06 Nov 2024 09:13:02 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8gmM-00059J-5l for bug-gnu-emacs@gnu.org; Wed, 06 Nov 2024 09:13:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=MjqhzEHPTexc+PJXz8F+/KHfWrFGhr7+x2xIba8DV+A=; b=fDrU/xYD2szwRJOcx99DqzIPNoBO5XS2Nqy0MUQbK/jLeeaoVgSQH14X0jw1AiUufJM62njSqFNG8uB5YfEv7kl3HXqIiBTjnJZqaR56mX+wJ0SZdy4xCEELzgAEG8lrVGFFLkSy4iKXgh7OacRvaNG+hHaWHi9ucXQrhvVSeJZYyYrdri9rJZvSOrju1TCz2FDSdjyWCq2K6XJdb6LMKT5/QhW2SBV0/x6aCE0grEFQ2KDPSP9bU+AL7i4UlZRce8wrqT9ltbUhghMf/LvbSOqaSBIVyFPmVUbO5NYqdNmYERY4Tx0xYd4JzmK4uBo9VCiutuF6lkG5CsmmTo42FQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t8gmL-000142-R8 for bug-gnu-emacs@gnu.org; Wed, 06 Nov 2024 09:13:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eshel Yaron Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Nov 2024 14:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74091 X-GNU-PR-Package: emacs Original-Received: via spool by 74091-submit@debbugs.gnu.org id=B74091.17309023524053 (code B ref 74091); Wed, 06 Nov 2024 14:13:01 +0000 Original-Received: (at 74091) by debbugs.gnu.org; 6 Nov 2024 14:12:32 +0000 Original-Received: from localhost ([127.0.0.1]:40160 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t8glr-00013I-Vn for submit@debbugs.gnu.org; Wed, 06 Nov 2024 09:12:32 -0500 Original-Received: from mail.eshelyaron.com ([107.175.124.16]:38384 helo=eshelyaron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t8glp-000137-9D for 74091@debbugs.gnu.org; Wed, 06 Nov 2024 09:12:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1730902348; bh=PZo5G1unwen+VYnXdMYL3Mhh6ieMpJ/CB4q8FCFA+KQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=iHPWtuco9hfXe0fVC/1ekAvtpP2xYHzUjS2ZxnqKjcu2hplqaZ5NhoPqR5B8htUoR XOQBnSOLrUmIqPYFNSEUzYzoRrqoWQmd/ThOnkzYZ4lgbqLTmU3z8S+Mu3uhikttps 0ELTmwxQnJjwmXGrLKhlLoSnPMfNBfY3aFQqeZgMbIUn41UooHaKY1NxLUMvYRzqEa EGN6EmM/C4SqdN1LFsb01bmf3jEoCb0Sns91bd8BGYKpchxu3ssYf1x5WD/ozV07Si 0fcd5yGAEjton9tt51Bk8/DhsuhMqWCxwOIJ03Ow/D8F+14x9LL5lsl2P1kH1mablp YXnUbnMLxLSrg== In-Reply-To: <86ldxwsf11.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 06 Nov 2024 14:49:46 +0200") X-Hashcash: 1:20:241106:eliz@gnu.org::Agtgcoc9IXcDffDd:A/X X-Hashcash: 1:20:241106:74091@debbugs.gnu.org::lLnUSZC3f45sskNj:8VP4 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:294966 Archived-At: Eli Zaretskii writes: >> From: Eshel Yaron >> Cc: 74091@debbugs.gnu.org >> Date: Wed, 06 Nov 2024 09:01:16 +0100 >> >> FYI after spending a bit more time on this issue, I concluded that >> (kill-all-local-variables t) is inherently problematic: it breaks >> assumptions that Emacs relies on. (See bug#73005 for another example.) >> >> It doesn't seem like killing permanent-local variables in the work >> buffers is necessary ATM, so the fix I'm using is the following: > > Can't _any_ variable become permanent-local, by virtue of some Lisp > program or the user giving it a permanent-local property? > > More generally, how do we know that there are no permanent-local > variables out there that affect layout, and thus affect the results of > this function? > > I believe these considerations were those which led the author to use > kill-all-local-variables like this: we want to be sure that nothing > will dupe string-pixel-width into producing unexpected results. Yes, this reasoning is perfectly understandable. However, the current way of killing all permanent-local variables has bad consequences that that author, naturally, did not expect. So my suggestion is to avoid (kill-all-local-variables t) here and elsewhere. For string-pixel-width specifically, we take care to clear variables that may affect width calculation. If other variables may interfere, we should just clear those too. Cheers, Eshel