Mercurial > emacs
diff 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 |
line wrap: on
line diff
--- a/src/coding.c Thu Aug 08 12:34:08 2002 +0000 +++ b/src/coding.c Thu Aug 08 12:34:27 2002 +0000 @@ -6878,6 +6878,13 @@ if (nargs < 1 + XINT (target_idx)) error ("Too few arguments for operation: %s", SDATA (SYMBOL_NAME (operation))); + /* 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))))
