From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#74091: 31.0.50; string-pixel-width in mode line disables region Date: Sun, 10 Nov 2024 12:42:59 +0200 Message-ID: <86frnzl68c.fsf@gnu.org> References: <86y1254owq.fsf@gnu.org> <86ldy54m2g.fsf@gnu.org> <86ed3w33g1.fsf@gnu.org> <8634k0mkgy.fsf@gnu.org> <86ttcgl1f0.fsf@gnu.org> <86ses0l0g3.fsf@gnu.org> <86o72nljrc.fsf@gnu.org> <86jzdblgza.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4040"; mail-complaints-to="usenet@ciao.gmane.io" Cc: me@eshelyaron.com, 74091@debbugs.gnu.org To: monnier@iro.umontreal.ca Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 10 11:45:47 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 1tA5Rw-0000gS-L5 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 10 Nov 2024 11:45:44 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tA5RH-0001u4-V1; Sun, 10 Nov 2024 05:45:03 -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 1tA5QI-0008MZ-Ox for bug-gnu-emacs@gnu.org; Sun, 10 Nov 2024 05:44:03 -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 1tA5QI-0002CV-G0 for bug-gnu-emacs@gnu.org; Sun, 10 Nov 2024 05:44:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=B+XmVS9+PwLL/0SthJsP7vS93EiDQ2Zavdt/I19bs/c=; b=KK9AV093mS/wGS2ZLpB/t3bzZa9tIVY92/u5ucFST5wjdXPNHmsvEPVeqCDGtbBYdgIRwnYTFuUlQ1yN4MrOKbU8P+xmD/HcKDnFYm2ARfyUgCyEQ5dei5/x/kXezodBY6B6Rnyj1jWcxMx27oeoj9fjB6GjkTimRvuFfjAoiMPDJ6kjQMoWLHCVocj+RC4qGgcb2YgetCClyqKlXI2nLN5mjYRr4BiO2CFAyfRJdpYrgBEfOo14peyiWICfWGUwWbtdO42WyEXc+Ra5uiXWFuljf8hVgOQckGV13m2tYk/TolJKtNyKURa9q8QIOlDV9lsz/KIzHABKc9Kwk7nvAw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tA5QI-0002x3-AO for bug-gnu-emacs@gnu.org; Sun, 10 Nov 2024 05:44:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Nov 2024 10:44:02 +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.173123539411264 (code B ref 74091); Sun, 10 Nov 2024 10:44:02 +0000 Original-Received: (at 74091) by debbugs.gnu.org; 10 Nov 2024 10:43:14 +0000 Original-Received: from localhost ([127.0.0.1]:55860 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tA5PV-0002vc-Kz for submit@debbugs.gnu.org; Sun, 10 Nov 2024 05:43:14 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:42386) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tA5PT-0002vI-Ii for 74091@debbugs.gnu.org; Sun, 10 Nov 2024 05:43:12 -0500 Original-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 1tA5PO-0001VZ-47; Sun, 10 Nov 2024 05:43:06 -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=B+XmVS9+PwLL/0SthJsP7vS93EiDQ2Zavdt/I19bs/c=; b=Wd5ZqkDQNzMa mgbI02L4eWn9vN4AoIWSnBB1KPdkrFEE1QZ5rCvZCWKYiDl0RprhWj8ZfPKVo0GCUSEKbXboOieKn GP5feEX2FPuYVah1wNUxvWKdJ6P7AdeRSrRhqZC6AhZNOHfmhVDp6Ce9YS2ZVpzzXyQGsYoLFuHqo ixv/GsF+I1hUEm7ZmsFTB/xnG3/zdqyufR27VSnDlICYtcG67aSWT5rDOecF2wg1zhjTaF5nAKJKP VXAsB4QigaiRDma+N7fv64XFBks78JFG2W5Ti4SHPpuRkhMnHGfvwpfj4KU6LyhgiwGkDvyGL8Akc OdjhpSXueOErxc/Pdr6Z6w==; In-Reply-To: <86jzdblgza.fsf@gnu.org> (message from Eli Zaretskii on Sun, 10 Nov 2024 08:50:49 +0200) 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:295176 Archived-At: > Cc: me@eshelyaron.com, 74091@debbugs.gnu.org > Date: Sun, 10 Nov 2024 08:50:49 +0200 > From: Eli Zaretskii > > > Cc: me@eshelyaron.com, 74091@debbugs.gnu.org > > Date: Sun, 10 Nov 2024 07:50:47 +0200 > > From: Eli Zaretskii > > > > > > @@ -1170,7 +1171,7 @@ reset_buffer_local_variables (struct buffer *b, bool permanent_too) > > > > swap_in_global_binding (XSYMBOL (sym)); > > > > } > > > > > > > > - if (!NILP (prop)) > > > > + if (!NILP (prop) && permanent_too) > > > > { > > > > /* If permanent-local, keep it. */ > > > > last = tmp; > > > > > > This should be an || rather than an &&, no? > > > > No, I don't think so. If the permanent-local property is nil, we > > should not take this branch, even if permanent_too is non-zero. Or > > what am I missing? > > Hmm... but something is still amiss, because Emacs built with my patch > comes up without fontifications, although font-lock-mode is t. Any > ideas? Sorry, here's the correct patch: diff --git a/src/buffer.c b/src/buffer.c index 744b0ef..995984e 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -113,7 +113,7 @@ #define OVERLAY_COUNT_MAX \ static void call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay, bool after, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3); -static void reset_buffer_local_variables (struct buffer *, bool); +static void reset_buffer_local_variables (struct buffer *, int); /* Alist of all buffer names vs the buffers. This used to be a Lisp-visible variable, but is no longer, to prevent lossage @@ -1112,10 +1112,11 @@ reset_buffer (register struct buffer *b) Instead, use Fkill_all_local_variables. If PERMANENT_TOO, reset permanent buffer-local variables. - If not, preserve those. */ + If not, preserve those. PERMANENT_TOO = 2 means ignore + the permanent-local property of non-builtin variables. */ static void -reset_buffer_local_variables (struct buffer *b, bool permanent_too) +reset_buffer_local_variables (struct buffer *b, int permanent_too) { int offset, i; @@ -1141,7 +1142,7 @@ reset_buffer_local_variables (struct buffer *b, bool permanent_too) bset_invisibility_spec (b, Qt); /* Reset all (or most) per-buffer variables to their defaults. */ - if (permanent_too) + if (permanent_too == 1) bset_local_var_alist (b, Qnil); else { @@ -1170,7 +1171,7 @@ reset_buffer_local_variables (struct buffer *b, bool permanent_too) swap_in_global_binding (XSYMBOL (sym)); } - if (!NILP (prop)) + if (!NILP (prop) && !permanent_too) { /* If permanent-local, keep it. */ last = tmp; @@ -3001,7 +3002,7 @@ DEFUN ("kill-all-local-variables", Fkill_all_local_variables, /* Actually eliminate all local bindings of this buffer. */ - reset_buffer_local_variables (current_buffer, !NILP (kill_permanent)); + reset_buffer_local_variables (current_buffer, !NILP (kill_permanent) ? 2 : 0); /* Force mode-line redisplay. Useful here because all major mode commands call this function. */