From: Kenichi Handa Date: Thu, 8 Aug 2002 12:39:27 +0000 (+0000) Subject: (Ffind_operation_coding_system): For write-region, if X-Git-Tag: emacs-pretest-21.2.91~127 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bcd4312495461d9edc5105a3c67b0580f9419230;p=emacs.git (Ffind_operation_coding_system): For write-region, if VISIT is a filename, make it the target. --- diff --git a/src/coding.c b/src/coding.c index 50e84d1cd9c..b42beb17201 100644 --- a/src/coding.c +++ b/src/coding.c @@ -6838,6 +6838,13 @@ which is a list of all the arguments given to this function.") if (nargs < 1 + XINT (target_idx)) error ("Too few arguments for operation: %s", XSYMBOL (operation)->name->data); + /* For write-region, if the 6th argument (i.e. VISIT, the 5th + argument to write-region) is string, it must be treated as a + target file name. */ + if (EQ (operation, Qwrite_region) + && nargs > 5 + && STRINGP (args[5])) + target_idx = 4; target = args[XINT (target_idx) + 1]; if (!(STRINGP (target) || (EQ (operation, Qopen_network_stream) && INTEGERP (target))))