comparison lisp/jka-compr.el @ 18906:67642fb78fc4

Fix previous changes.
author Kenichi Handa <handa@m17n.org>
date Tue, 22 Jul 1997 03:45:44 +0000
parents 8b226efb9a8b
children f2ce7e947ec9
comparison
equal deleted inserted replaced
18905:6d543fd6a50b 18906:67642fb78fc4
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 (coding-system-for-read 'undecided) 301 (coding-system-for-read (or coding-system-for-read 'undecided))
302 (coding-system-for-write 'no-conversion) ) 302 (coding-system-for-write 'no-conversion) )
303 303
304 (unwind-protect 304 (unwind-protect
305 305
306 (or (memq 306 (or (memq
429 (message "%s %s..." compress-message base-name)) 429 (message "%s %s..." compress-message base-name))
430 430
431 (jka-compr-run-real-handler 'write-region 431 (jka-compr-run-real-handler 'write-region
432 (list start end temp-file t 'dont)) 432 (list start end temp-file t 'dont))
433 433
434 (jka-compr-call-process compress-program 434 ;; Here we must read the output of compress program as is
435 (concat compress-message 435 ;; without any code conversion.
436 " " base-name) 436 (let ((coding-system-for-read 'no-conversion))
437 temp-file 437 (jka-compr-call-process compress-program
438 temp-buffer 438 (concat compress-message
439 nil 439 " " base-name)
440 compress-args) 440 temp-file
441 temp-buffer
442 nil
443 compress-args))
441 444
442 (with-current-buffer temp-buffer 445 (with-current-buffer temp-buffer
443 (let ((coding-system-for-write 'no-conversion)) 446 (let ((coding-system-for-write 'no-conversion))
444 (if (memq system-type '(ms-dos windows-nt)) 447 (if (memq system-type '(ms-dos windows-nt))
445 (setq buffer-file-type t) ) 448 (setq buffer-file-type t) )
494 (notfound nil) 497 (notfound nil)
495 (local-copy 498 (local-copy
496 (jka-compr-run-real-handler 'file-local-copy (list filename))) 499 (jka-compr-run-real-handler 'file-local-copy (list filename)))
497 local-file 500 local-file
498 size start 501 size start
499 (coding-system-for-read 'undecided) ) 502 (coding-system-for-read (or coding-system-for-read 'undecided)) )
500 503
501 (setq local-file (or local-copy filename)) 504 (setq local-file (or local-copy filename))
502 505
503 (and 506 (and
504 visit 507 visit
623 626
624 (and 627 (and
625 uncompress-message 628 uncompress-message
626 (message "%s %s..." uncompress-message base-name)) 629 (message "%s %s..." uncompress-message base-name))
627 630
628 (jka-compr-call-process uncompress-program 631 ;; Here we must read the output of uncompress program
629 (concat uncompress-message 632 ;; and write it to TEMP-FILE without any code
630 " " base-name) 633 ;; conversion. An appropriate code conversion (if
631 local-file 634 ;; necessary) is done by the later I/O operation
632 t 635 ;; (e.g. load).
633 nil 636 (let ((coding-system-for-read 'no-conversion)
634 uncompress-args) 637 (coding-system-for-write 'no-conversion))
635 638
636 (and 639 (jka-compr-call-process uncompress-program
637 uncompress-message 640 (concat uncompress-message
638 (message "%s %s...done" uncompress-message base-name)) 641 " " base-name)
639 642 local-file
640 (write-region 643 t
641 (point-min) (point-max) temp-file nil 'dont)) 644 nil
645 uncompress-args)
646
647 (and
648 uncompress-message
649 (message "%s %s...done" uncompress-message base-name))
650
651 (write-region
652 (point-min) (point-max) temp-file nil 'dont)))
642 653
643 (and 654 (and
644 local-copy 655 local-copy
645 (file-exists-p local-copy) 656 (file-exists-p local-copy)
646 (delete-file local-copy)) 657 (delete-file local-copy))