From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Spencer Baugh Newsgroups: gmane.emacs.bugs Subject: bug#48264: [PATCH v3 08/15] Set non-buffer-local BVARs to Qunbound Date: Fri, 07 May 2021 08:54:33 -0400 Message-ID: <87r1iir9fa.fsf@catern.com> References: <877dkbsj9d.fsf@catern.com> <20210506213346.9730-9-sbaugh@catern.com> <83bl9mde2m.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10808"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 48264@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 07 14:55:31 2021 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 1lf00x-0002ia-BX for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 07 May 2021 14:55:31 +0200 Original-Received: from localhost ([::1]:38636 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lf00w-0008N6-D8 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 07 May 2021 08:55:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35358) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lf00W-0008MA-Jc for bug-gnu-emacs@gnu.org; Fri, 07 May 2021 08:55:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60416) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lf00U-0007gx-TD for bug-gnu-emacs@gnu.org; Fri, 07 May 2021 08:55:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lf00U-0006SW-Sq for bug-gnu-emacs@gnu.org; Fri, 07 May 2021 08:55:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 07 May 2021 12:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48264 X-GNU-PR-Package: emacs Original-Received: via spool by 48264-submit@debbugs.gnu.org id=B48264.162039208124803 (code B ref 48264); Fri, 07 May 2021 12:55:02 +0000 Original-Received: (at 48264) by debbugs.gnu.org; 7 May 2021 12:54:41 +0000 Original-Received: from localhost ([127.0.0.1]:43727 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lf008-0006Rz-PH for submit@debbugs.gnu.org; Fri, 07 May 2021 08:54:41 -0400 Original-Received: from venus.catern.com ([68.183.49.163]:59718) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lf007-0006Rt-BY for 48264@debbugs.gnu.org; Fri, 07 May 2021 08:54:39 -0400 Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=98.7.229.235; helo=localhost; envelope-from=sbaugh@catern.com; receiver= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=catern.com; s=mail; t=1620392076; bh=d+RQCXnoYcLyVodYhpeccLd163O2xdRiGEA5xKRkF7M=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=VqJ83TaS6VjHwzVOqDiBGyEQedUtvmL5PvZCDNKK2OeglVBAJa0GBU8nnDZCLqhVy fPfgGZwecuuJtU/gnxDu5eYnubDP5XBAOf32pIAmh9jxe7+X0oSNA5ZYJdTGN30iQI RkI9z8J9qAxbiXGv7+5pDV3HgRh33BQFf28Qc9ik= Original-Received: from localhost (cpe-98-7-229-235.nyc.res.rr.com [98.7.229.235]) by venus.catern.com (Postfix) with ESMTPSA id 620D42E9731; Fri, 7 May 2021 12:54:35 +0000 (UTC) In-Reply-To: <83bl9mde2m.fsf@gnu.org> 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:205926 Archived-At: Eli Zaretskii writes: >> From: Spencer Baugh >> Date: Thu, 6 May 2021 17:33:39 -0400 >> Cc: Spencer Baugh >> >> --- a/src/buffer.c >> +++ b/src/buffer.c >> @@ -54,8 +54,7 @@ along with GNU Emacs. If not, see . */ >> defined with DEFVAR_PER_BUFFER, that have special slots in each buffer. >> The default value occupies the same slot in this structure >> as an individual buffer's value occupies in that buffer. >> - Setting the default value also goes through the alist of buffers >> - and stores into each buffer that does not say it has a local value. */ >> +*/ > > This is a spurious change, please undo it. > >> @@ -1107,8 +1109,7 @@ BUFFER_CHECK_INDIRECTION (struct buffer *b) >> that have special slots in each buffer. >> The default value occupies the same slot in this structure >> as an individual buffer's value occupies in that buffer. >> - Setting the default value also goes through the alist of buffers >> - and stores into each buffer that does not say it has a local value. */ >> +*/ > > Likewise. Not sure what you mean about this being a spurious change - the comment is no longer accurate, setting the default value no longer does that as of this commit. >> +INLINE Lisp_Object >> +bvar_get (struct buffer *b, ptrdiff_t offset) > ^^^^^^^^ > How about calling this buffer_local_value instead? or maybe > bvar_get_value? Sure, any name works for me, although buffer_local_value already exists (and does something different). I can call it bvar_get_value though. >> @@ -1511,7 +1519,7 @@ KILL_PER_BUFFER_VALUE (struct buffer *b, int offset) >> { >> int idx = PER_BUFFER_IDX (offset); >> SET_PER_BUFFER_VALUE_P (b, idx, 0); >> - set_per_buffer_value (b, offset, per_buffer_default (offset)); >> + set_per_buffer_value (b, offset, Qunbound); >> } > > Hmm... I'm probably missing something here: what about per-buffer > variables that do have default values? how's that implemented in this > new implementation? If a variable that does have a default value, then setting the per-buffer variable to Qunbound will cause BVAR_OR_DEFAULT and bvar_get to return the default value. If the variable doesn't have a default value, then it's permanently buffer-local and it was always unsafe to call KILL_PER_BUFFER_VALUE on it - but fortunately, we never do that.