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.devel Subject: [PATCH 3/7] Stop checking the constant default for enable_multibyte_characters Date: Tue, 23 Mar 2021 23:11:53 -0400 Message-ID: <19631b9178f5a540ae3908b695d3e70a6212371f.1616554376.git.sbaugh@catern.com> References: Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8271"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Spencer Baugh , Eli Zaretskii , Stefan Monnier To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Mar 24 04:14:00 2021 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 1lOty2-00020M-Uv for ged-emacs-devel@m.gmane-mx.org; Wed, 24 Mar 2021 04:13:59 +0100 Original-Received: from localhost ([::1]:48294 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lOty1-0007qw-Vl for ged-emacs-devel@m.gmane-mx.org; Tue, 23 Mar 2021 23:13:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58712) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOtwO-000688-1k for emacs-devel@gnu.org; Tue, 23 Mar 2021 23:12:16 -0400 Original-Received: from venus.catern.com ([68.183.49.163]:45428) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOtwI-0000jB-EU; Tue, 23 Mar 2021 23:12:15 -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=1616555529; bh=RPfnl8Zy1Kh1SYiJM05k5E+XLj8nxWStGqmVlgBZhEA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=fOzJ0Pb+Ni2g+DAqfAzUGLuWgVUjB6pfl2AWmRjs+e7Lr/fzBsQftWewdC6p1Fqxe pZE4Da7CaAGYpQ4zYC8JED43/J8rZpJqS3CXuFm7V/sJztqRmUqXUxrkMjl3gpPiAR iYqb/Q1tpc4bltxm0JAP5ZLwQ3KgX+QSQrgK2p5Y= 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 6E1C72E66F5; Wed, 24 Mar 2021 03:12:09 +0000 (UTC) X-Mailer: git-send-email 2.28.0 In-Reply-To: Received-SPF: pass client-ip=68.183.49.163; envelope-from=sbaugh@catern.com; helo=venus.catern.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:266907 Archived-At: The default is a constant "t", and can't be changed. So we don't need to check it. * src/buffer.c (reset_buffer, init_buffer): * src/print.c (print_string, temp_output_buffer_setup): * src/process.c (Fmake_pipe_process, Fmake_serial_process) (set_network_socket_coding_system): Don't check buffer_defaults for enable_multibyte_characters --- src/buffer.c | 7 ++----- src/print.c | 6 ++---- src/process.c | 15 ++++----------- 3 files changed, 8 insertions(+), 20 deletions(-) diff --git a/src/buffer.c b/src/buffer.c index 8e33162989..9d87803cc6 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -988,8 +988,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)); @@ -5405,9 +5404,7 @@ init_buffer (void) #endif /* USE_MMAP_FOR_BUFFERS */ AUTO_STRING (scratch, "*scratch*"); - Fset_buffer (Fget_buffer_create (scratch, Qnil)); - if (NILP (BVAR (&buffer_defaults, enable_multibyte_characters))) - Fset_buffer_multibyte (Qnil); + Fset_buffer (Fget_buffer_create (scratch)); char const *pwd = emacs_wd; diff --git a/src/print.c b/src/print.c index 14af919547..0f1987c405 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 b98bc297a3..c084dca4d0 100644 --- a/src/process.c +++ b/src/process.c @@ -2399,8 +2399,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 @@ -2425,8 +2424,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)) @@ -3124,8 +3121,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); @@ -3138,8 +3134,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); @@ -3181,9 +3176,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