From: agrambot@gmail.com
To: 33880@debbugs.gnu.org
Subject: bug#33880: [PATCH] Compress past NEWS files during installation
Date: Wed, 26 Dec 2018 13:49:28 -0600 [thread overview]
Message-ID: <87wonw3w6v.fsf@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 468 bytes --]
This shaves off just over a MB off of the installation using gzip -9.
While I was at it, I put in the compression of etc/refcards/*.ps, which
covers part of a TODO.
I wanted to compress etc/refcards/*.tex as well, but I noticed that it
would affect the Makefile that is also installed. It appears to be the
only Makefile that's installed; if there's little or no reason for it,
would it be okay to remove it during installation and compress the *.tex
files as well?
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Compress-past-NEWS-files-and-etc-refcards-.ps.patch --]
[-- Type: text/x-patch, Size: 4420 bytes --]
From 40bd26ccbbae7c486dc2be39fe21147694889af4 Mon Sep 17 00:00:00 2001
From: Alexander Gramiak <agrambot@gmail.com>
Date: Mon, 24 Dec 2018 18:06:30 -0600
Subject: [PATCH] Compress past NEWS files and etc/refcards/*.ps
Do not compress NEWS or ORG-NEWS as those are actively updated and
shouldn't rely on decompression support to be viewed.
* Makefile.in (install-arch-indep): Do it.
* lisp/help.el (view-emacs-news): Refactor slightly, and support
compressed NEWS files when `auto-compression-mode' is enabled.
---
Makefile.in | 9 ++++++---
etc/NEWS | 3 +++
lisp/help.el | 28 +++++++++++++++++-----------
3 files changed, 26 insertions(+), 14 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index f0b2b66c88..bbb028a74a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -541,8 +541,7 @@ set_installuser=
## install-etcdoc installs the relevant DOC.
## Note that we install etc/refcards/*.ps if present.
-## TODO we should compress these if GZIP_PROG is set.
-## It would be simpler to have a separate install rule for etc/refcards
+## TODO It would be simpler to have a separate install rule for etc/refcards
## (maybe move it to doc/refcards?).
## Note that the Makefiles in the etc directory are potentially useful
@@ -616,7 +615,11 @@ install-arch-indep:
for f in `find . -name "*.elc" -print | sed 's/.elc$$/.el/'`; do \
${GZIP_PROG} -9n "$$f"; \
done; \
- ${GZIP_PROG} -9n "../etc/publicsuffix.txt"; \
+ cd "$(DESTDIR)${etcdir}" && \
+ for f in `find . -maxdepth 1 -name "*NEWS*" -not -name NEWS \
+ -not -name ORG-NEWS` `find refcards -name "*.ps"` "publicsuffix.txt"; do \
+ ${GZIP_PROG} -9n "$$f"; \
+ done; \
}
-chmod -R a+r "$(DESTDIR)${datadir}/emacs/${version}" ${COPYDESTS}
diff --git a/etc/NEWS b/etc/NEWS
index e427e84780..586e7065d1 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -37,6 +37,9 @@ functions 'json-serialize', 'json-insert', 'json-parse-string', and
'json-parse-buffer' are typically much faster than their Lisp
counterparts from json.el.
+** NEWS files for past Emacs versions and packages are now compressed
+by default.
+
** The etags program now uses the C library's regular expression matcher
when possible, and a compatible regex substitute otherwise. This will
let developers maintain Emacs's own regex code without having to also
diff --git a/lisp/help.el b/lisp/help.el
index ad782f74ca..e0738da485 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -350,16 +350,18 @@ view-emacs-news
(mapc
(lambda (file)
(with-temp-buffer
- (insert-file-contents
- (expand-file-name file data-directory))
- (while (re-search-forward
- (if (member file '("NEWS.18" "NEWS.1-17"))
- "Changes in \\(?:Emacs\\|version\\)?[ \t]*\\([0-9]+\\(?:\\.[0-9]+\\)?\\)"
- "^\\* [^0-9\n]*\\([0-9]+\\.[0-9]+\\)") nil t)
- (setq res (cons (match-string-no-properties 1) res)))))
- (cons "NEWS"
- (directory-files data-directory nil
- "^NEWS\\.[0-9][-0-9]*$" nil)))
+ (insert-file-contents file)
+ (let ((section (if (string-match "\\`NEWS\\.\\(1-17\\|18\\)"
+ (file-name-nondirectory file))
+ "Changes in \\(?:Emacs\\|version\\)?[ \t]*\\([0-9]+\\(?:\\.[0-9]+\\)?\\)"
+ "^\\* [^0-9\n]*\\([0-9]+\\.[0-9]+\\)")))
+ (while (re-search-forward section nil t)
+ (setq res (cons (match-string-no-properties 1) res))))))
+ (cons (expand-file-name "NEWS" data-directory)
+ (directory-files data-directory
+ t
+ (format "^NEWS\\.[0-9][-0-9]*%s\\'"
+ (regexp-opt load-file-rep-suffixes)))))
(sort (delete-dups res) #'string>)))
(current (car all-versions)))
(setq version (completing-read
@@ -385,7 +387,11 @@ view-emacs-news
((< vn 18) "NEWS.1-17")
(t (format "NEWS.%d" vn))))
res)
- (view-file (expand-file-name file data-directory))
+ (view-file (or (locate-file file
+ (list data-directory)
+ load-file-rep-suffixes)
+ (error "Requested NEWS file is compressed; please enable \
+`auto-compression-mode' and try again")))
(widen)
(goto-char (point-min))
(when (stringp version)
--
2.20.1
next reply other threads:[~2018-12-26 19:49 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-26 19:49 agrambot [this message]
2019-03-14 14:57 ` bug#33880: [PATCH] Compress past NEWS files during installation Alex
2019-03-14 15:14 ` Eli Zaretskii
2019-03-14 15:43 ` Alex
2019-03-14 15:54 ` Michael Albinus
2019-03-14 16:23 ` Alex
2019-03-14 17:59 ` Eli Zaretskii
2019-03-14 21:33 ` Alex
2019-03-14 22:00 ` Glenn Morris
2019-03-15 4:53 ` Eli Zaretskii
2019-03-16 18:28 ` Alex
2019-03-16 18:51 ` Eli Zaretskii
2019-03-16 20:08 ` Michael Albinus
2019-06-23 20:02 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wonw3w6v.fsf@gmail.com \
--to=agrambot@gmail.com \
--cc=33880@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.