Commit c28ef9a4 authored by David Reitter's avatar David Reitter

Compress publicsuffix file to save space

* url-domsuf.el (url-domsuf-parse-file): Read compressed
publicsuffix file if available.
* Makefile.in (install-arch-indep): Compress publicsuffix.txt file.
parent a5cbb7d9
2014-11-14 David Reitter <david.reitter@gmail.com>
* Makefile.in (install-arch-indep): Compress publicsuffix.txt file.
2014-11-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
* .gitignore: Copy over sufficient ignorable files from the old
......
......@@ -259,7 +259,7 @@ MKDIR_P = @MKDIR_P@
# Create a link to a file in the same directory as the target.
LN_S_FILEONLY = @LN_S_FILEONLY@
# We use gzip to compress installed .el files.
# We use gzip to compress installed .el and some .txt files.
GZIP_PROG = @GZIP_PROG@
# ============================= Targets ==============================
......@@ -600,11 +600,12 @@ install-arch-indep: lisp install-info install-man ${INSTALL_ARCH_INDEP_EXTRA}
subdir="$(DESTDIR)${datadir}/emacs/site-lisp" ; \
${write_subdir} || true
[ -z "${GZIP_PROG}" ] || { \
echo "Compressing *.el ..." && \
echo "Compressing *.el etc. ..." && \
cd "$(DESTDIR)${lispdir}" && \
for f in `find . -name "*.elc" -print | sed 's/.elc$$/.el/'`; do \
${GZIP_PROG} -9n "$$f"; \
done; \
${GZIP_PROG} -9n "../etc/publicsuffix.txt"; \
}
-chmod -R a+r "$(DESTDIR)${datadir}/emacs/${version}" ${COPYDESTS}
......
2014-11-14 David Reitter <david.reitter@gmail.com>
* url-domsuf.el (url-domsuf-parse-file): Read compressed
publicsuffix file if available.
2014-11-05 Teodor Zlatanov <tzz@lifelogs.com>
* url-http.el (url-user-agent): New variable, can be function or
......
......@@ -32,8 +32,12 @@
(defun url-domsuf-parse-file ()
(with-temp-buffer
(insert-file-contents
(expand-file-name "publicsuffix.txt" data-directory))
(with-auto-compression-mode
(insert-file-contents
(let* ((suffixfile (expand-file-name "publicsuffix.txt" data-directory))
(compressed-file (concat suffixfile ".gz")))
(or (and (file-readable-p compressed-file) compressed-file)
suffixfile))))
(let ((domains nil)
domain exception)
(while (not (eobp))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment