emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] [emacs] 01/01: Compress publicsuffix file to save space


From: David Reitter
Subject: [Emacs-diffs] [emacs] 01/01: Compress publicsuffix file to save space
Date: Fri, 14 Nov 2014 12:34:35 +0000

davidswelt pushed a commit to branch master
in repository emacs.

commit c28ef9a4662324fe77910e6c82b72cef0c2aa7df
Author: David Reitter <address@hidden>
Date:   Fri Nov 14 07:22:01 2014 -0500

    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.
---
 ChangeLog              |    4 ++++
 Makefile.in            |    5 +++--
 lisp/url/ChangeLog     |    5 +++++
 lisp/url/url-domsuf.el |    8 ++++++--
 4 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 174fe6a..92c3995 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-11-14  David Reitter  <address@hidden>
+
+       * Makefile.in (install-arch-indep): Compress publicsuffix.txt file.
+
 2014-11-13  Lars Magne Ingebrigtsen  <address@hidden>
 
        * .gitignore: Copy over sufficient ignorable files from the old
diff --git a/Makefile.in b/Makefile.in
index 8f5cacb..25d2a08 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -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}
 
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog
index 1362877..1be4ca7 100644
--- a/lisp/url/ChangeLog
+++ b/lisp/url/ChangeLog
@@ -1,3 +1,8 @@
+2014-11-14  David Reitter  <address@hidden>
+
+       * url-domsuf.el (url-domsuf-parse-file): Read compressed
+       publicsuffix file if available.
+
 2014-11-05  Teodor Zlatanov  <address@hidden>
 
        * url-http.el (url-user-agent): New variable, can be function or
diff --git a/lisp/url/url-domsuf.el b/lisp/url/url-domsuf.el
index 365cf56..b7f9259 100644
--- a/lisp/url/url-domsuf.el
+++ b/lisp/url/url-domsuf.el
@@ -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))



reply via email to

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