Mercurial > emacs
comparison lisp/jka-compr.el @ 18879:8b226efb9a8b
(jka-compr-insert-file-contents): Bind coding-system-for-read.
(jka-compr-write-region): Bind coding-system-for-write.
Set buffer-file-type if dos or nt.
(jka-compr-call-process): Bind coding-system-for-read
and coding-system-for-write.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 20 Jul 1997 04:50:25 +0000 |
parents | 852464ce5d6a |
children | 67642fb78fc4 |
comparison
equal
deleted
inserted
replaced
18878:f39ae9c61a45 | 18879:8b226efb9a8b |
---|---|
295 | 295 |
296 | 296 |
297 (defun jka-compr-call-process (prog message infile output temp args) | 297 (defun jka-compr-call-process (prog message infile output temp args) |
298 (if jka-compr-use-shell | 298 (if jka-compr-use-shell |
299 | 299 |
300 (let ((err-file (jka-compr-make-temp-name))) | 300 (let ((err-file (jka-compr-make-temp-name)) |
301 | 301 (coding-system-for-read 'undecided) |
302 (coding-system-for-write 'no-conversion) ) | |
303 | |
302 (unwind-protect | 304 (unwind-protect |
303 | 305 |
304 (or (memq | 306 (or (memq |
305 (call-process jka-compr-shell infile | 307 (call-process jka-compr-shell infile |
306 (if (stringp output) nil output) | 308 (if (stringp output) nil output) |
436 temp-buffer | 438 temp-buffer |
437 nil | 439 nil |
438 compress-args) | 440 compress-args) |
439 | 441 |
440 (with-current-buffer temp-buffer | 442 (with-current-buffer temp-buffer |
441 (jka-compr-run-real-handler 'write-region | 443 (let ((coding-system-for-write 'no-conversion)) |
442 (list (point-min) (point-max) | 444 (if (memq system-type '(ms-dos windows-nt)) |
443 filename | 445 (setq buffer-file-type t) ) |
444 (and append can-append) 'dont)) | 446 (jka-compr-run-real-handler 'write-region |
445 (erase-buffer)) | 447 (list (point-min) (point-max) |
448 filename | |
449 (and append can-append) 'dont)) | |
450 (erase-buffer)) ) | |
446 | 451 |
447 (jka-compr-delete-temp-file temp-file) | 452 (jka-compr-delete-temp-file temp-file) |
448 | 453 |
449 (and | 454 (and |
450 compress-message | 455 compress-message |
488 (base-name (file-name-nondirectory filename)) | 493 (base-name (file-name-nondirectory filename)) |
489 (notfound nil) | 494 (notfound nil) |
490 (local-copy | 495 (local-copy |
491 (jka-compr-run-real-handler 'file-local-copy (list filename))) | 496 (jka-compr-run-real-handler 'file-local-copy (list filename))) |
492 local-file | 497 local-file |
493 size start) | 498 size start |
499 (coding-system-for-read 'undecided) ) | |
494 | 500 |
495 (setq local-file (or local-copy filename)) | 501 (setq local-file (or local-copy filename)) |
496 | 502 |
497 (and | 503 (and |
498 visit | 504 visit |