From: Stefan Monnier Date: Fri, 11 Nov 2005 04:23:02 +0000 (+0000) Subject: (jka-compr-install): Use push and dolist. X-Git-Tag: emacs-pretest-22.0.90~5959 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=be93a2c4484181639c468e79f015739129eaa90b;p=emacs.git (jka-compr-install): Use push and dolist. Add jka-compr-load-suffixes to load-suffixes. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4334eaf7cc6..ff9446de599 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,20 @@ +2005-11-10 Stefan Monnier + + * jka-cmpr-hook.el (jka-compr-install): Use push and dolist. + Add jka-compr-load-suffixes to load-suffixes. + + * jka-compr.el: Require 'jka-cmpr-hook. + (jka-compr-info-compress-message, jka-compr-info-compress-program) + (jka-compr-info-compress-args, jka-compr-info-uncompress-message) + (jka-compr-info-uncompress-program, jka-compr-info-uncompress-args) + (jka-compr-info-can-append, jka-compr-info-strip-extension) + (jka-compr-info-file-magic-bytes, jka-compr-get-compression-info) + (jka-compr-info-regexp): Remove. Provided by jka-cmpr-hook. + (jka-compr-uninstall): Remove entries from + jka-compr-added-to-file-coding-system-alist after they are used. + (jka-compr-error): Remove unused var `curbuf'. + (jka-compr-file-local-copy): Remove unused var `notfound'. + 2005-11-10 Romain Francoise * apropos.el (apropos-calc-scores): Use `apropos-pattern'. @@ -7,6 +24,26 @@ * progmodes/gud.el (gud-menu-map): Move parentheses. (gdb): New command gud-pv. +2005-11-10 Stefan Monnier + + * tar-mode.el: Remove spurious or unnecessary leading stars + in docstrings. + (tar-header-block-tokenize): Also obey default-file-name-coding-system. + (tar-parse-octal-integer-safe): Use mapc. + (tar-header-block-summarize): Remove unused var `ck'. + (tar-summarize-buffer): Don't clear the modified-p bit if it wasn't + cleared before. Obey default-enable-multibyte-characters. + Use mapconcat. Simplify setting of tar-header-offset. + (tar-mode-map): Move initialization inside delcaration. + (tar-flag-deleted): Use `abs'. + (tar-expunge-internal): Remove unused var `line'. + (tar-expunge-internal): Don't hardcode point-min==1. + (tar-expunge): Widen while doing set-buffer-multibyte. + (tar-rename-entry): Use file-name-coding-system. + (tar-alter-one-field): Don't hardcode point-min==1. + (tar-subfile-save-buffer): string-as-unibyte works on unibyte strings. + (tar-pad-to-blocksize): Don't hardcode point-min==1. Clarify the code. + 2005-11-10 Masatake YAMATO * add-log.el (add-log-current-defun): Handle class::method @@ -23,10 +60,18 @@ string to `Man-arguments' if it is nil. Suggested by Reiner Steib . +2005-11-09 Stefan Monnier + + * Makefile.in (mh-loaddefs.el, loaddefs.el): Better follow the + commenting conventions. + + * cus-dep.el (custom-make-dependencies): Simplify. + Better follow the commenting conventions. + 2005-11-09 Richard M. Stallman - * apropos.el (apropos-pattern): Renamed from apropos-regexp. - (apropos-orig-pattern): Renamed from apropos-orig-regexp. + * apropos.el (apropos-pattern): Rename from apropos-regexp. + (apropos-orig-pattern): Rename from apropos-orig-regexp. All uses changed. (apropos-rewrite-regexp): Doc fix. (apropos-variable, apropos-command, apropos, apropos-value): diff --git a/lisp/jka-cmpr-hook.el b/lisp/jka-cmpr-hook.el index fb0a62d602d..65f624c110b 100644 --- a/lisp/jka-cmpr-hook.el +++ b/lisp/jka-cmpr-hook.el @@ -40,8 +40,8 @@ "jka-compr customization." :group 'compression) -;;; I have this defined so that .Z files are assumed to be in unix -;;; compress format; and .gz files, in gzip format, and .bz2 files in bzip fmt. +;; I have this defined so that .Z files are assumed to be in unix +;; compress format; and .gz files, in gzip format, and .bz2 files in bzip fmt. (defcustom jka-compr-compression-info-list ;;[regexp ;; compr-message compr-prog compr-args @@ -158,7 +158,7 @@ invoked." jka-compr-compression-info-list "\\|")) -;;; Functions for accessing the return value of jka-compr-get-compression-info +;; Functions for accessing the return value of jka-compr-get-compression-info (defun jka-compr-info-regexp (info) (aref info 0)) (defun jka-compr-info-compress-message (info) (aref info 1)) (defun jka-compr-info-compress-program (info) (aref info 2)) @@ -192,48 +192,38 @@ and `inhibit-first-line-modes-suffixes'." (setq jka-compr-file-name-handler-entry (cons (jka-compr-build-file-regexp) 'jka-compr-handler)) - (setq file-name-handler-alist (cons jka-compr-file-name-handler-entry - file-name-handler-alist)) - - (setq jka-compr-added-to-file-coding-system-alist nil) - - (mapcar - (function (lambda (x) - ;; Don't do multibyte encoding on the compressed files. - (let ((elt (cons (jka-compr-info-regexp x) - '(no-conversion . no-conversion)))) - (setq file-coding-system-alist - (cons elt file-coding-system-alist)) - (setq jka-compr-added-to-file-coding-system-alist - (cons elt jka-compr-added-to-file-coding-system-alist))) - - (and (jka-compr-info-strip-extension x) - ;; Make entries in auto-mode-alist so that modes - ;; are chosen right according to the file names - ;; sans `.gz'. - (setq auto-mode-alist - (cons (list (jka-compr-info-regexp x) - nil 'jka-compr) - auto-mode-alist)) - ;; Also add these regexps to - ;; inhibit-first-line-modes-suffixes, so that a - ;; -*- line in the first file of a compressed tar - ;; file doesn't override tar-mode. - (setq inhibit-first-line-modes-suffixes - (cons (jka-compr-info-regexp x) - inhibit-first-line-modes-suffixes))))) - jka-compr-compression-info-list) + (push jka-compr-file-name-handler-entry file-name-handler-alist) + + (dolist (x jka-compr-compression-info-list) + ;; Don't do multibyte encoding on the compressed files. + (let ((elt (cons (jka-compr-info-regexp x) + '(no-conversion . no-conversion)))) + (push elt file-coding-system-alist) + (push elt jka-compr-added-to-file-coding-system-alist)) + + (and (jka-compr-info-strip-extension x) + ;; Make entries in auto-mode-alist so that modes + ;; are chosen right according to the file names + ;; sans `.gz'. + (push (list (jka-compr-info-regexp x) nil 'jka-compr) auto-mode-alist) + ;; Also add these regexps to + ;; inhibit-first-line-modes-suffixes, so that a + ;; -*- line in the first file of a compressed tar + ;; file doesn't override tar-mode. + (push (jka-compr-info-regexp x) + inhibit-first-line-modes-suffixes))) (setq auto-mode-alist (append auto-mode-alist jka-compr-mode-alist-additions)) ;; Make sure that (load "foo") will find /bla/foo.el.gz. (setq load-suffixes (apply 'append - (mapcar (lambda (suffix) - (cons suffix - (mapcar (lambda (ext) (concat suffix ext)) - jka-compr-load-suffixes))) - load-suffixes)))) + (append (mapcar (lambda (suffix) + (cons suffix + (mapcar (lambda (ext) (concat suffix ext)) + jka-compr-load-suffixes))) + load-suffixes) + (list jka-compr-load-suffixes))))) (defun jka-compr-installed-p () @@ -277,15 +267,15 @@ Returns the new status of auto compression (non-nil means on)." (put 'with-auto-compression-mode 'lisp-indent-function 0) -;;; This is what we need to know about jka-compr-handler -;;; in order to decide when to call it. +;; This is what we need to know about jka-compr-handler +;; in order to decide when to call it. (put 'jka-compr-handler 'safe-magic t) (put 'jka-compr-handler 'operations '(byte-compiler-base-file-name write-region insert-file-contents file-local-copy load)) -;;; Turn on the mode. +;; Turn on the mode. (auto-compression-mode 1) (provide 'jka-cmpr-hook)