aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2001-11-17 00:04:29 +0000
committerStefan Monnier2001-11-17 00:04:29 +0000
commita91c76d6d92ded1a8029f736d30dc1a64932b2a3 (patch)
tree3c70e80f21194181a5bead4102086a63c6c3efbd
parentc4d9b0d99628043079d7bdcabe1a0f033db96a61 (diff)
downloademacs-a91c76d6d92ded1a8029f736d30dc1a64932b2a3.tar.gz
emacs-a91c76d6d92ded1a8029f736d30dc1a64932b2a3.zip
(tar-mode): Use define-derived-mode.
-rw-r--r--lisp/tar-mode.el30
1 files changed, 9 insertions, 21 deletions
diff --git a/lisp/tar-mode.el b/lisp/tar-mode.el
index 4c89f9b4caf..10fe019b3a5 100644
--- a/lisp/tar-mode.el
+++ b/lisp/tar-mode.el
@@ -528,7 +528,7 @@ is visible (and the real data of the buffer is hidden)."
528(put 'tar-subfile-mode 'mode-class 'special) 528(put 'tar-subfile-mode 'mode-class 'special)
529 529
530;;;###autoload 530;;;###autoload
531(defun tar-mode () 531(define-derived-mode tar-mode nil "Tar"
532 "Major mode for viewing a tar file as a dired-like listing of its contents. 532 "Major mode for viewing a tar file as a dired-like listing of its contents.
533You can move around using the usual cursor motion commands. 533You can move around using the usual cursor motion commands.
534Letters no longer insert themselves. 534Letters no longer insert themselves.
@@ -547,33 +547,21 @@ See also: variables `tar-update-datestamp' and `tar-anal-blocksize'.
547 ;; mode on and off. You can corrupt things that way. 547 ;; mode on and off. You can corrupt things that way.
548 ;; rms: with permanent locals, it should now be possible to make this work 548 ;; rms: with permanent locals, it should now be possible to make this work
549 ;; interactively in some reasonable fashion. 549 ;; interactively in some reasonable fashion.
550 (kill-all-local-variables)
551 (make-local-variable 'tar-header-offset) 550 (make-local-variable 'tar-header-offset)
552 (make-local-variable 'tar-parse-info) 551 (make-local-variable 'tar-parse-info)
553 (make-local-variable 'require-final-newline) 552 (set (make-local-variable 'require-final-newline) nil) ; binary data, dude...
554 (setq require-final-newline nil) ; binary data, dude... 553 (set (make-local-variable 'revert-buffer-function) 'tar-mode-revert)
555 (make-local-variable 'revert-buffer-function) 554 (set (make-local-variable 'local-enable-local-variables) nil)
556 (setq revert-buffer-function 'tar-mode-revert) 555 (set (make-local-variable 'next-line-add-newlines) nil)
557 (make-local-variable 'local-enable-local-variables)
558 (setq local-enable-local-variables nil)
559 (make-local-variable 'next-line-add-newlines)
560 (setq next-line-add-newlines nil)
561 ;; Prevent loss of data when saving the file. 556 ;; Prevent loss of data when saving the file.
562 (make-local-variable 'file-precious-flag) 557 (set (make-local-variable 'file-precious-flag) t)
563 (setq file-precious-flag t)
564 (setq major-mode 'tar-mode)
565 (setq mode-name "Tar")
566 (use-local-map tar-mode-map)
567 (auto-save-mode 0) 558 (auto-save-mode 0)
568 (make-local-variable 'write-contents-hooks) 559 (set (make-local-variable 'write-contents-hooks) '(tar-mode-write-file))
569 (setq write-contents-hooks '(tar-mode-write-file))
570 (widen) 560 (widen)
571 (if (and (boundp 'tar-header-offset) tar-header-offset) 561 (if (and (boundp 'tar-header-offset) tar-header-offset)
572 (narrow-to-region 1 (byte-to-position tar-header-offset)) 562 (narrow-to-region 1 (byte-to-position tar-header-offset))
573 (tar-summarize-buffer) 563 (tar-summarize-buffer)
574 (tar-next-line 0)) 564 (tar-next-line 0)))
575 (run-hooks 'tar-mode-hook)
576 )
577 565
578 566
579(defun tar-subfile-mode (p) 567(defun tar-subfile-mode (p)