summaryrefslogtreecommitdiff
path: root/src/coding.c
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>2002-08-08 12:34:27 +0000
committerKenichi Handa <handa@m17n.org>2002-08-08 12:34:27 +0000
commit5fa238e70ae4ddd0e0048a0e1a9e6476708a0f26 (patch)
treee52be3a03804972d32fb8523a5c9973a9b80fdfd /src/coding.c
parentf61e419c7939fb890d940378bb734dc38e669498 (diff)
downloademacs-5fa238e70ae4ddd0e0048a0e1a9e6476708a0f26.tar.gz
(Ffind_operation_coding_system): For write-region, if
VISIT is a filename, make it the target.
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/coding.c b/src/coding.c
index e285e1c27f3..952fc1408f5 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -6878,6 +6878,13 @@ usage: (find-operation-coding-system OPERATION ARGUMENTS ...) */)
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))))