From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ulrich Mueller Newsgroups: gmane.emacs.devel Subject: Support for xz compression (patch included) Date: Wed, 22 Sep 2010 17:45:32 +0200 Message-ID: <19610.9372.91931.679948@a1i15.kph.uni-mainz.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1285170373 5965 80.91.229.12 (22 Sep 2010 15:46:13 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 22 Sep 2010 15:46:13 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 22 17:46:10 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OyRWF-0008Jq-5S for ged-emacs-devel@m.gmane.org; Wed, 22 Sep 2010 17:46:03 +0200 Original-Received: from localhost ([127.0.0.1]:44699 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OyRWE-0004JU-81 for ged-emacs-devel@m.gmane.org; Wed, 22 Sep 2010 11:46:02 -0400 Original-Received: from [140.186.70.92] (port=53427 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OyRW1-0004FT-GL for emacs-devel@gnu.org; Wed, 22 Sep 2010 11:45:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OyRVz-00081g-Et for emacs-devel@gnu.org; Wed, 22 Sep 2010 11:45:48 -0400 Original-Received: from a1iwww1.kph.uni-mainz.de ([134.93.134.1]:52528) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OyRVz-0007yk-02 for emacs-devel@gnu.org; Wed, 22 Sep 2010 11:45:47 -0400 Original-Received: from a1i15.kph.uni-mainz.de (a1i15.kph.uni-mainz.de [134.93.134.92]) by a1iwww1.kph.uni-mainz.de (8.14.0/8.13.4) with ESMTP id o8MFjWcb009929 for ; Wed, 22 Sep 2010 17:45:33 +0200 Original-Received: from a1i15.kph.uni-mainz.de (localhost [127.0.0.1]) by a1i15.kph.uni-mainz.de (8.14.3/8.14.2) with ESMTP id o8MFjWZx002591; Wed, 22 Sep 2010 17:45:32 +0200 Original-Received: (from ulm@localhost) by a1i15.kph.uni-mainz.de (8.14.4/8.14.4/Submit) id o8MFjW2E002588; Wed, 22 Sep 2010 17:45:32 +0200 X-Mailer: VM 8.1.1 under 23.2.1 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:130628 Archived-At: Hi, So far Emacs has only rudimentary support for xz compression, namely in jka-compr and dired. Please find below a patch against the current trunk that extends xz support. On a related note, info.el supports "unyabba" and the ".Y" filename suffix. Is anyone still using yabba to compress Info files, or could that be removed? Ulrich doc/misc/ChangeLog 2010-09-22 Ulrich Mueller * woman.texi (Interface Options): xz compression is now supported. lib-src/ChangeLog 2010-09-22 Ulrich Mueller * etags.c (compressors, print_language_names): Support xz compression. lisp/ChangeLog 2010-09-22 Ulrich Mueller * eshell/em-ls.el (eshell-ls-archive-regexp): * eshell/esh-util.el (eshell-tar-regexp): * ibuffer.el (ibuffer-compressed-file-name-regexp): * info.el (Info-suffix-list): * international/mule.el (auto-coding-alist): * woman.el (woman-file-regexp, woman-file-compression-regexp): * progmodes/etags.el (tags-compression-info-list): Support xz compression. --- emacs-orig/doc/misc/woman.texi +++ emacs/doc/misc/woman.texi @@ -1121,8 +1121,8 @@ for which decompressors are available and handled by auto-compression mode. It should begin with @code{\\.} and end with @code{\\'} and @emph{must not} be optional. The default value is -@code{"\\.\\(g?z\\|bz2\\)\\'"}, which matches the @code{gzip} and -@code{bzip2} compression extensions. +@code{"\\.\\(g?z\\|bz2\\|xz\\)\\'"}, which matches the @code{gzip}, +@code{bzip2}, and @code{xz} compression extensions. @emph{Do not change this unless you are sure you know what you are doing!} --- emacs-orig/lib-src/etags.c +++ emacs/lib-src/etags.c @@ -561,6 +561,7 @@ { "gz", "gzip -d -c"}, { "GZ", "gzip -d -c"}, { "bz2", "bzip2 -d -c" }, + { "xz", "xz -d -c" }, { NULL } }; @@ -874,7 +875,7 @@ Fortran is tried first; if no tags are found, C is tried next.\n\ When parsing any C file, a \"class\" or \"template\" keyword\n\ switches to C++."); - puts ("Compressed files are supported using gzip and bzip2.\n\ + puts ("Compressed files are supported using gzip, bzip2, and xz.\n\ \n\ For detailed help on a given language use, for example,\n\ etags --help --lang=ada."); --- emacs-orig/lisp/eshell/em-ls.el +++ emacs/lisp/eshell/em-ls.el @@ -162,7 +162,7 @@ (defcustom eshell-ls-archive-regexp (concat "\\.\\(t\\(a[rz]\\|gz\\)\\|arj\\|lzh\\|" - "zip\\|[zZ]\\|gz\\|bz2\\|deb\\|rpm\\)\\'") + "zip\\|[zZ]\\|gz\\|bz2\\|xz\\|deb\\|rpm\\)\\'") "*A regular expression that matches names of file archives. This typically includes both traditional archives and compressed files." --- emacs-orig/lisp/eshell/esh-util.el +++ emacs/lisp/eshell/esh-util.el @@ -71,7 +71,7 @@ :group 'eshell-util) (defcustom eshell-tar-regexp - "\\.t\\(ar\\(\\.\\(gz\\|bz2\\|Z\\)\\)?\\|gz\\|a[zZ]\\|z2\\)\\'" + "\\.t\\(ar\\(\\.\\(gz\\|bz2\\|xz\\|Z\\)\\)?\\|gz\\|a[zZ]\\|z2\\)\\'" "*Regular expression used to match tar file names." :type 'regexp :group 'eshell-util) --- emacs-orig/lisp/ibuffer.el +++ emacs/lisp/ibuffer.el @@ -332,7 +332,7 @@ :group 'ibuffer) (defcustom ibuffer-compressed-file-name-regexp - "\\.\\(arj\\|bgz\\|bz2\\|gz\\|lzh\\|taz\\|tgz\\|zip\\|z\\)$" + "\\.\\(arj\\|bgz\\|bz2\\|gz\\|lzh\\|taz\\|tgz\\|xz\\|zip\\|z\\)$" "Regexp to match compressed file names." :type 'regexp :group 'ibuffer) --- emacs-orig/lisp/info.el +++ emacs/lisp/info.el @@ -397,30 +397,34 @@ ("-info" . nil) ("/index" . nil) ("" . nil)) - '( (".info.Z". "uncompress") - (".info.Y". "unyabba") - (".info.gz". "gunzip") - (".info.z". "gunzip") - (".info.bz2" . ("bzip2" "-dc")) - (".info". nil) - ("-info.Z". "uncompress") - ("-info.Y". "unyabba") - ("-info.gz". "gunzip") - ("-info.bz2" . ("bzip2" "-dc")) - ("-info.z". "gunzip") - ("-info". nil) - ("/index.Z". "uncompress") - ("/index.Y". "unyabba") - ("/index.gz". "gunzip") - ("/index.z". "gunzip") - ("/index.bz2". ("bzip2" "-dc")) - ("/index". nil) - (".Z". "uncompress") - (".Y". "unyabba") - (".gz". "gunzip") - (".z". "gunzip") - (".bz2" . ("bzip2" "-dc")) - ("". nil))) + '( (".info.Z" . "uncompress") + (".info.Y" . "unyabba") + (".info.gz" . "gunzip") + (".info.z" . "gunzip") + (".info.bz2" . ("bzip2" "-dc")) + (".info.xz" . "unxz") + (".info" . nil) + ("-info.Z" . "uncompress") + ("-info.Y" . "unyabba") + ("-info.gz" . "gunzip") + ("-info.z" . "gunzip") + ("-info.bz2" . ("bzip2" "-dc")) + ("-info.xz" . "unxz") + ("-info" . nil) + ("/index.Z" . "uncompress") + ("/index.Y" . "unyabba") + ("/index.gz" . "gunzip") + ("/index.z" . "gunzip") + ("/index.bz2" . ("bzip2" "-dc")) + ("/index.xz" . "unxz") + ("/index" . nil) + (".Z" . "uncompress") + (".Y" . "unyabba") + (".gz" . "gunzip") + (".z" . "gunzip") + (".bz2" . ("bzip2" "-dc")) + (".xz" . "unxz") + ("" . nil))) "List of file name suffixes and associated decoding commands. Each entry should be (SUFFIX . STRING); the file is given to the command as standard input. --- emacs-orig/lisp/international/mule.el +++ emacs/lisp/international/mule.el @@ -1679,7 +1679,7 @@ . no-conversion-multibyte) ("\\.\\(exe\\|EXE\\)\\'" . no-conversion) ("\\.\\(sx[dmicw]\\|odt\\|tar\\|tgz\\)\\'" . no-conversion) - ("\\.\\(gz\\|Z\\|bz\\|bz2\\|gpg\\)\\'" . no-conversion) + ("\\.\\(gz\\|Z\\|bz\\|bz2\\|xz\\|gpg\\)\\'" . no-conversion) ("\\.\\(jpe?g\\|png\\|gif\\|tiff?\\|p[bpgn]m\\)\\'" . no-conversion) ("\\.pdf\\'" . no-conversion) ("/#[^/]+#\\'" . emacs-mule))) --- emacs-orig/lisp/progmodes/etags.el +++ emacs/lisp/progmodes/etags.el @@ -68,7 +68,8 @@ :type '(repeat file)) ;;;###autoload -(defcustom tags-compression-info-list (purecopy '("" ".Z" ".bz2" ".gz" ".tgz")) +(defcustom tags-compression-info-list + (purecopy '("" ".Z" ".bz2" ".gz" ".xz" ".tgz")) "*List of extensions tried by etags when jka-compr is used. An empty string means search the non-compressed file. These extensions will be tried only if jka-compr was activated --- emacs-orig/lisp/woman.el +++ emacs/lisp/woman.el @@ -810,7 +810,7 @@ (defvar woman-file-regexp nil "Regexp used to select (possibly compressed) man source files, e.g. -\"\\.\\([0-9lmnt]\\w*\\)\\(\\.\\(g?z\\|bz2\\)\\)?\\'\". +\"\\.\\([0-9lmnt]\\w*\\)\\(\\.\\(g?z\\|bz2\\|xz\\)\\)?\\'\". Built automatically from the customizable user options `woman-uncompressed-file-regexp' and `woman-file-compression-regexp'.") @@ -846,11 +846,11 @@ :group 'woman-interface) (defcustom woman-file-compression-regexp - "\\.\\(g?z\\|bz2\\)\\'" + "\\.\\(g?z\\|bz2\\|xz\\)\\'" "Do not change this unless you are sure you know what you are doing! Regexp used to match compressed man file extensions for which decompressors are available and handled by auto-compression mode, -e.g. \"\\\\.\\\\(g?z\\\\|bz2\\\\)\\\\'\" for `gzip' or `bzip2'. +e.g. \"\\\\.\\\\(g?z\\\\|bz2\\\\|xz\\\\)\\\\'\" for `gzip', `bzip2', or `xz'. Should begin with \\. and end with \\' and MUST NOT be optional." ;; Should be compatible with car of ;; `jka-compr-file-name-handler-entry', but that is unduly