From 5431bd6a789edd0ef05b5be0a1a33355849c164f Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 25 Mar 2008 17:35:48 +0000 Subject: [PATCH] * process.h (struct Lisp_Process): Remove filter_multibyte. * process.c (QCfilter_multibyte): Remove. (setup_process_coding_systems): Don't use filter_multibyte. (Fstart_process, Fmake_network_process): Don't set filter_multibyte. (read_process_output): Don't adjust multibyteness to filter_multibyte. (Fset_process_filter_multibyte): Change the coding-system to approximate the previous behavior. (Fprocess_filter_multibyte_p): Get the multibyteness straight from the coding-system. --- src/ChangeLog | 10 ++++++++++ src/process.c | 27 ++++++--------------------- src/process.h | 6 ------ 3 files changed, 16 insertions(+), 27 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 6f65379c23e..e86aabb4ae5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,15 @@ 2008-03-25 Stefan Monnier + * process.h (struct Lisp_Process): Remove filter_multibyte. + * process.c (QCfilter_multibyte): Remove. + (setup_process_coding_systems): Don't use filter_multibyte. + (Fstart_process, Fmake_network_process): Don't set filter_multibyte. + (read_process_output): Don't adjust multibyteness to filter_multibyte. + (Fset_process_filter_multibyte): Change the coding-system to + approximate the previous behavior. + (Fprocess_filter_multibyte_p): Get the multibyteness straight from the + coding-system. + * coding.c (decode_coding_object): When not decoding into a buffer, obey the coding system's preference of (uni|multi)byte. diff --git a/src/process.c b/src/process.c index e959dea41c0..9c7e542c3be 100644 --- a/src/process.c +++ b/src/process.c @@ -145,7 +145,6 @@ Lisp_Object QCname, QCbuffer, QChost, QCservice, QCtype; Lisp_Object QClocal, QCremote, QCcoding; Lisp_Object QCserver, QCnowait, QCnoquery, QCstop; Lisp_Object QCsentinel, QClog, QCoptions, QCplist; -Lisp_Object QCfilter_multibyte; Lisp_Object Qlast_nonmenu_event; /* QCfamily is declared and initialized in xfaces.c, QCfilter in keyboard.c. */ @@ -670,10 +669,7 @@ setup_process_coding_systems (process) = (struct coding_system *) xmalloc (sizeof (struct coding_system)); coding_system = p->decode_coding_system; if (! NILP (p->filter)) - { - if (!p->filter_multibyte) - coding_system = raw_text_coding_system (coding_system); - } + ; else if (BUFFERP (p->buffer)) { if (NILP (XBUFFER (p->buffer)->enable_multibyte_characters)) @@ -1628,8 +1624,6 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */) XPROCESS (proc)->buffer = buffer; XPROCESS (proc)->sentinel = Qnil; XPROCESS (proc)->filter = Qnil; - XPROCESS (proc)->filter_multibyte - = !NILP (buffer_defaults.enable_multibyte_characters); XPROCESS (proc)->command = Flist (nargs - 2, args + 2); #ifdef ADAPTIVE_READ_BUFFERING @@ -3407,10 +3401,6 @@ usage: (make-network-process &rest ARGS) */) p->buffer = buffer; p->sentinel = sentinel; p->filter = filter; - p->filter_multibyte = !NILP (buffer_defaults.enable_multibyte_characters); - /* Override the above only if :filter-multibyte is specified. */ - if (! NILP (Fplist_member (contact, QCfilter_multibyte))) - p->filter_multibyte = !NILP (Fplist_get (contact, QCfilter_multibyte)); p->log = Fplist_get (contact, QClog); if (tem = Fplist_get (contact, QCnoquery), !NILP (tem)) p->kill_without_query = 1; @@ -5169,11 +5159,6 @@ read_process_output (proc, channel) coding->carryover_bytes); p->decoding_carryover = coding->carryover_bytes; } - /* Adjust the multibyteness of TEXT to that of the filter. */ - if (!p->filter_multibyte != !STRING_MULTIBYTE (text)) - text = (STRING_MULTIBYTE (text) - ? Fstring_as_unibyte (text) - : Fstring_to_multibyte (text)); if (SBYTES (text) > 0) internal_condition_case_1 (read_process_output_call, Fcons (outstream, @@ -6834,7 +6819,8 @@ suppressed. */) CHECK_PROCESS (process); p = XPROCESS (process); - p->filter_multibyte = !NILP (flag); + if (NILP (flag)) + p->decode_coding_system = raw_text_coding_system (p->decode_coding_system); setup_process_coding_systems (process); return Qnil; @@ -6847,11 +6833,12 @@ DEFUN ("process-filter-multibyte-p", Fprocess_filter_multibyte_p, Lisp_Object process; { register struct Lisp_Process *p; + struct coding_system *coding; CHECK_PROCESS (process); p = XPROCESS (process); - - return (p->filter_multibyte ? Qt : Qnil); + coding = proc_decode_coding_system[p->infd]; + return (CODING_FOR_UNIBYTE (coding) ? Qnil : Qt); } @@ -7109,8 +7096,6 @@ syms_of_process () staticpro (&QCoptions); QCplist = intern (":plist"); staticpro (&QCplist); - QCfilter_multibyte = intern (":filter-multibyte"); - staticpro (&QCfilter_multibyte); Qlast_nonmenu_event = intern ("last-nonmenu-event"); staticpro (&Qlast_nonmenu_event); diff --git a/src/process.h b/src/process.h index dccb0cd2af9..8223801c11c 100644 --- a/src/process.h +++ b/src/process.h @@ -113,12 +113,6 @@ struct Lisp_Process /* Flag to set coding-system of the process buffer from the coding_system used to decode process output. */ unsigned int inherit_coding_system_flag : 1; - /* Flag to decide the multibyteness of a string given to the - filter (if any). It is initialized to the value of - `default-enable-multibyte-characters' when the process is - generated, and can be changed by the function - `set-process-filter-multibyte'. */ - unsigned int filter_multibyte : 1; /* Record the process status in the raw form in which it comes from `wait'. This is to avoid consing in a signal handler. The `raw_status_new' flag indicates that `raw_status' contains a new status that still -- 2.39.2