summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>1997-07-07 00:59:44 +0000
committerKenichi Handa <handa@m17n.org>1997-07-07 00:59:44 +0000
commiteb0df114f4ca87750da79f91fcbf3ef88e7b71f6 (patch)
tree652f68120eb56c2b37b2c61d211dff7e967eb5f5 /src
parentc0bdd7ccd6459dbed26b414f4dc11301c158c0bb (diff)
downloademacs-eb0df114f4ca87750da79f91fcbf3ef88e7b71f6.tar.gz
(Fcall_process): If enable-multibyte-characters is
nil, do not encode arguments for process, and decode output of process by emacs-mule. (Fcall_process_region): If enable-multibyte-characters is nil, do not encode text to be given to process, and decode output of process by emacs-mule.
Diffstat (limited to 'src')
-rw-r--r--src/callproc.c76
1 files changed, 52 insertions, 24 deletions
diff --git a/src/callproc.c b/src/callproc.c
index 14a439bc444..d463f099b26 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -245,7 +245,11 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.")
/* If arguments are supplied, we may have to encode them. */
if (nargs >= 5)
{
- if (NILP (val = Vcoding_system_for_write))
+ if (!NILP (Vcoding_system_for_write))
+ val = Vcoding_system_for_write;
+ else if (NILP (current_buffer->enable_multibyte_characters))
+ val = Qnil;
+ else
{
args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof *args2);
args2[0] = Qcall_process;
@@ -255,6 +259,8 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.")
val = XCONS (coding_systems)->cdr;
else if (CONSP (Vdefault_process_coding_system))
val = XCONS (Vdefault_process_coding_system)->cdr;
+ else
+ val = Qnil;
}
setup_coding_system (Fcheck_coding_system (val), &argument_coding);
}
@@ -266,7 +272,12 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.")
setup_coding_system (Qnil, &process_coding);
else if (!INTEGERP (args[2]))
{
- if (NILP (val = Vcoding_system_for_read))
+ val = Qnil;
+ if (!NILP (Vcoding_system_for_read))
+ val = Vcoding_system_for_read;
+ else if (NILP (current_buffer->enable_multibyte_characters))
+ val = Qemacs_mule;
+ else
{
if (!EQ (coding_systems, Qt))
{
@@ -280,6 +291,8 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.")
val = XCONS (coding_systems)->car;
else if (CONSP (Vdefault_process_coding_system))
val = XCONS (Vdefault_process_coding_system)->car;
+ else
+ val = Qnil;
}
setup_coding_system (Fcheck_coding_system (val), &process_coding);
}
@@ -781,17 +794,25 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.")
val = Qnil;
else
#endif
- if (NILP (val = Vcoding_system_for_write))
- {
- args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof *args2);
- args2[0] = Qcall_process_region;
- for (i = 0; i < nargs; i++) args2[i + 1] = args[i];
- coding_systems = Ffind_operation_coding_system (nargs + 1, args2);
- if (CONSP (coding_systems))
- val = XCONS (coding_systems)->cdr;
- else if (CONSP (Vdefault_process_coding_system))
- val = XCONS (Vdefault_process_coding_system)->car;
- }
+ {
+ if (!NILP (Vcoding_system_for_write))
+ val = Vcoding_system_for_write;
+ else if (NILP (current_buffer->enable_multibyte_characters))
+ val = Qnil;
+ else
+ {
+ args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof *args2);
+ args2[0] = Qcall_process_region;
+ for (i = 0; i < nargs; i++) args2[i + 1] = args[i];
+ coding_systems = Ffind_operation_coding_system (nargs + 1, args2);
+ if (CONSP (coding_systems))
+ val = XCONS (coding_systems)->cdr;
+ else if (CONSP (Vdefault_process_coding_system))
+ val = XCONS (Vdefault_process_coding_system)->car;
+ else
+ val = Qnil;
+ }
+ }
specbind (intern ("coding-system-for-write"), val);
Fwrite_region (start, end, filename_string, Qnil, Qlambda, Qnil);
@@ -800,17 +821,24 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.")
val = Qnil;
else
#endif
- if (NILP (val = Vcoding_system_for_read))
- {
- if (EQ (coding_systems, Qt))
- {
- args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof *args2);
- args2[0] = Qcall_process_region;
- for (i = 0; i < nargs; i++) args2[i + 1] = args[i];
- coding_systems = Ffind_operation_coding_system (nargs + 1, args2);
- }
- val = CONSP (coding_systems) ? XCONS (coding_systems)->car : Qnil;
- }
+ {
+ if (!NILP (Vcoding_system_for_read))
+ val = Vcoding_system_for_read;
+ else if (NILP (current_buffer->enable_multibyte_characters))
+ val = Qemacs_mule;
+ else
+ {
+ if (EQ (coding_systems, Qt))
+ {
+ args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof *args2);
+ args2[0] = Qcall_process_region;
+ for (i = 0; i < nargs; i++) args2[i + 1] = args[i];
+ coding_systems = Ffind_operation_coding_system (nargs + 1,
+ args2);
+ }
+ val = CONSP (coding_systems) ? XCONS (coding_systems)->car : Qnil;
+ }
+ }
specbind (intern ("coding-system-for-read"), val);
record_unwind_protect (delete_temp_file, filename_string);