[Top][All Lists]

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

[PATCH] Adding lz4 support to jka-compr

From: Sven Joachim
Subject: [PATCH] Adding lz4 support to jka-compr
Date: Wed, 20 Jul 2016 12:40:42 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (gnu/linux)

Recently I stumbled upon a file with .lz4 extension, wondered what that
was and if Emacs could read it.  It turned out out that it has been
compressed with a shiny new very fast compressor, found on
https://cyan4973.github.io/lz4/.  Fortunately its commandline syntax is
quite standard, and so it was straightforward to add jka-compr support
for it, see the attached patch (tested on the emacs-25 branch, but
jka-cmpr-hook.el on the master branch is identical).

For those who want to test it and not build lz4 from source: on Debian
and derivatives, the lz4 program can be found in the liblz4-tool package.


>From 32696c696a3faaccf2d2995f4fdd37b3843eee1a Mon Sep 17 00:00:00 2001
From: Sven Joachim <address@hidden>
Date: Wed, 20 Jul 2016 12:07:34 +0200
Subject: [PATCH] Support lz4 compressed files

* lisp/jka-cmpr-hook.el (jka-compr-compression-info-list):
  Support .lz4 compressed files.
 lisp/jka-cmpr-hook.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lisp/jka-cmpr-hook.el b/lisp/jka-cmpr-hook.el
index 39302f0..7d6a49a 100644
--- a/lisp/jka-cmpr-hook.el
+++ b/lisp/jka-cmpr-hook.el
@@ -226,6 +226,10 @@ jka-compr-compression-info-list
      "Lzip compressing"   "lzip"         ("-c" "-q")
      "Lzip uncompressing" "lzip"         ("-c" "-q" "-d")
      t t "LZIP"]
+    ["\\.lz4\\'"
+     "Lz4 compressing"     "lz4"         ("-c" "-q")
+     "Lz4 uncompressing"   "lz4"         ("-c" "-q" "-d")
+     t t "LZ4"]
      "LZMA compressing"   "lzma"         ("-c" "-q" "-z")
      "LZMA uncompressing" "lzma"         ("-c" "-q" "-d")
@@ -302,7 +306,7 @@ jka-compr-compression-info-list
                         (boolean :tag "Strip Extension")
                         (string :tag "Magic Bytes")))
   :set 'jka-compr-set
-  :version "24.1"                      ; removed version extension piece
+  :version "25.2"                      ; added lz4 support
   :group 'jka-compr)
 (defcustom jka-compr-mode-alist-additions

reply via email to

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