[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 03/16] Stop checking the constant default for enable_multibyte
From: |
Spencer Baugh |
Subject: |
[PATCH v2 03/16] Stop checking the constant default for enable_multibyte_characters |
Date: |
Sat, 21 Nov 2020 21:34:32 -0500 |
The default is a constant "t", and can't be changed. So we don't need
to check it.
---
src/buffer.c | 5 +----
src/print.c | 6 ++----
src/process.c | 15 ++++-----------
3 files changed, 7 insertions(+), 19 deletions(-)
diff --git a/src/buffer.c b/src/buffer.c
index 360dd348e0..33b64e1010 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -971,8 +971,7 @@ reset_buffer (register struct buffer *b)
bset_last_selected_window (b, Qnil);
bset_display_count (b, make_fixnum (0));
bset_display_time (b, Qnil);
- bset_enable_multibyte_characters
- (b, BVAR (&buffer_defaults, enable_multibyte_characters));
+ bset_enable_multibyte_characters (b, Qt);
bset_cursor_type (b, BVAR (&buffer_defaults, cursor_type));
bset_extra_line_spacing (b, BVAR (&buffer_defaults, extra_line_spacing));
@@ -5397,8 +5396,6 @@ init_buffer (void)
AUTO_STRING (scratch, "*scratch*");
Fset_buffer (Fget_buffer_create (scratch));
- if (NILP (BVAR (&buffer_defaults, enable_multibyte_characters)))
- Fset_buffer_multibyte (Qnil);
char const *pwd = emacs_wd;
diff --git a/src/print.c b/src/print.c
index 008bf5e639..ac8e641bea 100644
--- a/src/print.c
+++ b/src/print.c
@@ -453,8 +453,7 @@ print_string (Lisp_Object string, Lisp_Object printcharfun)
chars = SCHARS (string);
else if (! print_escape_nonascii
&& (EQ (printcharfun, Qt)
- ? ! NILP (BVAR (&buffer_defaults,
enable_multibyte_characters))
- : ! NILP (BVAR (current_buffer,
enable_multibyte_characters))))
+ || ! NILP (BVAR (current_buffer,
enable_multibyte_characters))))
{
/* If unibyte string STRING contains 8-bit codes, we must
convert STRING to a multibyte string containing the same
@@ -572,8 +571,7 @@ temp_output_buffer_setup (const char *bufname)
bset_undo_list (current_buffer, Qt);
eassert (current_buffer->overlays_before == NULL);
eassert (current_buffer->overlays_after == NULL);
- bset_enable_multibyte_characters
- (current_buffer, BVAR (&buffer_defaults, enable_multibyte_characters));
+ bset_enable_multibyte_characters (current_buffer, Qt);
specbind (Qinhibit_read_only, Qt);
specbind (Qinhibit_modification_hooks, Qt);
Ferase_buffer ();
diff --git a/src/process.c b/src/process.c
index bf64ead24e..a6062e34c6 100644
--- a/src/process.c
+++ b/src/process.c
@@ -2484,8 +2484,7 @@ usage: (make-pipe-process &rest ARGS) */)
}
else if (!NILP (Vcoding_system_for_read))
val = Vcoding_system_for_read;
- else if ((!NILP (buffer) && NILP (BVAR (XBUFFER (buffer),
enable_multibyte_characters)))
- || (NILP (buffer) && NILP (BVAR (&buffer_defaults,
enable_multibyte_characters))))
+ else if (!NILP (buffer) && NILP (BVAR (XBUFFER (buffer),
enable_multibyte_characters)))
/* We dare not decode end-of-line format by setting VAL to
Qraw_text, because the existing Emacs Lisp libraries
assume that they receive bare code including a sequence of
@@ -2510,8 +2509,6 @@ usage: (make-pipe-process &rest ARGS) */)
}
else if (!NILP (Vcoding_system_for_write))
val = Vcoding_system_for_write;
- else if (NILP (BVAR (current_buffer, enable_multibyte_characters)))
- val = Qnil;
else
{
if (CONSP (coding_systems))
@@ -3204,8 +3201,7 @@ usage: (make-serial-process &rest ARGS) */)
}
else if (!NILP (Vcoding_system_for_read))
val = Vcoding_system_for_read;
- else if ((!NILP (buffer) && NILP (BVAR (XBUFFER (buffer),
enable_multibyte_characters)))
- || (NILP (buffer) && NILP (BVAR (&buffer_defaults,
enable_multibyte_characters))))
+ else if (!NILP (buffer) && NILP (BVAR (XBUFFER (buffer),
enable_multibyte_characters)))
val = Qnil;
pset_decode_coding_system (p, val);
@@ -3218,8 +3214,7 @@ usage: (make-serial-process &rest ARGS) */)
}
else if (!NILP (Vcoding_system_for_write))
val = Vcoding_system_for_write;
- else if ((!NILP (buffer) && NILP (BVAR (XBUFFER (buffer),
enable_multibyte_characters)))
- || (NILP (buffer) && NILP (BVAR (&buffer_defaults,
enable_multibyte_characters))))
+ else if (!NILP (buffer) && NILP (BVAR (XBUFFER (buffer),
enable_multibyte_characters)))
val = Qnil;
pset_encode_coding_system (p, val);
@@ -3261,9 +3256,7 @@ set_network_socket_coding_system (Lisp_Object proc,
Lisp_Object host,
else if (!NILP (Vcoding_system_for_read))
val = Vcoding_system_for_read;
else if ((!NILP (p->buffer)
- && NILP (BVAR (XBUFFER (p->buffer), enable_multibyte_characters)))
- || (NILP (p->buffer)
- && NILP (BVAR (&buffer_defaults, enable_multibyte_characters))))
+ && NILP (BVAR (XBUFFER (p->buffer), enable_multibyte_characters))))
/* We dare not decode end-of-line format by setting VAL to
Qraw_text, because the existing Emacs Lisp libraries
assume that they receive bare code including a sequence of
--
2.28.0
- [PATCH 02/10] Add bset_save_length and use it, (continued)
- [PATCH 02/10] Add bset_save_length and use it, Spencer Baugh, 2020/11/19
- [PATCH 04/10] Use bset_enable_multibyte_characters everywhere, Spencer Baugh, 2020/11/19
- [PATCH 00/10] Speeding up DEFVAR_PER_BUFFER (Was: ido-switch-buffer is slow), Spencer Baugh, 2020/11/19
- Re: [PATCH 00/10] Speeding up DEFVAR_PER_BUFFER, Stefan Monnier, 2020/11/19
- [PATCH v2 00/16] Speeding up DEFVAR_PER_BUFFER, Spencer Baugh, 2020/11/21
- [PATCH v2 01/16] Add a test for let-binding unwinding, Spencer Baugh, 2020/11/21
- Re: [PATCH v2 01/16] Add a test for let-binding unwinding, Stefan Monnier, 2020/11/25
- [PATCH v2 05/16] Add BVAR_DEFAULT for access to buffer defaults, Spencer Baugh, 2020/11/21
- [PATCH v2 02/16] Assert not local-variable-p after setq in let_default binding, Spencer Baugh, 2020/11/21
- Re: [PATCH v2 02/16] Assert not local-variable-p after setq in let_default binding, Stefan Monnier, 2020/11/25
- [PATCH v2 03/16] Stop checking the constant default for enable_multibyte_characters,
Spencer Baugh <=
- Re: [PATCH v2 03/16] Stop checking the constant default for enable_multibyte_characters, Stefan Monnier, 2020/11/25
- [PATCH v2 04/16] Take buffer field name in DEFVAR_PER_BUFFER, Spencer Baugh, 2020/11/21
- [PATCH v2 08/16] Combine unnecessarily separate loops in buffer.c, Spencer Baugh, 2020/11/21
- [PATCH v2 09/16] Add and use BUFFER_DEFAULT_VALUE_P, Spencer Baugh, 2020/11/21
- [PATCH v2 06/16] Use bset_* functions instead of BVAR, Spencer Baugh, 2020/11/21
- [PATCH v2 07/16] Take offset not idx in PER_BUFFER_VALUE_P, Spencer Baugh, 2020/11/21
- [PATCH v2 11/16] Assert that PER_BUFFER_IDX for Lisp variables is not 0, Spencer Baugh, 2020/11/21
- [PATCH v2 14/16] Remove unnecessary Qunbound check, Spencer Baugh, 2020/11/21
- [PATCH v2 10/16] Add and use KILL_PER_BUFFER_VALUE, Spencer Baugh, 2020/11/21
- [PATCH v2 13/16] Get rid of buffer_permanent_local_flags array, Spencer Baugh, 2020/11/21