diff options
author | Kenichi Handa <handa@m17n.org> | 2006-05-26 04:48:21 +0000 |
---|---|---|
committer | Kenichi Handa <handa@m17n.org> | 2006-05-26 04:48:21 +0000 |
commit | a9e2078b7150478c5783a9ad82f7017fc93a7e69 (patch) | |
tree | 3ecd132d8526e2f8b8ef61c27251110bf1bdc037 | |
parent | 47a355de933fe933c6e936ca5745a2bf3047d383 (diff) | |
download | emacs-a9e2078b7150478c5783a9ad82f7017fc93a7e69.tar.gz |
(Ffind_operation_coding_system): Allow (FILENAME . BUFFER) in TARGET.
-rw-r--r-- | src/coding.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/coding.c b/src/coding.c index 478e119c003..5ef412a3619 100644 --- a/src/coding.c +++ b/src/coding.c @@ -7457,7 +7457,7 @@ is selected as the TARGET. For example, if OPERATION does file I/O, whichever argument specifies the file name is TARGET. TARGET has a meaning which depends on OPERATION: - For file I/O, TARGET is a file name. + For file I/O, TARGET is a file name (except for the special case below). For process I/O, TARGET is a process name. For network I/O, TARGET is a service name or a port number @@ -7469,6 +7469,12 @@ or a function symbol to call. In the last case, we call the function with one argument, which is a list of all the arguments given to this function. +If OPERATION is `insert-file-contents', the argument corresponding to +TARGET may be a cons (FILENAME . BUFFER). In that case, FILENAME is a +file name to look up, and BUFFER is a buffer that already contains the +file (but not yet decoded). If a function is found as above, the +function must pay attention to this format of TARGET. + usage: (find-operation-coding-system OPERATION ARGUMENTS ...) */) (nargs, args) int nargs; @@ -7495,8 +7501,12 @@ usage: (find-operation-coding-system OPERATION ARGUMENTS ...) */) target_idx = make_number (4); target = args[XINT (target_idx) + 1]; if (!(STRINGP (target) + || (EQ (operation, Qinsert_file_contents) && CONSP (target) + && STRINGP (XCAR (target)) && BUFFERP (XCDR (target))) || (EQ (operation, Qopen_network_stream) && INTEGERP (target)))) error ("Invalid argument %d", XINT (target_idx) + 1); + if (CONSP (target)) + target = XCAR (target); chain = ((EQ (operation, Qinsert_file_contents) || EQ (operation, Qwrite_region)) |