diff options
| author | Kenichi Handa | 2006-05-26 04:48:21 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2006-05-26 04:48:21 +0000 |
| commit | a9e2078b7150478c5783a9ad82f7017fc93a7e69 (patch) | |
| tree | 3ecd132d8526e2f8b8ef61c27251110bf1bdc037 /src/coding.c | |
| parent | 47a355de933fe933c6e936ca5745a2bf3047d383 (diff) | |
| download | emacs-a9e2078b7150478c5783a9ad82f7017fc93a7e69.tar.gz emacs-a9e2078b7150478c5783a9ad82f7017fc93a7e69.zip | |
(Ffind_operation_coding_system): Allow (FILENAME . BUFFER) in TARGET.
Diffstat (limited to 'src/coding.c')
| -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, | |||
| 7457 | whichever argument specifies the file name is TARGET. | 7457 | whichever argument specifies the file name is TARGET. |
| 7458 | 7458 | ||
| 7459 | TARGET has a meaning which depends on OPERATION: | 7459 | TARGET has a meaning which depends on OPERATION: |
| 7460 | For file I/O, TARGET is a file name. | 7460 | For file I/O, TARGET is a file name (except for the special case below). |
| 7461 | For process I/O, TARGET is a process name. | 7461 | For process I/O, TARGET is a process name. |
| 7462 | For network I/O, TARGET is a service name or a port number | 7462 | For network I/O, TARGET is a service name or a port number |
| 7463 | 7463 | ||
| @@ -7469,6 +7469,12 @@ or a function symbol to call. | |||
| 7469 | In the last case, we call the function with one argument, | 7469 | In the last case, we call the function with one argument, |
| 7470 | which is a list of all the arguments given to this function. | 7470 | which is a list of all the arguments given to this function. |
| 7471 | 7471 | ||
| 7472 | If OPERATION is `insert-file-contents', the argument corresponding to | ||
| 7473 | TARGET may be a cons (FILENAME . BUFFER). In that case, FILENAME is a | ||
| 7474 | file name to look up, and BUFFER is a buffer that already contains the | ||
| 7475 | file (but not yet decoded). If a function is found as above, the | ||
| 7476 | function must pay attention to this format of TARGET. | ||
| 7477 | |||
| 7472 | usage: (find-operation-coding-system OPERATION ARGUMENTS ...) */) | 7478 | usage: (find-operation-coding-system OPERATION ARGUMENTS ...) */) |
| 7473 | (nargs, args) | 7479 | (nargs, args) |
| 7474 | int nargs; | 7480 | int nargs; |
| @@ -7495,8 +7501,12 @@ usage: (find-operation-coding-system OPERATION ARGUMENTS ...) */) | |||
| 7495 | target_idx = make_number (4); | 7501 | target_idx = make_number (4); |
| 7496 | target = args[XINT (target_idx) + 1]; | 7502 | target = args[XINT (target_idx) + 1]; |
| 7497 | if (!(STRINGP (target) | 7503 | if (!(STRINGP (target) |
| 7504 | || (EQ (operation, Qinsert_file_contents) && CONSP (target) | ||
| 7505 | && STRINGP (XCAR (target)) && BUFFERP (XCDR (target))) | ||
| 7498 | || (EQ (operation, Qopen_network_stream) && INTEGERP (target)))) | 7506 | || (EQ (operation, Qopen_network_stream) && INTEGERP (target)))) |
| 7499 | error ("Invalid argument %d", XINT (target_idx) + 1); | 7507 | error ("Invalid argument %d", XINT (target_idx) + 1); |
| 7508 | if (CONSP (target)) | ||
| 7509 | target = XCAR (target); | ||
| 7500 | 7510 | ||
| 7501 | chain = ((EQ (operation, Qinsert_file_contents) | 7511 | chain = ((EQ (operation, Qinsert_file_contents) |
| 7502 | || EQ (operation, Qwrite_region)) | 7512 | || EQ (operation, Qwrite_region)) |