Is it possible to compress data (an Elisp string for example) using Emacs (without calling 3rd-party commands)? I noticed Emacs uses zlib
, but I only found zlib-decompress-region
.
Asked
Active
Viewed 182 times
3

Drew
- 75,699
- 9
- 109
- 225

ideasman42
- 8,375
- 1
- 28
- 105
-
When you say "data", do you mean data to use with Emacs? Some part of your config? A text file? A file you want to compress in Emacs and send via email? What are you trying to do here? – zck Jan 16 '20 at 07:39
-
Clarified - an data could be an elisp string, for e.g. – ideasman42 Jan 16 '20 at 08:41
-
1AFAIK automatic (de)compression is done by `jka-compr-...` and this relies on external programs for compression/decompression. A complete search of the Emacs C-sources for `compress` with [elgrep](https://github.com/TobiasZawada/elgrep) only gives significant hits in [`decompress.c`](https://github.com/emacs-mirror/emacs/blob/master/src/decompress.c) which you already found. The other hits for `compress` are unrelated (`gnutls.c`, `image.c`, or `sound.c`). [Github search](https://github.com/emacs-mirror/emacs/search?q=compress+extension%3Ac&unscoped_q=compress+extension%3Ac) does not work. – Tobias Jan 16 '20 at 10:04