From d2b94b157caca1893f610ed65d824ce92fd18625 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 1 Mar 2014 19:34:36 -0800 Subject: [PATCH] Document zlib-decompress-region * doc/lispref/text.texi (Decompression): New node. * doc/lispref/elisp.texi (Top): Update detailed menu. * etc/NEWS: Related markup. --- doc/lispref/ChangeLog | 5 +++++ doc/lispref/elisp.texi | 1 + doc/lispref/text.texi | 30 ++++++++++++++++++++++++++++++ etc/NEWS | 1 + 4 files changed, 37 insertions(+) diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 4b629e6f4d..e87272401d 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,8 @@ +2014-03-02 Glenn Morris + + * text.texi (Decompression): New node. + * elisp.texi (Top): Update detailed menu. + 2014-03-01 Glenn Morris * display.texi (Forcing Redisplay): Mention pre-redisplay-function. diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi index 76b9857625..a0f447f94f 100644 --- a/doc/lispref/elisp.texi +++ b/doc/lispref/elisp.texi @@ -1138,6 +1138,7 @@ Text * Registers:: How registers are implemented. Accessing the text or position stored in a register. * Transposition:: Swapping two portions of a buffer. +* Decompression:: Dealing with compressed data. * Base 64:: Conversion to or from base 64 encoding. * Checksum/Hash:: Computing cryptographic hashes. * Parsing HTML/XML:: Parsing HTML and XML. diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 9df6cf61e0..5a38ce1e0d 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -54,6 +54,7 @@ the character after point. * Registers:: How registers are implemented. Accessing the text or position stored in a register. * Transposition:: Swapping two portions of a buffer. +* Decompression:: Dealing with compressed data. * Base 64:: Conversion to or from base 64 encoding. * Checksum/Hash:: Computing cryptographic hashes. * Parsing HTML/XML:: Parsing HTML and XML. @@ -4132,6 +4133,35 @@ is non-@code{nil}, @code{transpose-regions} does not do this---it leaves all markers unrelocated. @end defun +@node Decompression +@section Dealing With Compressed Data + +When @code{auto-compression-mode} is enabled, Emacs automatically +uncompresses compressed files when you visit them, and automatically +recompresses them if you alter and save them. @xref{Compressed +Files,,, emacs, The GNU Emacs Manual}. + +The above feature works by calling an external executable (e.g., +@command{gzip}). Emacs can also be compiled with support for built-in +decompression using the zlib library, which is faster than calling an +external program. + +@defun zlib-available-p +This function returns non-@code{nil} if built-in zlib decompression is +available. +@end defun + +@defun zlib-decompress-region start end +This function decompresses the region between @var{start} and +@var{end}, using built-in zlib decompression. The region should +contain data that were compressed with gzip or zlib. On success, the +function replaces the contents of the region with the decompressed +data. On failure, the function leaves the region unchanged and +returns @code{nil}. This function can be called only in unibyte +buffers. +@end defun + + @node Base 64 @section Base 64 Encoding @cindex base 64 encoding diff --git a/etc/NEWS b/etc/NEWS index b317d2be60..1eb9a703ff 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -91,6 +91,7 @@ to set up the initial buffer. * Changes in Emacs 24.4 ++++ ** New function `zlib-decompress-region', which decompresses gzip- and zlib-format compressed data using built-in zlib support, if available. -- 2.20.1