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.devel Subject: Re: master b2e6e95581: Only reset buffer-local buffer-stale-function in make-indirect-buffer Date: Mon, 11 Jul 2022 20:49:00 +0300 Message-ID: <835yk3zgj7.fsf@gnu.org> References: <165754851290.3031.9159264035427641051@vcs2.savannah.gnu.org> <20220711140833.3343AC0D772@vcs2.savannah.gnu.org> <83bktvzhuo.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13768"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: monnier@iro.umontreal.ca, larsi@gnus.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jul 11 19:51:44 2022 Return-path: Envelope-to: ged-emacs-devel@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 1oAxZQ-0003KF-Iw for ged-emacs-devel@m.gmane-mx.org; Mon, 11 Jul 2022 19:51:44 +0200 Original-Received: from localhost ([::1]:35568 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oAxZP-000830-3x for ged-emacs-devel@m.gmane-mx.org; Mon, 11 Jul 2022 13:51:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53790) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oAxX0-000725-5C for emacs-devel@gnu.org; Mon, 11 Jul 2022 13:49:14 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:57184) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oAxWz-00035o-NK; Mon, 11 Jul 2022 13:49:13 -0400 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=rB0z8hZCcoS/aCPKuTOTsN/0tAoISkcDp7rMBMHU5Zc=; b=E1lnXk1g1fdE a8+MIkGOiDDECxkUb4cfIGdUC2FRK+hnDichkSxd6+4ZlOL0UZAlYAUSyXx/QPaYWS7yjFTGnWqZP XDhpvH8lwHgfqPV3VOceChFf/FAUkmlYQZ/vawhMm8Y6/D8dmu35HW/rDJmjrEoMMIBBSNna95hjk n917mfNqGCEj3lqewhCuSTIMdKEFTsfpB+vituO0plQMni4RC4s3cjrv4FgMhySPhzCXzva64Br98 vfesX2hMnHEysBhHQ2g2LkiwAPsGp5+6AyiQJgtupq2dxtxncrLpXHJ57GsbmMLjGMEDJ9Om9bj1u oOkyCuuk2meS/hgpzJMIGg==; Original-Received: from [87.69.77.57] (port=2955 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oAxWz-0004wR-3g; Mon, 11 Jul 2022 13:49:13 -0400 In-Reply-To: <83bktvzhuo.fsf@gnu.org> (message from Eli Zaretskii on Mon, 11 Jul 2022 20:20:31 +0300) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:292061 Archived-At: > Date: Mon, 11 Jul 2022 20:20:31 +0300 > From: Eli Zaretskii > Cc: emacs-devel@gnu.org, larsi@gnus.org > > > > + if (!NILP (Flocal_variable_p (Qbuffer_stale_function, base_buffer))) > > > + Fset (Qbuffer_stale_function, Qbuffer_stale__default_function); > > > > Shouldn't this use `kill-local-variable` instead or something like that? > > I'm also not sure it is wise not to use nil here, since > buffer-stale--default-function is only defined when files.el is > loaded, so this could cause trouble during bootstrap (if not now, then > in some distant future). At least Ffboundp test is in order, I think. Come to think of this: why do we test that the variable is buffer-local? This is in make-indirect-buffer, where the buffer was not yet "released" into the world, so how come it could have this variable as buffer-local already? I think the code should instead _force_ the variable to be buffer-local, _and_ unconditionally set its buffer-local value to nil.