]> code.delx.au - gnu-emacs/blobdiff - lisp/arc-mode.el
(compilation-mode): Add a mode-class property.
[gnu-emacs] / lisp / arc-mode.el
index c5e7ea09bc73235cdbdaa7985e83e52270a15e23..0a63debcd999b986fe56c42eb867b11c1735c1b0 100644 (file)
@@ -1,29 +1,30 @@
 ;;; arc-mode.el --- simple editing of archives
 
-;;; Copyright (C) 1995 Free Software Foundation, Inc.
+;; Copyright (C) 1995 Free Software Foundation, Inc.
 
 ;; Author: Morten Welinder (terra@diku.dk)
 ;; Keywords: archives msdog editing major-mode
 ;; Favourite-brand-of-beer: None, I hate beer.
 
-;;; This file is part of GNU Emacs.
-;;;
-;;; GNU Emacs is free software; you can redistribute it and/or modify
-;;; it under the terms of the GNU General Public License as published by
-;;; the Free Software Foundation; either version 2, or (at your option)
-;;; any later version.
-;;;
-;;; GNU Emacs is distributed in the hope that it will be useful,
-;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;;; GNU General Public License for more details.
-;;;
-;;; You should have received a copy of the GNU General Public License
-;;; along with GNU Emacs; see the file COPYING.  If not, write to
-;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
 
 ;;; Commentary:
-;;
+
 ;; NAMING: "arc" is short for "archive" and does not refer specifically
 ;; to files whose name end in ".arc"
 ;;
@@ -235,21 +236,15 @@ Archive and member name will be added.")
 (make-variable-buffer-local 'archive-subfile-mode)
 (put 'archive-subfile-mode 'permanent-local t)
 
-;; buffer-file-type is a per-buffer variable in the msdog configuration
-(if (boundp 'buffer-file-type) nil
-  (defvar buffer-file-type nil
-    "*Nil for dos-style text file, non-nil otherwise.")
-  (make-variable-buffer-local 'buffer-file-type)
-  (put 'buffer-file-type 'permanent-local t)
-  (setq-default buffer-file-type nil))
-
 (defvar archive-subfile-dos nil
-  "Negation of `buffer-file-type' which see.")
+  "Negation of `buffer-file-type', which see.")
 (make-variable-buffer-local 'archive-subfile-dos)
 (put 'archive-subfile-dos 'permanent-local t)
 
-(defvar archive-files nil "Vector of file descriptors.  Each descriptor is
-a vector of [ext-file-name int-file-name case-fiddled mode ...]")
+(defvar archive-files nil
+  "Vector of file descriptors.
+Each descriptor is a vector of the form
+ [EXT-FILE-NAME INT-FILE-NAME CASE-FIDDLED MODE ...]")
 (make-variable-buffer-local 'archive-files)
 
 (defvar archive-lemacs
@@ -435,7 +430,8 @@ archive.
        (setq require-final-newline nil)
        (make-local-variable 'enable-local-variables)
        (setq enable-local-variables nil)
-       (setq buffer-file-type t)
+       (if (boundp 'default-buffer-file-type)
+           (setq buffer-file-type t))
 
        (make-local-variable 'archive-read-only)
        (setq archive-read-only (not (file-writable-p (buffer-file-name))))
@@ -616,7 +612,7 @@ is visible (and the real data of the buffer is hidden)."
     (archive-next-line no)))
 
 (defun archive-summarize-files (files)
-  "Insert a description of a list of files annotated with proper mouse face"
+  "Insert a description of a list of files annotated with proper mouse face."
   (setq archive-file-list-start (point-marker))
   (setq archive-file-name-indent (if files (aref (car files) 1) 0))
   ;; We don't want to do an insert for each element since that takes too
@@ -736,8 +732,9 @@ This function changes the set of information shown for each files."
           (make-local-variable 'local-write-file-hooks)
           (add-hook 'local-write-file-hooks 'archive-write-file-member)
           (setq archive-subfile-mode descr)
-         (setq archive-subfile-dos nil
-               buffer-file-type t)
+         (setq archive-subfile-dos nil)
+         (if (boundp 'default-buffer-file-type)
+             (setq buffer-file-type t))
          (if (fboundp extractor)
              (funcall extractor archive ename)
            (archive-*-extract archive ename (symbol-value extractor)))
@@ -851,7 +848,8 @@ This function changes the set of information shown for each files."
       (goto-char (point-min))
       (setq archive-subfile-dos
            (or force (not (search-forward-regexp "[^\r]\n" nil t))))
-      (setq buffer-file-type (not archive-subfile-dos))
+      (if (boundp 'default-buffer-file-type)
+         (setq buffer-file-type (not archive-subfile-dos)))
       (if archive-subfile-dos
           (let ((modified (buffer-modified-p)))
             (buffer-disable-undo (current-buffer))
@@ -875,7 +873,8 @@ This function changes the set of information shown for each files."
                   (while (search-forward "\n" nil t)
                     (replace-match "\r\n"))
                   (setq archive-subfile-dos nil)
-                  (setq buffer-file-type t)
+                 (if (boundp 'default-buffer-file-type)
+                     (setq buffer-file-type t))
                   ;; OK, we're now have explicit ^M^Js -- save and re-unixfy
                   (archive-write-file-member))
               (progn