summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1993-05-31 21:51:15 +0000
committerRichard M. Stallman <rms@gnu.org>1993-05-31 21:51:15 +0000
commitc88f87443d984bd96410b8af7d3202221b11b29a (patch)
tree1fe333c537494785b17757f4c3e2004e8c29b9da /lisp
parent93f8141e5bc885cfe57ede82be27e1f4b4db4e88 (diff)
downloademacs-c88f87443d984bd96410b8af7d3202221b11b29a.tar.gz
Don't initialize write-file-hooks.
Don't change auto-mode-alist. (tar-regexp): Deleted. (tar-normal-mode): Deleted. (tar-mode): Add autoload.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/tar-mode.el41
1 files changed, 1 insertions, 40 deletions
diff --git a/lisp/tar-mode.el b/lisp/tar-mode.el
index a4084b02408..7360fb32ab5 100644
--- a/lisp/tar-mode.el
+++ b/lisp/tar-mode.el
@@ -470,6 +470,7 @@ is visible (and the real data of the buffer is hidden)."
(put 'tar-mode 'mode-class 'special)
(put 'tar-subfile-mode 'mode-class 'special)
+;;;##autoload
(defun tar-mode ()
"Major mode for viewing a tar file as a dired-like listing of its contents.
You can move around using the usual cursor motion commands.
@@ -1078,50 +1079,10 @@ Leaves the region wide."
;;; Patch it in.
-(defvar tar-regexp "\\.tar$"
- "The regular expression used to identify tar file names.")
-
-(setq auto-mode-alist
- (cons (cons tar-regexp 'tar-mode) auto-mode-alist))
-
-(or (boundp 'write-file-hooks) (setq write-file-hooks nil))
-(or (listp write-file-hooks)
- (setq write-file-hooks (list write-file-hooks)))
(or (memq 'maybe-write-tar-file write-file-hooks)
(setq write-file-hooks
(cons 'maybe-write-tar-file write-file-hooks)))
-
-;;; This is a hack. For files ending in .tar, we want -*- lines to be
-;;; completely ignored - if there is one, it applies to the first file
-;;; in the archive, and not the archive itself!
-
-(defun tar-normal-mode (&optional find-file)
- "Choose the major mode for this buffer automatically.
-Also sets up any specified local variables of the file.
-Uses the visited file name, the -*- line, and the local variables spec.
-
-This function is called automatically from `find-file'. In that case,
-if `inhibit-local-variables' is non-`nil' we require confirmation before
-processing a local variables spec. If you run `normal-mode' explicitly,
-confirmation is never required.
-
-Note that this version of this function has been hacked to interact
-correctly with tar files - when visiting a file which matches
-'tar-regexp', the -*- line and local-variables are not examined,
-as they would apply to a file within the archive rather than the archive
-itself."
- (interactive)
- (if (and buffer-file-name
- (string-match tar-regexp buffer-file-name))
- (tar-mode)
- (tar-real-normal-mode find-file)))
-
-
-(if (not (fboundp 'tar-real-normal-mode))
- (defalias 'tar-real-normal-mode (symbol-function 'normal-mode)))
-(defalias 'normal-mode 'tar-normal-mode)
-
(provide 'tar-mode)
;;; tar-mode.el ends here