diff options
| -rw-r--r-- | lisp/jka-compr.el | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/lisp/jka-compr.el b/lisp/jka-compr.el index 94c5d747704..c6a3b97879b 100644 --- a/lisp/jka-compr.el +++ b/lisp/jka-compr.el | |||
| @@ -722,16 +722,23 @@ This adds entries to `file-name-handler-alist' and `auto-mode-alist'." | |||
| 722 | (setq file-name-handler-alist (cons jka-compr-file-name-handler-entry | 722 | (setq file-name-handler-alist (cons jka-compr-file-name-handler-entry |
| 723 | file-name-handler-alist)) | 723 | file-name-handler-alist)) |
| 724 | 724 | ||
| 725 | ;; Make entries in auto-mode-alist so that modes are chosen right | ||
| 726 | ;; according to the file names sans `.gz'. | ||
| 727 | (mapcar | 725 | (mapcar |
| 728 | (function (lambda (x) | 726 | (function (lambda (x) |
| 729 | (and | 727 | (and (jka-compr-info-strip-extension x) |
| 730 | (jka-compr-info-strip-extension x) | 728 | ;; Make entries in auto-mode-alist so that modes |
| 731 | (setq auto-mode-alist (cons (list (jka-compr-info-regexp x) | 729 | ;; are chosen right according to the file names |
| 732 | nil 'jka-compr) | 730 | ;; sans `.gz'. |
| 733 | auto-mode-alist))))) | 731 | (setq auto-mode-alist |
| 734 | 732 | (cons (list (jka-compr-info-regexp x) | |
| 733 | nil 'jka-compr) | ||
| 734 | auto-mode-alist)) | ||
| 735 | ;; Also add these regexps to | ||
| 736 | ;; inhibit-first-line-modes-suffixes, so that a | ||
| 737 | ;; -*- line in the first file of a compressed tar | ||
| 738 | ;; file doesn't override tar-mode. | ||
| 739 | (setq inhibit-first-line-modes-suffixes | ||
| 740 | (cons (jka-compr-info-regexp x) | ||
| 741 | inhibit-first-line-modes-suffixes))))) | ||
| 735 | jka-compr-compression-info-list) | 742 | jka-compr-compression-info-list) |
| 736 | (setq auto-mode-alist | 743 | (setq auto-mode-alist |
| 737 | (append auto-mode-alist jka-compr-mode-alist-additions))) | 744 | (append auto-mode-alist jka-compr-mode-alist-additions))) |