help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding file types for automatic uncompressing


From: G Anna
Subject: Re: Adding file types for automatic uncompressing
Date: 23 Apr 2002 07:41:00 +0530
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

> Date: Mon, 22 Apr 2002 12:57:23 -0500
> From: "Molitor, Stephen" <SMolitor@erac.com>
> Subj: Adding file types for automatic uncompressing
> 
> I'd like to add a few file types to the set of compressed file
> types, so that when I open a file via find-file or dired, it
> automatically get's uncompressed.  Specifily, .ear and .war files.
> These are just zip files, with different extensions.  I tried doing
> this:
> 
> (setq auto-mode-alist (cons '("\\.ear$" . ear-mode) auto-mode-alist))
> (setq file-name-buffer-file-type-alist (cons '("\\.ear$" . t)
> file-name-buffer-file-type-alist))

In the dired-aux.el file there is a variable
dired-compress-file-suffixes, which might be of interest to you.  Just
for completeness, here is its definition.

(defvar dired-compress-file-suffixes
  '(("\\.gz\\'" "" "gunzip")
    ("\\.tgz\\'" ".tar" "gunzip")
    ("\\.Z\\'" "" "uncompress")
    ;; For .z, try gunzip.  It might be an old gzip file,
    ;; or it might be from compact? pack? (which?) but gunzip handles both.
    ("\\.z\\'" "" "gunzip")
    ("\\.bz2\\'" "" "bunzip2")
    ;; This item controls naming for compression.
    ("\\.tar\\'" ".tgz" nil))
  "Control changes in file name suffixes for compression and uncompression.
Each element specifies one transformation rule, and has the form:
  (REGEXP NEW-SUFFIX PROGRAM)
The rule applies when the old file name matches REGEXP.
The new file name is computed by deleting the part that matches REGEXP
 (as well as anything after that), then adding NEW-SUFFIX in its place.
If PROGRAM is non-nil, the rule is an uncompression rule,
and uncompression is done by running PROGRAM.
Otherwise, the rule is a compression rule, and compression is done with gzip.")

Is this of any help?

Cheers,
anna

-- 

Get your free e-mail account at http://www.linuxmail.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]