Mercurial > emacs
annotate lisp/jka-cmpr-hook.el @ 112101:f17e96101723
nnimap.el (nnimap-login): Refactored out into own function, and implement CRAM-MD5.
(nnimap-wait-for-line): Refactored out.
shr.el (shr-rescale-image): Display all GIF images as animated images.
nnimap.el (nnimap-login): Prefer AUTH=CRAM-MD5, if it's available. This avoids sending passwords in plain text over non-encrypted channels.
author | Katsumi Yamaoka <yamaoka@jpl.org> |
---|---|
date | Sun, 02 Jan 2011 23:17:32 +0000 |
parents | dc23e3f2eabb |
children | 417b1e4d63cd |
rev | line source |
---|---|
62107
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
1 ;;; jka-cmpr-hook.el --- preloaded code to enable jka-compr.el |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
2 |
74441
2a90b4256c2d
Revert previous change (file was not in Emacs in 2001).
Glenn Morris <rgm@gnu.org>
parents:
74439
diff
changeset
|
3 ;; Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2002, 2003, |
106815 | 4 ;; 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. |
62107
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
5 |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
6 ;; Author: jka@ece.cmu.edu (Jay K. Adams) |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
7 ;; Maintainer: FSF |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
8 ;; Keywords: data |
110015
280c8ae2476d
Add "Package:" file headers to denote built-in packages.
Chong Yidong <cyd@stupidchicken.com>
parents:
106815
diff
changeset
|
9 ;; Package: emacs |
62107
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
10 |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
11 ;; This file is part of GNU Emacs. |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
12 |
94678
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
91897
diff
changeset
|
13 ;; GNU Emacs is free software: you can redistribute it and/or modify |
62107
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
14 ;; it under the terms of the GNU General Public License as published by |
94678
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
91897
diff
changeset
|
15 ;; the Free Software Foundation, either version 3 of the License, or |
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
91897
diff
changeset
|
16 ;; (at your option) any later version. |
62107
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
17 |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
18 ;; GNU Emacs is distributed in the hope that it will be useful, |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
21 ;; GNU General Public License for more details. |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
22 |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
23 ;; You should have received a copy of the GNU General Public License |
94678
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
91897
diff
changeset
|
24 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
62107
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
25 |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
26 ;;; Commentary: |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
27 |
69161
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
28 ;; This file contains the code to enable and disable Auto-Compression mode. |
62107
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
29 ;; It is preloaded. The guts of this mode are in jka-compr.el, which |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
30 ;; is loaded only when you really try to uncompress something. |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
31 |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
32 ;;; Code: |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
33 |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
34 (defgroup compression nil |
64014
29c6e26ca9a1
(compression, jka-compr): Finish `defgroup' description with period.
Juanma Barranquero <lekktu@gmail.com>
parents:
62107
diff
changeset
|
35 "Data compression utilities." |
62107
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
36 :group 'data) |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
37 |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
38 (defgroup jka-compr nil |
64014
29c6e26ca9a1
(compression, jka-compr): Finish `defgroup' description with period.
Juanma Barranquero <lekktu@gmail.com>
parents:
62107
diff
changeset
|
39 "jka-compr customization." |
62107
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
40 :group 'compression) |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
41 |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
42 ;; List of all the elements we actually added to file-coding-system-alist. |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
43 (defvar jka-compr-added-to-file-coding-system-alist nil) |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
44 |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
45 (defvar jka-compr-file-name-handler-entry |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
46 nil |
69161
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
47 "`file-name-handler-alist' entry used by jka-compr I/O functions.") |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
48 |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
49 ;; Compiler defvars. These three variables will be defined later with |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
50 ;; `defcustom' when everything used in the :set functions is defined. |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
51 (defvar jka-compr-compression-info-list) |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
52 (defvar jka-compr-mode-alist-additions) |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
53 (defvar jka-compr-load-suffixes) |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
54 |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
55 (defvar jka-compr-compression-info-list--internal nil |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
56 "Stored value of `jka-compr-compression-info-list'. |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
57 If Auto Compression mode is enabled, this is the value of |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
58 `jka-compr-compression-info-list' when `jka-compr-install' was last called. |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
59 Otherwise, it is nil.") |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
60 |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
61 (defvar jka-compr-mode-alist-additions--internal nil |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
62 "Stored value of `jka-compr-mode-alist-additions'. |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
63 If Auto Compression mode is enabled, this is the value of |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
64 `jka-compr-mode-alist-additions' when `jka-compr-install' was last called. |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
65 Otherwise, it is nil.") |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
66 |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
67 (defvar jka-compr-load-suffixes--internal nil |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
68 "Stored value of `jka-compr-load-suffixes'. |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
69 If Auto Compression mode is enabled, this is the value of |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
70 `jka-compr-load-suffixes' when `jka-compr-install' was last called. |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
71 Otherwise, it is nil.") |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
72 |
62107
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
73 |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
74 (defun jka-compr-build-file-regexp () |
105965
3f64b8380468
* textmodes/ispell.el (ispell-skip-region-alist):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
105870
diff
changeset
|
75 (purecopy |
111847
dc23e3f2eabb
* lisp/files.el (dir-locals-collect-variables): Don't let errors stop us.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110034
diff
changeset
|
76 (let ((re-anchored '()) |
dc23e3f2eabb
* lisp/files.el (dir-locals-collect-variables): Don't let errors stop us.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110034
diff
changeset
|
77 (re-free '())) |
dc23e3f2eabb
* lisp/files.el (dir-locals-collect-variables): Don't let errors stop us.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110034
diff
changeset
|
78 (dolist (e jka-compr-compression-info-list) |
dc23e3f2eabb
* lisp/files.el (dir-locals-collect-variables): Don't let errors stop us.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110034
diff
changeset
|
79 (let ((re (jka-compr-info-regexp e))) |
dc23e3f2eabb
* lisp/files.el (dir-locals-collect-variables): Don't let errors stop us.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110034
diff
changeset
|
80 (if (string-match "\\\\'\\'" re) |
dc23e3f2eabb
* lisp/files.el (dir-locals-collect-variables): Don't let errors stop us.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110034
diff
changeset
|
81 (push (substring re 0 (match-beginning 0)) re-anchored) |
dc23e3f2eabb
* lisp/files.el (dir-locals-collect-variables): Don't let errors stop us.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110034
diff
changeset
|
82 (push re re-free)))) |
dc23e3f2eabb
* lisp/files.el (dir-locals-collect-variables): Don't let errors stop us.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110034
diff
changeset
|
83 (concat |
dc23e3f2eabb
* lisp/files.el (dir-locals-collect-variables): Don't let errors stop us.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110034
diff
changeset
|
84 (if re-free (concat (mapconcat 'identity re-free "\\|") "\\|")) |
dc23e3f2eabb
* lisp/files.el (dir-locals-collect-variables): Don't let errors stop us.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110034
diff
changeset
|
85 "\\(?:" |
dc23e3f2eabb
* lisp/files.el (dir-locals-collect-variables): Don't let errors stop us.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110034
diff
changeset
|
86 (mapconcat 'identity re-anchored "\\|") |
dc23e3f2eabb
* lisp/files.el (dir-locals-collect-variables): Don't let errors stop us.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110034
diff
changeset
|
87 "\\)" file-name-version-regexp "?\\'")))) |
62107
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
88 |
66806
97261130eb5b
(jka-compr-install): Use push and dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
65991
diff
changeset
|
89 ;; Functions for accessing the return value of jka-compr-get-compression-info |
62107
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
90 (defun jka-compr-info-regexp (info) (aref info 0)) |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
91 (defun jka-compr-info-compress-message (info) (aref info 1)) |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
92 (defun jka-compr-info-compress-program (info) (aref info 2)) |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
93 (defun jka-compr-info-compress-args (info) (aref info 3)) |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
94 (defun jka-compr-info-uncompress-message (info) (aref info 4)) |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
95 (defun jka-compr-info-uncompress-program (info) (aref info 5)) |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
96 (defun jka-compr-info-uncompress-args (info) (aref info 6)) |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
97 (defun jka-compr-info-can-append (info) (aref info 7)) |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
98 (defun jka-compr-info-strip-extension (info) (aref info 8)) |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
99 (defun jka-compr-info-file-magic-bytes (info) (aref info 9)) |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
100 |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
101 |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
102 (defun jka-compr-get-compression-info (filename) |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
103 "Return information about the compression scheme of FILENAME. |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
104 The determination as to which compression scheme, if any, to use is |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
105 based on the filename itself and `jka-compr-compression-info-list'." |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
106 (catch 'compression-info |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
107 (let ((case-fold-search nil)) |
111847
dc23e3f2eabb
* lisp/files.el (dir-locals-collect-variables): Don't let errors stop us.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110034
diff
changeset
|
108 (dolist (x jka-compr-compression-info-list) |
dc23e3f2eabb
* lisp/files.el (dir-locals-collect-variables): Don't let errors stop us.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110034
diff
changeset
|
109 (and (string-match (jka-compr-info-regexp x) filename) |
dc23e3f2eabb
* lisp/files.el (dir-locals-collect-variables): Don't let errors stop us.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110034
diff
changeset
|
110 (throw 'compression-info x))) |
62107
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
111 nil))) |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
112 |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
113 (defun jka-compr-install () |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
114 "Install jka-compr. |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
115 This adds entries to `file-name-handler-alist' and `auto-mode-alist' |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
116 and `inhibit-first-line-modes-suffixes'." |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
117 |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
118 (setq jka-compr-file-name-handler-entry |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
119 (cons (jka-compr-build-file-regexp) 'jka-compr-handler)) |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
120 |
66806
97261130eb5b
(jka-compr-install): Use push and dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
65991
diff
changeset
|
121 (push jka-compr-file-name-handler-entry file-name-handler-alist) |
62107
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
122 |
69161
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
123 (setq jka-compr-compression-info-list--internal |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
124 jka-compr-compression-info-list |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
125 jka-compr-mode-alist-additions--internal |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
126 jka-compr-mode-alist-additions |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
127 jka-compr-load-suffixes--internal |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
128 jka-compr-load-suffixes) |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
129 |
66806
97261130eb5b
(jka-compr-install): Use push and dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
65991
diff
changeset
|
130 (dolist (x jka-compr-compression-info-list) |
97261130eb5b
(jka-compr-install): Use push and dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
65991
diff
changeset
|
131 ;; Don't do multibyte encoding on the compressed files. |
97261130eb5b
(jka-compr-install): Use push and dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
65991
diff
changeset
|
132 (let ((elt (cons (jka-compr-info-regexp x) |
97261130eb5b
(jka-compr-install): Use push and dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
65991
diff
changeset
|
133 '(no-conversion . no-conversion)))) |
97261130eb5b
(jka-compr-install): Use push and dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
65991
diff
changeset
|
134 (push elt file-coding-system-alist) |
97261130eb5b
(jka-compr-install): Use push and dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
65991
diff
changeset
|
135 (push elt jka-compr-added-to-file-coding-system-alist)) |
62107
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
136 |
66806
97261130eb5b
(jka-compr-install): Use push and dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
65991
diff
changeset
|
137 (and (jka-compr-info-strip-extension x) |
97261130eb5b
(jka-compr-install): Use push and dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
65991
diff
changeset
|
138 ;; Make entries in auto-mode-alist so that modes |
97261130eb5b
(jka-compr-install): Use push and dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
65991
diff
changeset
|
139 ;; are chosen right according to the file names |
97261130eb5b
(jka-compr-install): Use push and dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
65991
diff
changeset
|
140 ;; sans `.gz'. |
97261130eb5b
(jka-compr-install): Use push and dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
65991
diff
changeset
|
141 (push (list (jka-compr-info-regexp x) nil 'jka-compr) auto-mode-alist) |
97261130eb5b
(jka-compr-install): Use push and dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
65991
diff
changeset
|
142 ;; Also add these regexps to |
97261130eb5b
(jka-compr-install): Use push and dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
65991
diff
changeset
|
143 ;; inhibit-first-line-modes-suffixes, so that a |
97261130eb5b
(jka-compr-install): Use push and dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
65991
diff
changeset
|
144 ;; -*- line in the first file of a compressed tar |
97261130eb5b
(jka-compr-install): Use push and dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
65991
diff
changeset
|
145 ;; file doesn't override tar-mode. |
97261130eb5b
(jka-compr-install): Use push and dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
65991
diff
changeset
|
146 (push (jka-compr-info-regexp x) |
97261130eb5b
(jka-compr-install): Use push and dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
65991
diff
changeset
|
147 inhibit-first-line-modes-suffixes))) |
62107
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
148 (setq auto-mode-alist |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
149 (append auto-mode-alist jka-compr-mode-alist-additions)) |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
150 |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
151 ;; Make sure that (load "foo") will find /bla/foo.el.gz. |
69161
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
152 (setq load-file-rep-suffixes |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
153 (append load-file-rep-suffixes jka-compr-load-suffixes nil))) |
62107
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
154 |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
155 (defun jka-compr-installed-p () |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
156 "Return non-nil if jka-compr is installed. |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
157 The return value is the entry in `file-name-handler-alist' for jka-compr." |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
158 |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
159 (let ((fnha file-name-handler-alist) |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
160 (installed nil)) |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
161 |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
162 (while (and fnha (not installed)) |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
163 (and (eq (cdr (car fnha)) 'jka-compr-handler) |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
164 (setq installed (car fnha))) |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
165 (setq fnha (cdr fnha))) |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
166 |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
167 installed)) |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
168 |
69161
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
169 (defun jka-compr-update () |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
170 "Update Auto Compression mode for changes in option values. |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
171 If you change the options `jka-compr-compression-info-list', |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
172 `jka-compr-mode-alist-additions' or `jka-compr-load-suffixes' |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
173 outside Custom, while Auto Compression mode is already enabled |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
174 \(as it is by default), then you have to call this function |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
175 afterward to properly update other variables. Setting these |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
176 options through Custom does this automatically." |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
177 (when (jka-compr-installed-p) |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
178 (jka-compr-uninstall) |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
179 (jka-compr-install))) |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
180 |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
181 (defun jka-compr-set (variable value) |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
182 "Internal Custom :set function." |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
183 (set-default variable value) |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
184 (jka-compr-update)) |
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
185 |
69162
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
186 ;; I have this defined so that .Z files are assumed to be in unix |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
187 ;; compress format; and .gz files, in gzip format, and .bz2 files in bzip fmt. |
91897 | 188 |
189 ;; FIXME? It seems ugly that one has to add "\\(~\\|\\.~[0-9]+~\\)?" to | |
190 ;; all the regexps here, in order to match backup files etc. | |
191 ;; It's trivial to modify jka-compr-get-compression-info to match | |
192 ;; regexps against file-name-sans-versions, but this regexp is also | |
193 ;; used to build a file-name-handler-alist entry. | |
194 ;; find-file-name-handler does not use file-name-sans-versions. | |
195 ;; Perhaps it should, | |
196 ;; http://lists.gnu.org/archive/html/emacs-devel/2008-02/msg00812.html, | |
197 ;; but it's used all over the place and there are probably other ramifications. | |
198 ;; One could modify jka-compr-build-file-regexp to add the backup regexp, | |
199 ;; but jka-compr-compression-info-list is a defcustom to which | |
200 ;; anything could be added, so it's easiest to leave things as they are. | |
69162
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
201 (defcustom jka-compr-compression-info-list |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
202 ;;[regexp |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
203 ;; compr-message compr-prog compr-args |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
204 ;; uncomp-message uncomp-prog uncomp-args |
82834
4b2a7cbf8aaf
(jka-compr-compression-info-list): Add .svgz to treat it like .tgz.
Juri Linkov <juri@jurta.org>
parents:
78236
diff
changeset
|
205 ;; can-append strip-extension-flag file-magic-bytes] |
105870
26baacb565b0
* textmodes/tex-mode.el (tex-alt-dvi-print-command)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
103523
diff
changeset
|
206 (mapcar 'purecopy |
111847
dc23e3f2eabb
* lisp/files.el (dir-locals-collect-variables): Don't let errors stop us.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110034
diff
changeset
|
207 '(["\\.Z\\'" |
69162
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
208 "compressing" "compress" ("-c") |
84551 | 209 ;; gzip is more common than uncompress. It can only read, not write. |
84502
951310899f2e
Aaron Hawley <aaronh at garden.org>
Glenn Morris <rgm@gnu.org>
parents:
82834
diff
changeset
|
210 "uncompressing" "gzip" ("-c" "-q" "-d") |
69162
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
211 nil t "\037\235"] |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
212 ;; Formerly, these had an additional arg "-c", but that fails with |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
213 ;; "Version 0.1pl2, 29-Aug-97." (RedHat 5.1 GNU/Linux) and |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
214 ;; "Version 0.9.0b, 9-Sept-98". |
111847
dc23e3f2eabb
* lisp/files.el (dir-locals-collect-variables): Don't let errors stop us.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110034
diff
changeset
|
215 ["\\.bz2\\'" |
69162
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
216 "bzip2ing" "bzip2" nil |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
217 "bunzip2ing" "bzip2" ("-d") |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
218 nil t "BZh"] |
98477
6f4a17d53119
(jka-compr-compression-info-list)
Glenn Morris <rgm@gnu.org>
parents:
94678
diff
changeset
|
219 ["\\.tbz2?\\'" |
69162
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
220 "bzip2ing" "bzip2" nil |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
221 "bunzip2ing" "bzip2" ("-d") |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
222 nil nil "BZh"] |
111847
dc23e3f2eabb
* lisp/files.el (dir-locals-collect-variables): Don't let errors stop us.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110034
diff
changeset
|
223 ["\\.\\(?:tgz\\|svgz\\|sifz\\)\\'" |
69162
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
224 "compressing" "gzip" ("-c" "-q") |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
225 "uncompressing" "gzip" ("-c" "-q" "-d") |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
226 t nil "\037\213"] |
111847
dc23e3f2eabb
* lisp/files.el (dir-locals-collect-variables): Don't let errors stop us.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110034
diff
changeset
|
227 ["\\.g?z\\'" |
69162
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
228 "compressing" "gzip" ("-c" "-q") |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
229 "uncompressing" "gzip" ("-c" "-q" "-d") |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
230 t t "\037\213"] |
111847
dc23e3f2eabb
* lisp/files.el (dir-locals-collect-variables): Don't let errors stop us.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110034
diff
changeset
|
231 ["\\.xz\\'" |
103523
1dbbf8227afc
automatically handle .xz suffix (XZ-compressed files), too
Jim Meyering <jim@meyering.net>
parents:
100908
diff
changeset
|
232 "XZ compressing" "xz" ("-c" "-q") |
1dbbf8227afc
automatically handle .xz suffix (XZ-compressed files), too
Jim Meyering <jim@meyering.net>
parents:
100908
diff
changeset
|
233 "XZ uncompressing" "xz" ("-c" "-q" "-d") |
1dbbf8227afc
automatically handle .xz suffix (XZ-compressed files), too
Jim Meyering <jim@meyering.net>
parents:
100908
diff
changeset
|
234 t t "\3757zXZ\0"] |
69162
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
235 ;; dzip is gzip with random access. Its compression program can't |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
236 ;; read/write stdin/out, so .dz files can only be viewed without |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
237 ;; saving, having their contents decompressed with gzip. |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
238 ["\\.dz\\'" |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
239 nil nil nil |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
240 "uncompressing" "gzip" ("-c" "-q" "-d") |
105870
26baacb565b0
* textmodes/tex-mode.el (tex-alt-dvi-print-command)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
103523
diff
changeset
|
241 nil t "\037\213"])) |
69162
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
242 |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
243 "List of vectors that describe available compression techniques. |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
244 Each element, which describes a compression technique, is a vector of |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
245 the form [REGEXP COMPRESS-MSG COMPRESS-PROGRAM COMPRESS-ARGS |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
246 UNCOMPRESS-MSG UNCOMPRESS-PROGRAM UNCOMPRESS-ARGS |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
247 APPEND-FLAG STRIP-EXTENSION-FLAG FILE-MAGIC-CHARS], where: |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
248 |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
249 regexp is a regexp that matches filenames that are |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
250 compressed with this format |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
251 |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
252 compress-msg is the message to issue to the user when doing this |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
253 type of compression (nil means no message) |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
254 |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
255 compress-program is a program that performs this compression |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
256 (nil means visit file in read-only mode) |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
257 |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
258 compress-args is a list of args to pass to the compress program |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
259 |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
260 uncompress-msg is the message to issue to the user when doing this |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
261 type of uncompression (nil means no message) |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
262 |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
263 uncompress-program is a program that performs this compression |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
264 |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
265 uncompress-args is a list of args to pass to the uncompress program |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
266 |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
267 append-flag is non-nil if this compression technique can be |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
268 appended |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
269 |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
270 strip-extension-flag non-nil means strip the regexp from file names |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
271 before attempting to set the mode. |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
272 |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
273 file-magic-chars is a string of characters that you would find |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
274 at the beginning of a file compressed in this way. |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
275 |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
276 If you set this outside Custom while Auto Compression mode is |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
277 already enabled \(as it is by default), you have to call |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
278 `jka-compr-update' after setting it to properly update other |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
279 variables. Setting this through Custom does that automatically." |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
280 :type '(repeat (vector regexp |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
281 (choice :tag "Compress Message" |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
282 (string :format "%v") |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
283 (const :tag "No Message" nil)) |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
284 (choice :tag "Compress Program" |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
285 (string) |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
286 (const :tag "None" nil)) |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
287 (repeat :tag "Compress Arguments" string) |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
288 (choice :tag "Uncompress Message" |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
289 (string :format "%v") |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
290 (const :tag "No Message" nil)) |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
291 (choice :tag "Uncompress Program" |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
292 (string) |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
293 (const :tag "None" nil)) |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
294 (repeat :tag "Uncompress Arguments" string) |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
295 (boolean :tag "Append") |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
296 (boolean :tag "Strip Extension") |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
297 (string :tag "Magic Bytes"))) |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
298 :set 'jka-compr-set |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
299 :group 'jka-compr) |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
300 |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
301 (defcustom jka-compr-mode-alist-additions |
105870
26baacb565b0
* textmodes/tex-mode.el (tex-alt-dvi-print-command)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
103523
diff
changeset
|
302 (list (cons (purecopy "\\.tgz\\'") 'tar-mode) (cons (purecopy "\\.tbz2?\\'") 'tar-mode)) |
69162
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
303 "List of pairs added to `auto-mode-alist' when installing jka-compr. |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
304 Uninstalling jka-compr removes all pairs from `auto-mode-alist' that |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
305 installing added. |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
306 |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
307 If you set this outside Custom while Auto Compression mode is |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
308 already enabled \(as it is by default), you have to call |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
309 `jka-compr-update' after setting it to properly update other |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
310 variables. Setting this through Custom does that automatically." |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
311 :type '(repeat (cons string symbol)) |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
312 :set 'jka-compr-set |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
313 :group 'jka-compr) |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
314 |
105870
26baacb565b0
* textmodes/tex-mode.el (tex-alt-dvi-print-command)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
103523
diff
changeset
|
315 (defcustom jka-compr-load-suffixes (list (purecopy ".gz")) |
69162
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
316 "List of compression related suffixes to try when loading files. |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
317 Enabling Auto Compression mode appends this list to `load-file-rep-suffixes', |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
318 which see. Disabling Auto Compression mode removes all suffixes |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
319 from `load-file-rep-suffixes' that enabling added. |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
320 |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
321 If you set this outside Custom while Auto Compression mode is |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
322 already enabled \(as it is by default), you have to call |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
323 `jka-compr-update' after setting it to properly update other |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
324 variables. Setting this through Custom does that automatically." |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
325 :type '(repeat string) |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
326 :set 'jka-compr-set |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
327 :group 'jka-compr) |
ada9af8312a6
Second step of the previous changes: move all defcustoms to where they belong.
Luc Teirlinck <teirllm@auburn.edu>
parents:
69161
diff
changeset
|
328 |
62107
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
329 (define-minor-mode auto-compression-mode |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
330 "Toggle automatic file compression and uncompression. |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
331 With prefix argument ARG, turn auto compression on if positive, else off. |
69161
70d5fa701ff8
(jka-compr-compression-info-list)
Luc Teirlinck <teirllm@auburn.edu>
parents:
68651
diff
changeset
|
332 Return the new status of auto compression (non-nil means on)." |
66915
63bd5d2223ee
(auto-compression-mode): Add :version keyword, because default was changed.
Luc Teirlinck <teirllm@auburn.edu>
parents:
66876
diff
changeset
|
333 :global t :init-value t :group 'jka-compr :version "22.1" |
62107
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
334 (let* ((installed (jka-compr-installed-p)) |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
335 (flag auto-compression-mode)) |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
336 (cond |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
337 ((and flag installed) t) ; already installed |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
338 ((and (not flag) (not installed)) nil) ; already not installed |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
339 (flag (jka-compr-install)) |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
340 (t (jka-compr-uninstall))))) |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
341 |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
342 (defmacro with-auto-compression-mode (&rest body) |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
343 "Evalute BODY with automatic file compression and uncompression enabled." |
110034
c87f89486bb7
Use `declare' in defmacros.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110015
diff
changeset
|
344 (declare (indent 0)) |
62107
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
345 (let ((already-installed (make-symbol "already-installed"))) |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
346 `(let ((,already-installed (jka-compr-installed-p))) |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
347 (unwind-protect |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
348 (progn |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
349 (unless ,already-installed |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
350 (jka-compr-install)) |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
351 ,@body) |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
352 (unless ,already-installed |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
353 (jka-compr-uninstall)))))) |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
354 |
66806
97261130eb5b
(jka-compr-install): Use push and dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
65991
diff
changeset
|
355 ;; This is what we need to know about jka-compr-handler |
97261130eb5b
(jka-compr-install): Use push and dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
65991
diff
changeset
|
356 ;; in order to decide when to call it. |
62107
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
357 |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
358 (put 'jka-compr-handler 'safe-magic t) |
65991
f7281b30e8c9
(jka-compr-handler): Fix typo in `operations' prop.
Richard M. Stallman <rms@gnu.org>
parents:
64762
diff
changeset
|
359 (put 'jka-compr-handler 'operations '(byte-compiler-base-file-name |
62107
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
360 write-region insert-file-contents |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
361 file-local-copy load)) |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
362 |
66806
97261130eb5b
(jka-compr-install): Use push and dolist.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
65991
diff
changeset
|
363 ;; Turn on the mode. |
66876
224ffce45ccb
(auto-compression-mode): Enable it in a way that works correctly for
Luc Teirlinck <teirllm@auburn.edu>
parents:
66806
diff
changeset
|
364 (when auto-compression-mode (auto-compression-mode 1)) |
62107
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
365 |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
366 (provide 'jka-cmpr-hook) |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
367 |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
368 ;; arch-tag: 4bd73429-f400-45fe-a065-270a113e31a8 |
4f5570943f21
Renamed jka-comp-hook.el to jka-cmpr-hook.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff
changeset
|
369 ;;; jka-cmpr-hook.el ends here |