changeset 11179:9ff0cfb97106

(jka-compr-install): Add items to inhibit-first-line-modes-suffixes.
author Richard M. Stallman <rms@gnu.org>
date Sun, 02 Apr 1995 02:21:56 +0000
parents 7d4805feb413
children 7a9dceb0fb96
files lisp/jka-compr.el
diffstat 1 files changed, 15 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/jka-compr.el	Sun Apr 02 00:11:19 1995 +0000
+++ b/lisp/jka-compr.el	Sun Apr 02 02:21:56 1995 +0000
@@ -722,16 +722,23 @@
   (setq file-name-handler-alist (cons jka-compr-file-name-handler-entry
 				      file-name-handler-alist))
 
-  ;; Make entries in auto-mode-alist so that modes are chosen right
-  ;; according to the file names sans `.gz'.
   (mapcar
    (function (lambda (x)
-	       (and
-		(jka-compr-info-strip-extension x)
-		(setq auto-mode-alist (cons (list (jka-compr-info-regexp x)
-						  nil 'jka-compr)
-					    auto-mode-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)
   (setq auto-mode-alist
 	(append auto-mode-alist jka-compr-mode-alist-additions)))