diff options
| author | Luc Teirlinck | 2006-02-27 01:50:36 +0000 |
|---|---|---|
| committer | Luc Teirlinck | 2006-02-27 01:50:36 +0000 |
| commit | df66263e1d121a466c97be5cbd4f5de30aac93a2 (patch) | |
| tree | f522927c47b3e0a08ae447e0543396a9b1fa109a | |
| parent | ea8e053756c1d94d03fcbd35e73842e3acc249bf (diff) | |
| download | emacs-df66263e1d121a466c97be5cbd4f5de30aac93a2.tar.gz emacs-df66263e1d121a466c97be5cbd4f5de30aac93a2.zip | |
Second step of the previous changes: move all defcustoms to where they belong.
| -rw-r--r-- | lisp/jka-cmpr-hook.el | 256 |
1 files changed, 128 insertions, 128 deletions
diff --git a/lisp/jka-cmpr-hook.el b/lisp/jka-cmpr-hook.el index 94cffad9d9a..12941e962a0 100644 --- a/lisp/jka-cmpr-hook.el +++ b/lisp/jka-cmpr-hook.el | |||
| @@ -40,134 +40,6 @@ | |||
| 40 | "jka-compr customization." | 40 | "jka-compr customization." |
| 41 | :group 'compression) | 41 | :group 'compression) |
| 42 | 42 | ||
| 43 | ;; I have this defined so that .Z files are assumed to be in unix | ||
| 44 | ;; compress format; and .gz files, in gzip format, and .bz2 files in bzip fmt. | ||
| 45 | (defcustom jka-compr-compression-info-list | ||
| 46 | ;;[regexp | ||
| 47 | ;; compr-message compr-prog compr-args | ||
| 48 | ;; uncomp-message uncomp-prog uncomp-args | ||
| 49 | ;; can-append auto-mode-flag strip-extension-flag file-magic-bytes] | ||
| 50 | '(["\\.Z\\(~\\|\\.~[0-9]+~\\)?\\'" | ||
| 51 | "compressing" "compress" ("-c") | ||
| 52 | "uncompressing" "uncompress" ("-c") | ||
| 53 | nil t "\037\235"] | ||
| 54 | ;; Formerly, these had an additional arg "-c", but that fails with | ||
| 55 | ;; "Version 0.1pl2, 29-Aug-97." (RedHat 5.1 GNU/Linux) and | ||
| 56 | ;; "Version 0.9.0b, 9-Sept-98". | ||
| 57 | ["\\.bz2\\'" | ||
| 58 | "bzip2ing" "bzip2" nil | ||
| 59 | "bunzip2ing" "bzip2" ("-d") | ||
| 60 | nil t "BZh"] | ||
| 61 | ["\\.tbz\\'" | ||
| 62 | "bzip2ing" "bzip2" nil | ||
| 63 | "bunzip2ing" "bzip2" ("-d") | ||
| 64 | nil nil "BZh"] | ||
| 65 | ["\\.tgz\\'" | ||
| 66 | "compressing" "gzip" ("-c" "-q") | ||
| 67 | "uncompressing" "gzip" ("-c" "-q" "-d") | ||
| 68 | t nil "\037\213"] | ||
| 69 | ["\\.g?z\\(~\\|\\.~[0-9]+~\\)?\\'" | ||
| 70 | "compressing" "gzip" ("-c" "-q") | ||
| 71 | "uncompressing" "gzip" ("-c" "-q" "-d") | ||
| 72 | t t "\037\213"] | ||
| 73 | ;; dzip is gzip with random access. Its compression program can't | ||
| 74 | ;; read/write stdin/out, so .dz files can only be viewed without | ||
| 75 | ;; saving, having their contents decompressed with gzip. | ||
| 76 | ["\\.dz\\'" | ||
| 77 | nil nil nil | ||
| 78 | "uncompressing" "gzip" ("-c" "-q" "-d") | ||
| 79 | nil t "\037\213"]) | ||
| 80 | |||
| 81 | "List of vectors that describe available compression techniques. | ||
| 82 | Each element, which describes a compression technique, is a vector of | ||
| 83 | the form [REGEXP COMPRESS-MSG COMPRESS-PROGRAM COMPRESS-ARGS | ||
| 84 | UNCOMPRESS-MSG UNCOMPRESS-PROGRAM UNCOMPRESS-ARGS | ||
| 85 | APPEND-FLAG STRIP-EXTENSION-FLAG FILE-MAGIC-CHARS], where: | ||
| 86 | |||
| 87 | regexp is a regexp that matches filenames that are | ||
| 88 | compressed with this format | ||
| 89 | |||
| 90 | compress-msg is the message to issue to the user when doing this | ||
| 91 | type of compression (nil means no message) | ||
| 92 | |||
| 93 | compress-program is a program that performs this compression | ||
| 94 | (nil means visit file in read-only mode) | ||
| 95 | |||
| 96 | compress-args is a list of args to pass to the compress program | ||
| 97 | |||
| 98 | uncompress-msg is the message to issue to the user when doing this | ||
| 99 | type of uncompression (nil means no message) | ||
| 100 | |||
| 101 | uncompress-program is a program that performs this compression | ||
| 102 | |||
| 103 | uncompress-args is a list of args to pass to the uncompress program | ||
| 104 | |||
| 105 | append-flag is non-nil if this compression technique can be | ||
| 106 | appended | ||
| 107 | |||
| 108 | strip-extension-flag non-nil means strip the regexp from file names | ||
| 109 | before attempting to set the mode. | ||
| 110 | |||
| 111 | file-magic-chars is a string of characters that you would find | ||
| 112 | at the beginning of a file compressed in this way. | ||
| 113 | |||
| 114 | Because of the way `call-process' is defined, discarding the stderr output of | ||
| 115 | a program adds the overhead of starting a shell each time the program is | ||
| 116 | invoked. | ||
| 117 | |||
| 118 | If you set this outside Custom while Auto Compression mode is | ||
| 119 | already enabled \(as it is by default), you have to call | ||
| 120 | `jka-compr-update' after setting it to properly update other | ||
| 121 | variables. Setting this through Custom does that automatically." | ||
| 122 | :type '(repeat (vector regexp | ||
| 123 | (choice :tag "Compress Message" | ||
| 124 | (string :format "%v") | ||
| 125 | (const :tag "No Message" nil)) | ||
| 126 | (choice :tag "Compress Program" | ||
| 127 | (string) | ||
| 128 | (const :tag "None" nil)) | ||
| 129 | (repeat :tag "Compress Arguments" string) | ||
| 130 | (choice :tag "Uncompress Message" | ||
| 131 | (string :format "%v") | ||
| 132 | (const :tag "No Message" nil)) | ||
| 133 | (choice :tag "Uncompress Program" | ||
| 134 | (string) | ||
| 135 | (const :tag "None" nil)) | ||
| 136 | (repeat :tag "Uncompress Arguments" string) | ||
| 137 | (boolean :tag "Append") | ||
| 138 | (boolean :tag "Strip Extension") | ||
| 139 | (string :tag "Magic Bytes"))) | ||
| 140 | :set 'jka-compr-set | ||
| 141 | :group 'jka-compr) | ||
| 142 | |||
| 143 | (defcustom jka-compr-mode-alist-additions | ||
| 144 | (list (cons "\\.tgz\\'" 'tar-mode) (cons "\\.tbz\\'" 'tar-mode)) | ||
| 145 | "List of pairs added to `auto-mode-alist' when installing jka-compr. | ||
| 146 | Uninstalling jka-compr removes all pairs from `auto-mode-alist' that | ||
| 147 | installing added. | ||
| 148 | |||
| 149 | If you set this outside Custom while Auto Compression mode is | ||
| 150 | already enabled \(as it is by default), you have to call | ||
| 151 | `jka-compr-update' after setting it to properly update other | ||
| 152 | variables. Setting this through Custom does that automatically." | ||
| 153 | :type '(repeat (cons string symbol)) | ||
| 154 | :set 'jka-compr-set | ||
| 155 | :group 'jka-compr) | ||
| 156 | |||
| 157 | (defcustom jka-compr-load-suffixes '(".gz") | ||
| 158 | "List of compression related suffixes to try when loading files. | ||
| 159 | Enabling Auto Compression mode appends this list to `load-file-rep-suffixes', | ||
| 160 | which see. Disabling Auto Compression mode removes all suffixes | ||
| 161 | from `load-file-rep-suffixes' that enabling added. | ||
| 162 | |||
| 163 | If you set this outside Custom while Auto Compression mode is | ||
| 164 | already enabled \(as it is by default), you have to call | ||
| 165 | `jka-compr-update' after setting it to properly update other | ||
| 166 | variables. Setting this through Custom does that automatically." | ||
| 167 | :type '(repeat string) | ||
| 168 | :set 'jka-compr-set | ||
| 169 | :group 'jka-compr) | ||
| 170 | |||
| 171 | ;; List of all the elements we actually added to file-coding-system-alist. | 43 | ;; List of all the elements we actually added to file-coding-system-alist. |
| 172 | (defvar jka-compr-added-to-file-coding-system-alist nil) | 44 | (defvar jka-compr-added-to-file-coding-system-alist nil) |
| 173 | 45 | ||
| @@ -305,6 +177,134 @@ options through Custom does this automatically." | |||
| 305 | (set-default variable value) | 177 | (set-default variable value) |
| 306 | (jka-compr-update)) | 178 | (jka-compr-update)) |
| 307 | 179 | ||
| 180 | ;; I have this defined so that .Z files are assumed to be in unix | ||
| 181 | ;; compress format; and .gz files, in gzip format, and .bz2 files in bzip fmt. | ||
| 182 | (defcustom jka-compr-compression-info-list | ||
| 183 | ;;[regexp | ||
| 184 | ;; compr-message compr-prog compr-args | ||
| 185 | ;; uncomp-message uncomp-prog uncomp-args | ||
| 186 | ;; can-append auto-mode-flag strip-extension-flag file-magic-bytes] | ||
| 187 | '(["\\.Z\\(~\\|\\.~[0-9]+~\\)?\\'" | ||
| 188 | "compressing" "compress" ("-c") | ||
| 189 | "uncompressing" "uncompress" ("-c") | ||
| 190 | nil t "\037\235"] | ||
| 191 | ;; Formerly, these had an additional arg "-c", but that fails with | ||
| 192 | ;; "Version 0.1pl2, 29-Aug-97." (RedHat 5.1 GNU/Linux) and | ||
| 193 | ;; "Version 0.9.0b, 9-Sept-98". | ||
| 194 | ["\\.bz2\\'" | ||
| 195 | "bzip2ing" "bzip2" nil | ||
| 196 | "bunzip2ing" "bzip2" ("-d") | ||
| 197 | nil t "BZh"] | ||
| 198 | ["\\.tbz\\'" | ||
| 199 | "bzip2ing" "bzip2" nil | ||
| 200 | "bunzip2ing" "bzip2" ("-d") | ||
| 201 | nil nil "BZh"] | ||
| 202 | ["\\.tgz\\'" | ||
| 203 | "compressing" "gzip" ("-c" "-q") | ||
| 204 | "uncompressing" "gzip" ("-c" "-q" "-d") | ||
| 205 | t nil "\037\213"] | ||
| 206 | ["\\.g?z\\(~\\|\\.~[0-9]+~\\)?\\'" | ||
| 207 | "compressing" "gzip" ("-c" "-q") | ||
| 208 | "uncompressing" "gzip" ("-c" "-q" "-d") | ||
| 209 | t t "\037\213"] | ||
| 210 | ;; dzip is gzip with random access. Its compression program can't | ||
| 211 | ;; read/write stdin/out, so .dz files can only be viewed without | ||
| 212 | ;; saving, having their contents decompressed with gzip. | ||
| 213 | ["\\.dz\\'" | ||
| 214 | nil nil nil | ||
| 215 | "uncompressing" "gzip" ("-c" "-q" "-d") | ||
| 216 | nil t "\037\213"]) | ||
| 217 | |||
| 218 | "List of vectors that describe available compression techniques. | ||
| 219 | Each element, which describes a compression technique, is a vector of | ||
| 220 | the form [REGEXP COMPRESS-MSG COMPRESS-PROGRAM COMPRESS-ARGS | ||
| 221 | UNCOMPRESS-MSG UNCOMPRESS-PROGRAM UNCOMPRESS-ARGS | ||
| 222 | APPEND-FLAG STRIP-EXTENSION-FLAG FILE-MAGIC-CHARS], where: | ||
| 223 | |||
| 224 | regexp is a regexp that matches filenames that are | ||
| 225 | compressed with this format | ||
| 226 | |||
| 227 | compress-msg is the message to issue to the user when doing this | ||
| 228 | type of compression (nil means no message) | ||
| 229 | |||
| 230 | compress-program is a program that performs this compression | ||
| 231 | (nil means visit file in read-only mode) | ||
| 232 | |||
| 233 | compress-args is a list of args to pass to the compress program | ||
| 234 | |||
| 235 | uncompress-msg is the message to issue to the user when doing this | ||
| 236 | type of uncompression (nil means no message) | ||
| 237 | |||
| 238 | uncompress-program is a program that performs this compression | ||
| 239 | |||
| 240 | uncompress-args is a list of args to pass to the uncompress program | ||
| 241 | |||
| 242 | append-flag is non-nil if this compression technique can be | ||
| 243 | appended | ||
| 244 | |||
| 245 | strip-extension-flag non-nil means strip the regexp from file names | ||
| 246 | before attempting to set the mode. | ||
| 247 | |||
| 248 | file-magic-chars is a string of characters that you would find | ||
| 249 | at the beginning of a file compressed in this way. | ||
| 250 | |||
| 251 | Because of the way `call-process' is defined, discarding the stderr output of | ||
| 252 | a program adds the overhead of starting a shell each time the program is | ||
| 253 | invoked. | ||
| 254 | |||
| 255 | If you set this outside Custom while Auto Compression mode is | ||
| 256 | already enabled \(as it is by default), you have to call | ||
| 257 | `jka-compr-update' after setting it to properly update other | ||
| 258 | variables. Setting this through Custom does that automatically." | ||
| 259 | :type '(repeat (vector regexp | ||
| 260 | (choice :tag "Compress Message" | ||
| 261 | (string :format "%v") | ||
| 262 | (const :tag "No Message" nil)) | ||
| 263 | (choice :tag "Compress Program" | ||
| 264 | (string) | ||
| 265 | (const :tag "None" nil)) | ||
| 266 | (repeat :tag "Compress Arguments" string) | ||
| 267 | (choice :tag "Uncompress Message" | ||
| 268 | (string :format "%v") | ||
| 269 | (const :tag "No Message" nil)) | ||
| 270 | (choice :tag "Uncompress Program" | ||
| 271 | (string) | ||
| 272 | (const :tag "None" nil)) | ||
| 273 | (repeat :tag "Uncompress Arguments" string) | ||
| 274 | (boolean :tag "Append") | ||
| 275 | (boolean :tag "Strip Extension") | ||
| 276 | (string :tag "Magic Bytes"))) | ||
| 277 | :set 'jka-compr-set | ||
| 278 | :group 'jka-compr) | ||
| 279 | |||
| 280 | (defcustom jka-compr-mode-alist-additions | ||
| 281 | (list (cons "\\.tgz\\'" 'tar-mode) (cons "\\.tbz\\'" 'tar-mode)) | ||
| 282 | "List of pairs added to `auto-mode-alist' when installing jka-compr. | ||
| 283 | Uninstalling jka-compr removes all pairs from `auto-mode-alist' that | ||
| 284 | installing added. | ||
| 285 | |||
| 286 | If you set this outside Custom while Auto Compression mode is | ||
| 287 | already enabled \(as it is by default), you have to call | ||
| 288 | `jka-compr-update' after setting it to properly update other | ||
| 289 | variables. Setting this through Custom does that automatically." | ||
| 290 | :type '(repeat (cons string symbol)) | ||
| 291 | :set 'jka-compr-set | ||
| 292 | :group 'jka-compr) | ||
| 293 | |||
| 294 | (defcustom jka-compr-load-suffixes '(".gz") | ||
| 295 | "List of compression related suffixes to try when loading files. | ||
| 296 | Enabling Auto Compression mode appends this list to `load-file-rep-suffixes', | ||
| 297 | which see. Disabling Auto Compression mode removes all suffixes | ||
| 298 | from `load-file-rep-suffixes' that enabling added. | ||
| 299 | |||
| 300 | If you set this outside Custom while Auto Compression mode is | ||
| 301 | already enabled \(as it is by default), you have to call | ||
| 302 | `jka-compr-update' after setting it to properly update other | ||
| 303 | variables. Setting this through Custom does that automatically." | ||
| 304 | :type '(repeat string) | ||
| 305 | :set 'jka-compr-set | ||
| 306 | :group 'jka-compr) | ||
| 307 | |||
| 308 | (define-minor-mode auto-compression-mode | 308 | (define-minor-mode auto-compression-mode |
| 309 | "Toggle automatic file compression and uncompression. | 309 | "Toggle automatic file compression and uncompression. |
| 310 | With prefix argument ARG, turn auto compression on if positive, else off. | 310 | With prefix argument ARG, turn auto compression on if positive, else off. |