From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: G Anna Newsgroups: gmane.emacs.help Subject: Re: Adding file types for automatic uncompressing Date: 23 Apr 2002 07:41:00 +0530 Sender: help-gnu-emacs-admin@gnu.org Message-ID: References: Reply-To: help-gnu-emacs@gnu.org NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1019540560 27156 127.0.0.1 (23 Apr 2002 05:42:40 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 23 Apr 2002 05:42:40 +0000 (UTC) Cc: help-gnu-emacs@gnu.org Return-path: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16zt4Z-00073s-00 for ; Tue, 23 Apr 2002 07:42:39 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16zt42-00034p-00; Tue, 23 Apr 2002 01:42:06 -0400 Original-Received: from [202.9.174.30] (helo=mailvs.eth.net) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16zt24-00030O-00 for ; Tue, 23 Apr 2002 01:40:05 -0400 Original-Received: from smtp1.eth.net ([202.9.178.22]) by mailvs.eth.net with Microsoft SMTPSVC(5.0.2195.4453); Tue, 23 Apr 2002 11:13:08 +0530 Original-Received: from 202.9.171.203 by smtp1.eth.net (InterScan E-Mail VirusWall NT); Tue, 23 Apr 2002 11:08:47 +0530 Original-To: "Molitor, Stephen" In-Reply-To: Original-Lines: 47 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 X-OriginalArrivalTime: 23 Apr 2002 05:43:08.0562 (UTC) FILETIME=[BF65BF20:01C1EA89] Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:141 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:141 > Date: Mon, 22 Apr 2002 12:57:23 -0500 > From: "Molitor, Stephen" > 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