;;; Copyright (C) 1993, 1994 Free Software Foundation, Inc.
;; Author: jka@ece.cmu.edu (Jay K. Adams)
-;; Version: 0.11
;; Keywords: data
;;; Commentary:
;;; APPLICATION NOTES:
-;;;
-;;; rmail, vm, gnus, etc.
-;;; To use compressed mail folders, .newsrc files, etc., you need
-;;; only compress the file. Since jka-compr searches for .gz
-;;; versions of the files it's finding, you need not change
-;;; variables within rmail, gnus, etc.
-;;;
;;;
;;; crypt++
;;; jka-compr can coexist with crpyt++ if you take all the decompression
;; compr-message compr-prog compr-args
;; uncomp-message uncomp-prog uncomp-args
;; can-append auto-mode-flag]
- '(["\\.Z~?\\'"
+ '(["\\.Z\\(~\\|\\.~[0-9]+~\\)?\\'"
"compressing" "compress" ("-c")
"uncompressing" "uncompress" ("-c")
nil t]
- ["\\.gz~?\\'"
+ ["\\.gz\\(~\\|\\.~[0-9]+~\\)?\\'"
"zipping" "gzip" ("-c" "-q")
"unzipping" "gzip" ("-c" "-q" "-d")
t t])
(condition-case error-code
(progn
+ (if replace
+ (goto-char (point-min)))
(setq start (point))
(if (or beg end)
(jka-compr-partial-uncompress uncompress-program
nil
uncompress-args))
(setq size (- (point) start))
- (goto-char start)
- ;; Run the functions that insert-file-contents would.
- (let ((list after-insert-file-functions)
- (value size))
- (while list
- (setq value (funcall (car list) size))
- (if value
- (setq size value))
- (setq list (cdr list)))))
-
+ (if replace
+ (let* ((del-beg (point))
+ (del-end (+ del-beg size)))
+ (delete-region del-beg
+ (min del-end (point-max)))))
+ (goto-char start))
(error
(if (and (eq (car error-code) 'file-error)
(eq (nth 3 error-code) local-file))
(signal 'file-error
(cons "Opening input file" (nth 2 notfound))))
+ ;; Run the functions that insert-file-contents would.
+ (let ((p after-insert-file-functions)
+ (insval size))
+ (while p
+ (setq insval (funcall (car p) size))
+ (if insval
+ (progn
+ (or (integerp insval)
+ (signal 'wrong-type-argument
+ (list 'integerp insval)))
+ (setq size insval)))
+ (setq p (cdr p))))
+
(list filename size))
(jka-compr-run-real-handler 'insert-file-contents