all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Recognizing additional compressed files by filename
@ 2011-03-22 22:24 Sean McAfee
  0 siblings, 0 replies; only message in thread
From: Sean McAfee @ 2011-03-22 22:24 UTC (permalink / raw)
  To: help-gnu-emacs

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?


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-03-22 22:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-22 22:24 Recognizing additional compressed files by filename Sean McAfee

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.