comparison lisp/arc-mode.el @ 45362:854ecfb3a883

(archive-zip-use-pkzip): Variable deleted. (archive-zip-extract, archive-zip-expunge, archive-zip-update) (archive-zip-update-case): Use locate-file to decide whether to use pkzip.
author Richard M. Stallman <rms@gnu.org>
date Sun, 19 May 2002 16:00:48 +0000
parents 6493c49c2946
children a4e14fc34d3d
comparison
equal deleted inserted replaced
45361:031bafbd4f7a 45362:854ecfb3a883
209 (string :format "%v"))) 209 (string :format "%v")))
210 :group 'archive-lzh) 210 :group 'archive-lzh)
211 ;; ------------------------------ 211 ;; ------------------------------
212 ;; Zip archive configuration 212 ;; Zip archive configuration
213 213
214 (defcustom archive-zip-use-pkzip (memq system-type '(ms-dos windows-nt))
215 "*If non-nil then pkzip option are used instead of zip options.
216 Only set to true for msdog systems!"
217 :type 'boolean
218 :group 'archive-zip)
219
220 (defcustom archive-zip-extract 214 (defcustom archive-zip-extract
221 (if archive-zip-use-pkzip '("pkunzip" "-e" "-o-") '("unzip" "-qq" "-c")) 215 (if (locate-file "unzip" nil 'file-executable-p)
216 '("unzip" "-qq" "-c")
217 (if (locate-file "pkunzip" nil 'file-executable-p)
218 '("pkunzip" "-e" "-o-")
219 '("unzip" "-qq" "-c")))
222 "*Program and its options to run in order to extract a zip file member. 220 "*Program and its options to run in order to extract a zip file member.
223 Extraction should happen to standard output. Archive and member name will 221 Extraction should happen to standard output. Archive and member name will
224 be added. If `archive-zip-use-pkzip' is non-nil then this program is 222 be added. If `archive-zip-use-pkzip' is non-nil then this program is
225 expected to extract to a file junking the directory part of the name." 223 expected to extract to a file junking the directory part of the name."
226 :type '(list (string :tag "Program") 224 :type '(list (string :tag "Program")
233 ;; (1) It uses more disk space. (2) Error checking is worse or non- 231 ;; (1) It uses more disk space. (2) Error checking is worse or non-
234 ;; existent. (3) It tends to do funny things with other systems' file 232 ;; existent. (3) It tends to do funny things with other systems' file
235 ;; names. 233 ;; names.
236 234
237 (defcustom archive-zip-expunge 235 (defcustom archive-zip-expunge
238 (if archive-zip-use-pkzip '("pkzip" "-d") '("zip" "-d" "-q")) 236 (if (locate-file "zip" nil 'file-executable-p)
237 '("zip" "-d" "-q")
238 (if (locate-file "zip" nil 'file-executable-p)
239 '("pkzip" "-d")
240 '("zip" "-d" "-q")))
239 "*Program and its options to run in order to delete zip file members. 241 "*Program and its options to run in order to delete zip file members.
240 Archive and member names will be added." 242 Archive and member names will be added."
241 :type '(list (string :tag "Program") 243 :type '(list (string :tag "Program")
242 (repeat :tag "Options" 244 (repeat :tag "Options"
243 :inline t 245 :inline t
244 (string :format "%v"))) 246 (string :format "%v")))
245 :group 'archive-zip) 247 :group 'archive-zip)
246 248
247 (defcustom archive-zip-update 249 (defcustom archive-zip-update
248 (if archive-zip-use-pkzip '("pkzip" "-u" "-P") '("zip" "-q")) 250 (if (locate-file "zip" nil 'file-executable-p)
251 '("zip" "-q")
252 (if (locate-file "zip" nil 'file-executable-p)
253 '("pkzip" "-u" "-P")
254 '("zip" "-q")))
249 "*Program and its options to run in order to update a zip file member. 255 "*Program and its options to run in order to update a zip file member.
250 Options should ensure that specified directory will be put into the zip 256 Options should ensure that specified directory will be put into the zip
251 file. Archive and member name will be added." 257 file. Archive and member name will be added."
252 :type '(list (string :tag "Program") 258 :type '(list (string :tag "Program")
253 (repeat :tag "Options" 259 (repeat :tag "Options"
254 :inline t 260 :inline t
255 (string :format "%v"))) 261 (string :format "%v")))
256 :group 'archive-zip) 262 :group 'archive-zip)
257 263
258 (defcustom archive-zip-update-case 264 (defcustom archive-zip-update-case
259 (if archive-zip-use-pkzip archive-zip-update '("zip" "-q" "-k")) 265 (if (locate-file "zip" nil 'file-executable-p)
266 '("zip" "-q" "-k")
267 (if (locate-file "zip" nil 'file-executable-p)
268 '("pkzip" "-u" "-P")
269 '("zip" "-q" "-k")))
260 "*Program and its options to run in order to update a case fiddled zip member. 270 "*Program and its options to run in order to update a case fiddled zip member.
261 Options should ensure that specified directory will be put into the zip file. 271 Options should ensure that specified directory will be put into the zip file.
262 Archive and member name will be added." 272 Archive and member name will be added."
263 :type '(list (string :tag "Program") 273 :type '(list (string :tag "Program")
264 (repeat :tag "Options" 274 (repeat :tag "Options"
1635 (if (= 1 (length files)) "" "s")) 1645 (if (= 1 (length files)) "" "s"))
1636 "\n")) 1646 "\n"))
1637 (apply 'vector (nreverse files)))) 1647 (apply 'vector (nreverse files))))
1638 1648
1639 (defun archive-zip-extract (archive name) 1649 (defun archive-zip-extract (archive name)
1640 (if archive-zip-use-pkzip 1650 (if (equal (car archive-zip-extract) "pkzip")
1641 (archive-*-extract archive name archive-zip-extract) 1651 (archive-*-extract archive name archive-zip-extract)
1642 (archive-extract-by-stdout archive name archive-zip-extract))) 1652 (archive-extract-by-stdout archive name archive-zip-extract)))
1643 1653
1644 (defun archive-zip-write-file-member (archive descr) 1654 (defun archive-zip-write-file-member (archive descr)
1645 (archive-*-write-file-member 1655 (archive-*-write-file-member