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

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

Recognizing additional compressed files by filename


From: Sean McAfee
Subject: Recognizing additional compressed files by filename
Date: Tue, 22 Mar 2011 15:24:41 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

At my workplace, I sometimes need to deal with gzipped tar files whose
names have a trailing underscore and 32 hexadecimal digits (an MD5
sum).  I want to be able to open these files in Emacs, but the unusual
filenames stymied me at first.  Eventually I came up with the following
code, which adds a new entry to the variable jka-compr-compression-info-list:

(loop for vec in jka-compr-compression-info-list
      if (string-match (aref vec 0)
                       "test.gz_0123456789abcdef0123456789abcdef")
      return nil
      if (string-match (aref vec 0) "test.gz")
      collect vec into gz
      finally (when gz
                (setf (aref (first (push (copy-sequence (first gz))
                                         jka-compr-compression-info-list)) 0)
                      "\\.gz_[[:xdigit:]]\\{32\\}\\'")
                (jka-compr-update)))

This works OK, but is there a more straightforward way?


reply via email to

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