diff options
| author | Kenichi Handa | 1997-07-07 00:59:44 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1997-07-07 00:59:44 +0000 |
| commit | beacaab334c21bbf0e15ccd8af4e870414c88ee5 (patch) | |
| tree | ca82e1b8ef0b4865368be3cfc0b227149e50c2d1 /src/callproc.c | |
| parent | 9ce27fde6aa0eb078153dd5ac37992bf1722a669 (diff) | |
| download | emacs-beacaab334c21bbf0e15ccd8af4e870414c88ee5.tar.gz emacs-beacaab334c21bbf0e15ccd8af4e870414c88ee5.zip | |
(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/callproc.c')
| -rw-r--r-- | src/callproc.c | 76 |
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.") | |||
| 245 | /* If arguments are supplied, we may have to encode them. */ | 245 | /* If arguments are supplied, we may have to encode them. */ |
| 246 | if (nargs >= 5) | 246 | if (nargs >= 5) |
| 247 | { | 247 | { |
| 248 | if (NILP (val = Vcoding_system_for_write)) | 248 | if (!NILP (Vcoding_system_for_write)) |
| 249 | val = Vcoding_system_for_write; | ||
| 250 | else if (NILP (current_buffer->enable_multibyte_characters)) | ||
| 251 | val = Qnil; | ||
| 252 | else | ||
| 249 | { | 253 | { |
| 250 | args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof *args2); | 254 | args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof *args2); |
| 251 | args2[0] = Qcall_process; | 255 | args2[0] = Qcall_process; |
| @@ -255,6 +259,8 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.") | |||
| 255 | val = XCONS (coding_systems)->cdr; | 259 | val = XCONS (coding_systems)->cdr; |
| 256 | else if (CONSP (Vdefault_process_coding_system)) | 260 | else if (CONSP (Vdefault_process_coding_system)) |
| 257 | val = XCONS (Vdefault_process_coding_system)->cdr; | 261 | val = XCONS (Vdefault_process_coding_system)->cdr; |
| 262 | else | ||
| 263 | val = Qnil; | ||
| 258 | } | 264 | } |
| 259 | setup_coding_system (Fcheck_coding_system (val), &argument_coding); | 265 | setup_coding_system (Fcheck_coding_system (val), &argument_coding); |
| 260 | } | 266 | } |
| @@ -266,7 +272,12 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.") | |||
| 266 | setup_coding_system (Qnil, &process_coding); | 272 | setup_coding_system (Qnil, &process_coding); |
| 267 | else if (!INTEGERP (args[2])) | 273 | else if (!INTEGERP (args[2])) |
| 268 | { | 274 | { |
| 269 | if (NILP (val = Vcoding_system_for_read)) | 275 | val = Qnil; |
| 276 | if (!NILP (Vcoding_system_for_read)) | ||
| 277 | val = Vcoding_system_for_read; | ||
| 278 | else if (NILP (current_buffer->enable_multibyte_characters)) | ||
| 279 | val = Qemacs_mule; | ||
| 280 | else | ||
| 270 | { | 281 | { |
| 271 | if (!EQ (coding_systems, Qt)) | 282 | if (!EQ (coding_systems, Qt)) |
| 272 | { | 283 | { |
| @@ -280,6 +291,8 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.") | |||
| 280 | val = XCONS (coding_systems)->car; | 291 | val = XCONS (coding_systems)->car; |
| 281 | else if (CONSP (Vdefault_process_coding_system)) | 292 | else if (CONSP (Vdefault_process_coding_system)) |
| 282 | val = XCONS (Vdefault_process_coding_system)->car; | 293 | val = XCONS (Vdefault_process_coding_system)->car; |
| 294 | else | ||
| 295 | val = Qnil; | ||
| 283 | } | 296 | } |
| 284 | setup_coding_system (Fcheck_coding_system (val), &process_coding); | 297 | setup_coding_system (Fcheck_coding_system (val), &process_coding); |
| 285 | } | 298 | } |
| @@ -781,17 +794,25 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.") | |||
| 781 | val = Qnil; | 794 | val = Qnil; |
| 782 | else | 795 | else |
| 783 | #endif | 796 | #endif |
| 784 | if (NILP (val = Vcoding_system_for_write)) | 797 | { |
| 785 | { | 798 | if (!NILP (Vcoding_system_for_write)) |
| 786 | args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof *args2); | 799 | val = Vcoding_system_for_write; |
| 787 | args2[0] = Qcall_process_region; | 800 | else if (NILP (current_buffer->enable_multibyte_characters)) |
| 788 | for (i = 0; i < nargs; i++) args2[i + 1] = args[i]; | 801 | val = Qnil; |
| 789 | coding_systems = Ffind_operation_coding_system (nargs + 1, args2); | 802 | else |
| 790 | if (CONSP (coding_systems)) | 803 | { |
| 791 | val = XCONS (coding_systems)->cdr; | 804 | args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof *args2); |
| 792 | else if (CONSP (Vdefault_process_coding_system)) | 805 | args2[0] = Qcall_process_region; |
| 793 | val = XCONS (Vdefault_process_coding_system)->car; | 806 | for (i = 0; i < nargs; i++) args2[i + 1] = args[i]; |
| 794 | } | 807 | coding_systems = Ffind_operation_coding_system (nargs + 1, args2); |
| 808 | if (CONSP (coding_systems)) | ||
| 809 | val = XCONS (coding_systems)->cdr; | ||
| 810 | else if (CONSP (Vdefault_process_coding_system)) | ||
| 811 | val = XCONS (Vdefault_process_coding_system)->car; | ||
| 812 | else | ||
| 813 | val = Qnil; | ||
| 814 | } | ||
| 815 | } | ||
| 795 | specbind (intern ("coding-system-for-write"), val); | 816 | specbind (intern ("coding-system-for-write"), val); |
| 796 | Fwrite_region (start, end, filename_string, Qnil, Qlambda, Qnil); | 817 | Fwrite_region (start, end, filename_string, Qnil, Qlambda, Qnil); |
| 797 | 818 | ||
| @@ -800,17 +821,24 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.") | |||
| 800 | val = Qnil; | 821 | val = Qnil; |
| 801 | else | 822 | else |
| 802 | #endif | 823 | #endif |
| 803 | if (NILP (val = Vcoding_system_for_read)) | 824 | { |
| 804 | { | 825 | if (!NILP (Vcoding_system_for_read)) |
| 805 | if (EQ (coding_systems, Qt)) | 826 | val = Vcoding_system_for_read; |
| 806 | { | 827 | else if (NILP (current_buffer->enable_multibyte_characters)) |
| 807 | args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof *args2); | 828 | val = Qemacs_mule; |
| 808 | args2[0] = Qcall_process_region; | 829 | else |
| 809 | for (i = 0; i < nargs; i++) args2[i + 1] = args[i]; | 830 | { |
| 810 | coding_systems = Ffind_operation_coding_system (nargs + 1, args2); | 831 | if (EQ (coding_systems, Qt)) |
| 811 | } | 832 | { |
| 812 | val = CONSP (coding_systems) ? XCONS (coding_systems)->car : Qnil; | 833 | args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof *args2); |
| 813 | } | 834 | args2[0] = Qcall_process_region; |
| 835 | for (i = 0; i < nargs; i++) args2[i + 1] = args[i]; | ||
| 836 | coding_systems = Ffind_operation_coding_system (nargs + 1, | ||
| 837 | args2); | ||
| 838 | } | ||
| 839 | val = CONSP (coding_systems) ? XCONS (coding_systems)->car : Qnil; | ||
| 840 | } | ||
| 841 | } | ||
| 814 | specbind (intern ("coding-system-for-read"), val); | 842 | specbind (intern ("coding-system-for-read"), val); |
| 815 | 843 | ||
| 816 | record_unwind_protect (delete_temp_file, filename_string); | 844 | record_unwind_protect (delete_temp_file, filename_string); |