]> git.eshelyaron.com Git - emacs.git/commitdiff
(Ffind_operation_coding_system): For write-region, if
authorKenichi Handa <handa@m17n.org>
Thu, 8 Aug 2002 12:39:27 +0000 (12:39 +0000)
committerKenichi Handa <handa@m17n.org>
Thu, 8 Aug 2002 12:39:27 +0000 (12:39 +0000)
VISIT is a filename, make it the target.

src/coding.c

index 50e84d1cd9c2921210512b831384922de3c61e84..b42beb1720153cec95e111ebcb49acf376fb18f0 100644 (file)
@@ -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))))