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 v4 10/14] Delete SET_PER_BUFFER_VALUE_P and buffer local_flags field Date: Fri, 7 May 2021 22:09:01 -0400 Message-ID: <20210508020905.13583-12-sbaugh@catern.com> References: <20210506213346.9730-1-sbaugh@catern.com> <20210508020905.13583-1-sbaugh@catern.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4794"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Spencer Baugh To: 48264@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 08 04:49:50 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 1lfD2L-00018Y-Kf for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 May 2021 04:49:49 +0200 Original-Received: from localhost ([::1]:46616 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lfD2K-0002Hr-NS for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 07 May 2021 22:49:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44802) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lfCPu-0001MJ-U7 for bug-gnu-emacs@gnu.org; Fri, 07 May 2021 22:10:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35653) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lfCPu-0007ZL-NE for bug-gnu-emacs@gnu.org; Fri, 07 May 2021 22:10:06 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lfCPu-0006VV-JX for bug-gnu-emacs@gnu.org; Fri, 07 May 2021 22:10:06 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 May 2021 02:10:06 +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.162043978424895 (code B ref 48264); Sat, 08 May 2021 02:10:06 +0000 Original-Received: (at 48264) by debbugs.gnu.org; 8 May 2021 02:09:44 +0000 Original-Received: from localhost ([127.0.0.1]:47179 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lfCPX-0006TN-Ji for submit@debbugs.gnu.org; Fri, 07 May 2021 22:09:44 -0400 Original-Received: from venus.catern.com ([68.183.49.163]:47938) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lfCPE-0006SC-TM for 48264@debbugs.gnu.org; Fri, 07 May 2021 22:09:25 -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=1620439764; bh=MEyy0A2YP8u5ssAThorcbaLAo1cSywAys80Leu8gxqY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=DbI29vwbWLPpLT/AMM1mpms2qWy4FqNvRgqgmvTp3w9MNzn0stXqiLC3Vn1AQ2+jM idDOtpq/1pfsvMus0OlLxyaPqedtH9w+EmEWOmQHxZLIxg4NdZp7BeLfBnL9VMvL2J ToIjloE5pL+tsHg3vcPfc4HtMYMfN2aJFjul6wy0= 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 C734F2E9830; Sat, 8 May 2021 02:09:24 +0000 (UTC) X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210508020905.13583-1-sbaugh@catern.com> 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:205981 Archived-At: SET_PER_BUFFER_VALUE_P is now obsolete. Whether a per-buffer variable has a buffer-local value is now determined purely by the value stored in the field; if it's set to Qunbound, there's no buffer-local value, and anything else means there is a buffer-local value. Thus merely setting the field is sufficient to make the variable buffer-local, and so we have no more need for a separate SET_PER_BUFFER_VALUE_P to update the metadata, nor any need for the metadata itself. * src/buffer.h (struct buffer): Remove local_flags field. (SET_PER_BUFFER_VALUE_P): Remove. (KILL_PER_BUFFER_VALUE): Stop using SET_PER_BUFFER_VALUE_P. * src/buffer.c (Fget_buffer_create, clone_per_buffer_values) (Fmake_indirect_buffer): Stop initializing local_flags. * src/category.c (Fset_category_table): * src/data.c (store_symval_forwarding): * src/syntax.c (Fset_syntax_table): Stop using SET_PER_BUFFER_VALUE_P. * src/pdumper.c (dump_buffer): Stop dumping local_flags field. --- src/buffer.c | 6 ------ src/buffer.h | 19 ------------------- src/category.c | 4 ---- src/data.c | 3 --- src/pdumper.c | 3 --- src/syntax.c | 4 ---- 6 files changed, 39 deletions(-) diff --git a/src/buffer.c b/src/buffer.c index b4345ca308..a7d31c1e5b 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -560,8 +560,6 @@ even if it is dead. The return value is never nil. */) /* No one shows us now. */ b->window_count = 0; - memset (&b->local_flags, 0, sizeof (b->local_flags)); - BUF_GAP_SIZE (b) = 20; block_input (); /* We allocate extra 1-byte at the tail and keep it always '\0' for @@ -717,8 +715,6 @@ clone_per_buffer_values (struct buffer *from, struct buffer *to) set_per_buffer_value (to, offset, obj); } - memcpy (to->local_flags, from->local_flags, sizeof to->local_flags); - set_buffer_overlays_before (to, copy_overlays (to, from->overlays_before)); set_buffer_overlays_after (to, copy_overlays (to, from->overlays_after)); @@ -820,8 +816,6 @@ CLONE nil means the indirect buffer's state is reset to default values. */) /* Always -1 for an indirect buffer. */ b->window_count = -1; - memset (&b->local_flags, 0, sizeof (b->local_flags)); - b->pt = b->base_buffer->pt; b->begv = b->base_buffer->begv; b->zv = b->base_buffer->zv; diff --git a/src/buffer.h b/src/buffer.h index db725250d6..0445fe0edf 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -605,13 +605,6 @@ struct buffer an indirect buffer since it counts as its base buffer. */ int window_count; - /* A non-zero value in slot IDX means that per-buffer variable - with index IDX has a local value in this buffer. The index IDX - for a buffer-local variable is stored in that variable's slot - in buffer_local_flags as a Lisp integer. If the index is -1, - this means the variable is always local in all buffers. */ - char local_flags[MAX_PER_BUFFER_VARS]; - /* Set to the modtime of the visited file when read or written. modtime.tv_nsec == NONEXISTENT_MODTIME_NSECS means visited file was nonexistent. modtime.tv_nsec == @@ -1417,16 +1410,6 @@ OVERLAY_POSITION (Lisp_Object p) extern bool valid_per_buffer_idx (int); -/* Set whether per-buffer variable with index IDX has a buffer-local - value in buffer B. VAL zero means it hasn't. */ - -INLINE void -SET_PER_BUFFER_VALUE_P (struct buffer *b, int idx, bool val) -{ - eassert (valid_per_buffer_idx (idx)); - b->local_flags[idx] = val; -} - /* Return the index value of the per-buffer variable at offset OFFSET in the buffer structure. @@ -1516,8 +1499,6 @@ bvar_get_value (struct buffer *b, ptrdiff_t offset) INLINE void 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, Qunbound); } diff --git a/src/category.c b/src/category.c index 522f4da697..a9f5225df8 100644 --- a/src/category.c +++ b/src/category.c @@ -268,12 +268,8 @@ DEFUN ("set-category-table", Fset_category_table, Sset_category_table, 1, 1, 0, Return TABLE. */) (Lisp_Object table) { - int idx; table = check_category_table (table); bset_category_table (current_buffer, table); - /* Indicate that this buffer now has a specified category table. */ - idx = PER_BUFFER_VAR_IDX (category_table); - SET_PER_BUFFER_VALUE_P (current_buffer, idx, 1); return table; } diff --git a/src/data.c b/src/data.c index 6835699236..30f8523af8 100644 --- a/src/data.c +++ b/src/data.c @@ -1295,9 +1295,6 @@ store_symval_forwarding (lispfwd valcontents, Lisp_Object newval, if (buf == NULL) buf = current_buffer; set_per_buffer_value (buf, offset, newval); - int idx = PER_BUFFER_IDX (offset); - if (idx > 0) - SET_PER_BUFFER_VALUE_P (buf, idx, 1); } break; diff --git a/src/pdumper.c b/src/pdumper.c index dfc7388b63..1e2e5238c7 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -2802,9 +2802,6 @@ dump_buffer (struct dump_context *ctx, const struct buffer *in_buffer) DUMP_FIELD_COPY (out, buffer, indirections); DUMP_FIELD_COPY (out, buffer, window_count); - memcpy (out->local_flags, - &buffer->local_flags, - sizeof (out->local_flags)); DUMP_FIELD_COPY (out, buffer, modtime); DUMP_FIELD_COPY (out, buffer, modtime_size); DUMP_FIELD_COPY (out, buffer, auto_save_modified); diff --git a/src/syntax.c b/src/syntax.c index 17753f50b7..f2fbab1525 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -1042,12 +1042,8 @@ DEFUN ("set-syntax-table", Fset_syntax_table, Sset_syntax_table, 1, 1, 0, One argument, a syntax table. */) (Lisp_Object table) { - int idx; check_syntax_table (table); bset_syntax_table (current_buffer, table); - /* Indicate that this buffer now has a specified syntax table. */ - idx = PER_BUFFER_VAR_IDX (syntax_table); - SET_PER_BUFFER_VALUE_P (current_buffer, idx, 1); return table; } -- 2.31.1