From: Glenn Morris Date: Sun, 2 Mar 2014 03:34:36 +0000 (-0800) Subject: Document zlib-decompress-region X-Git-Tag: emacs-24.3.90~322 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d2b94b157caca1893f610ed65d824ce92fd18625;p=emacs.git Document zlib-decompress-region * doc/lispref/text.texi (Decompression): New node. * doc/lispref/elisp.texi (Top): Update detailed menu. * etc/NEWS: Related markup. --- diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 4b629e6f4dd..e87272401d6 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 76b98576254..a0f447f94f4 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 9df6cf61e06..5a38ce1e0d3 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 b317d2be606..1eb9a703ff9 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.