Mercurial > emacs
changeset 3365:0865c1679cd8
Don't initialize write-file-hooks.
Don't change auto-mode-alist.
(tar-regexp): Deleted.
(tar-normal-mode): Deleted.
(tar-mode): Add autoload.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 31 May 1993 21:51:15 +0000 |
parents | 3dd9b89c6a17 |
children | 4db64c9c1f05 |
files | lisp/tar-mode.el |
diffstat | 1 files changed, 1 insertions(+), 40 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/tar-mode.el Mon May 31 21:50:52 1993 +0000 +++ b/lisp/tar-mode.el Mon May 31 21:51:15 1993 +0000 @@ -470,6 +470,7 @@ (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 @@ ;;; 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