--- Begin Message ---
Subject: |
Re: jka-compr-partial-uncompress not working properly |
Date: |
Mon, 29 Oct 2001 14:38:28 +0100 |
Hi,
some time (1.5 year) ago I sent a patch to jka-compr.el. You asked me to
sign a disclaimer, which I did, and to remind you again about this patch
after some time, which I forgot to do. Now that I read on the newsgroup
that you are retiring as Emacs maintainer, it all came back to me ...
Included you find my original message and the patch for Emacs 20.6 or 20.7.
>From looking at the source of jka-compr.el in Emacs 21.1, I think this
patch is still needed, although I haven't been able to test it yet on an NT
platform.
Best regards,
Luc Van Eycken
--- Begin Message ---
Subject: |
jka-compr-partial-uncompress not working properly |
Date: |
Fri, 17 Mar 2000 10:56:38 +0100 (MET) |
In GNU Emacs 20.6.1 (i386-*-nt4.0.1381) of Tue Feb 29 2000 on buffy
configured using `configure NT', jka-compr-partial-uncompress does not work
if jka-compr-use-shell is nil (as is the case for NT) or a "dd" program is
not available. This problem shows up on NT in 20.6 but it is also present
in older versions and on other platforms (e.g. when the user decides to use
no shell for jka-compr).
I solved this problem with the patch included below.
Best regards,
Luc Van Eycken
*** jka-compr.el.orig Fri Mar 17 10:31:20 2000
--- jka-compr.el Fri Mar 17 10:13:00 2000
***************
*** 266,299 ****
(defun jka-compr-partial-uncompress (prog message args infile beg len)
"Call program PROG with ARGS args taking input from INFILE.
Fourth and fifth args, BEG and LEN, specify which part of the output
to keep: LEN chars starting BEG chars from the beginning."
! (let* ((skip (/ beg jka-compr-dd-blocksize))
! (prefix (- beg (* skip jka-compr-dd-blocksize)))
! (count (and len (1+ (/ (+ len prefix) jka-compr-dd-blocksize))))
! (start (point))
! (err-file (jka-compr-make-temp-name))
! (run-string (format "%s %s 2> %s | %s bs=%d skip=%d %s 2> /dev/null"
! prog
! (mapconcat 'identity args " ")
! err-file
! jka-compr-dd-program
! jka-compr-dd-blocksize
! skip
! ;; dd seems to be unreliable about
! ;; providing the last block. So, always
! ;; read one more than you think you need.
! (if count (concat "count=" (1+ count)) ""))))
!
! (unwind-protect
! (or (memq (call-process jka-compr-shell
! infile t nil "-c"
! run-string)
! jka-compr-acceptable-retval-list)
!
! (jka-compr-error prog args infile message err-file))
!
! (jka-compr-delete-temp-file err-file))
;; Delete the stuff after what we want, if there is any.
(and
len
--- 266,296 ----
(defun jka-compr-partial-uncompress (prog message args infile beg len)
"Call program PROG with ARGS args taking input from INFILE.
Fourth and fifth args, BEG and LEN, specify which part of the output
to keep: LEN chars starting BEG chars from the beginning."
! (let ((start (point))
! (prefix beg))
! (if (and jka-compr-use-shell jka-compr-dd-program)
! (let ((skip (/ beg jka-compr-dd-blocksize))
! (err-file (jka-compr-make-temp-name))
! count)
! (setq prefix (- beg (* skip jka-compr-dd-blocksize))
! count (and len (1+ (/ (+ len prefix) jka-compr-dd-blocksize))))
! (unwind-protect
! (or (memq (call-process
! jka-compr-shell infile t nil "-c"
! (format
! "%s %s 2> %s | %s bs=%d skip=%d %s 2> /dev/null"
! prog (mapconcat 'identity args " ") err-file
! jka-compr-dd-program jka-compr-dd-blocksize skip
! ;; dd seems to be unreliable about
! ;; providing the last block. So, always
! ;; read one more than you think you need.
! (if count (concat "count=" (1+ count)) "")))
! jka-compr-acceptable-retval-list)
! (jka-compr-error prog args infile message err-file))
! (jka-compr-delete-temp-file err-file)))
! (jka-compr-call-process prog message infile t nil args))
;; Delete the stuff after what we want, if there is any.
(and
len
--- End Message ---
--- End Message ---