comparison src/coding.c @ 46838:395572099269

(Ffind_operation_coding_system): For write-region, if VISIT is a filename, make it the target.
author Kenichi Handa <handa@m17n.org>
date Thu, 08 Aug 2002 12:34:27 +0000
parents 2673ae55a6f9
children 4acadb428f41
comparison
equal deleted inserted replaced
46837:e90f0ad8133a 46838:395572099269
6876 || !INTEGERP (target_idx = Fget (operation, Qtarget_idx))) 6876 || !INTEGERP (target_idx = Fget (operation, Qtarget_idx)))
6877 error ("Invalid first argument"); 6877 error ("Invalid first argument");
6878 if (nargs < 1 + XINT (target_idx)) 6878 if (nargs < 1 + XINT (target_idx))
6879 error ("Too few arguments for operation: %s", 6879 error ("Too few arguments for operation: %s",
6880 SDATA (SYMBOL_NAME (operation))); 6880 SDATA (SYMBOL_NAME (operation)));
6881 /* For write-region, if the 6th argument (i.e. VISIT, the 5th
6882 argument to write-region) is string, it must be treated as a
6883 target file name. */
6884 if (EQ (operation, Qwrite_region)
6885 && nargs > 5
6886 && STRINGP (args[5]))
6887 target_idx = 4;
6881 target = args[XINT (target_idx) + 1]; 6888 target = args[XINT (target_idx) + 1];
6882 if (!(STRINGP (target) 6889 if (!(STRINGP (target)
6883 || (EQ (operation, Qopen_network_stream) && INTEGERP (target)))) 6890 || (EQ (operation, Qopen_network_stream) && INTEGERP (target))))
6884 error ("Invalid argument %d", XINT (target_idx) + 1); 6891 error ("Invalid argument %d", XINT (target_idx) + 1);
6885 6892