Anonymous committed ba63ce4

Sync with GNU Emacs 20.2, associate *.[ejw]ar <>

Comments (0)

Files changed (2)

 	* os-utils.texi: Spelling fixes, add document title.
+	* arc-mode.el: Sync with GNU Emacs 20.2, add *.[ejw]ar to
+	auto-mode-alist association.
 2004-01-13  Norbert Koch  <>
 	* Makefile (VERSION): XEmacs package 1.35 released.
 ;;; arc-mode.el --- simple editing of archives
-;; Copyright (C) 1995 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1997 Free Software Foundation, Inc.
-;; Author: Morten Welinder (
-;; Keywords: data, unix
+;; Author: Morten Welinder <>
+;; Keywords: archives msdog editing major-mode
 ;; Favourite-brand-of-beer: None, I hate beer.
 ;; This file is part of XEmacs.
 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 ;; 02111-1307, USA.
-;;; Synched up with: FSF 19.34.
+;;; Synched up with: GNU Emacs 20.2, with differences in comparing chars with
+;;; `eq' instead of `=', and applying `char-int' to various `memq's, and
+;;; using #o instead of ?\ for octal numbers.  See also inline comments.
 ;;; Commentary:
 (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
 (make-variable-buffer-local 'archive-files)
-;; XEmacs change
-(defvar archive-xemacs
-  (string-match "\\(Lucid\\|XEmacs\\)" emacs-version)
-  "*Non-nil when running under Lucid Emacs or XEmacs.")
+;; XEmacs change: `archive-lemacs' removed, `running-xemacs' used instead.
 ;; -------------------------------------------------------------------------
 ;; Section: Support functions.
 	(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))))
 ;; Archive mode is suitable only for specially formatted data.
 (put 'archive-mode 'mode-class 'special)
+;; XEmacs addition
 (defun archive-quit ()
   "Bury the current archive buffer."
   (define-key archive-mode-map "\M-\C-?" 'archive-unmark-all-files)
   (define-key archive-mode-map "v" 'archive-view)
   (define-key archive-mode-map "x" 'archive-expunge)
+  ;; XEmacs: "\177" -> 'backspace and 'delete.
   (define-key archive-mode-map 'backspace 'archive-unflag-backwards)
   (define-key archive-mode-map 'delete 'archive-unflag-backwards)
   (define-key archive-mode-map "E" 'archive-extract-other-window)
   (define-key archive-mode-map "G" 'archive-chgrp-entry)
   (define-key archive-mode-map "O" 'archive-chown-entry)
-  (if archive-xemacs
+  (if running-xemacs
 	;; Not a nice "solution" but it'll have to do
 	(define-key archive-mode-map "q" 'archive-quit)
 			       archive-mode-map global-map))
   (define-key archive-mode-map
-    (if archive-xemacs 'button2 [mouse-2]) 'archive-mouse-extract)
+    (if running-xemacs 'button2 [mouse-2]) 'archive-mouse-extract)
-  (if archive-xemacs
+  (if running-xemacs
       ()				; out of luck
     ;; Get rid of the Edit menu bar item to save space.
     (define-key archive-mode-map [menu-bar edit] 'undefined)
     (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
 	;; Using `concat' here copies the text also, so we can add
 	;; properties without problems.
 	(let ((text (concat (aref fil 0) "\n")))
-	  (if archive-xemacs
-	      ()			; out of luck
-	    (put-text-property (aref fil 1) (aref fil 2)
-			       'mouse-face 'highlight
-			       text))
+	  ;; XEmacs change: enabled for XEmacs too.
+	  (put-text-property (aref fil 1) (aref fil 2)
+			     'mouse-face 'highlight
+			     text)
   (setq archive-file-list-end (point-marker)))
           (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)))
 	  (run-hooks 'archive-extract-hooks))
 	(archive-maybe-update t))
       (if view-p
+	  ;; XEmacs change: `view-buffer's 2nd arg difference
             (view-buffer buffer)
             (and just-created (setq view-exit-action 'kill-buffer)))
       (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))
                   (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
       (error "Renaming is not supported for this archive type"))))
-;; Revert the buffer and recompute the dired-like listing.
 (defun archive-mode-revert (&optional no-autosave no-confirm)
+  "Revert the buffer and recompute the dired-like listing."
   (let ((no (archive-get-lineno)))
     (setq archive-files nil)
     (let ((revert-buffer-function nil))
 ;; -------------------------------------------------------------------------
 ;; XEmacs addition
-;;;###autoload(add-to-list 'auto-mode-alist '("\\.\\(?:arc\\|zip\\|lzh\\|zoo\\)\\'" . archive-mode))
+;;;###autoload(add-to-list 'auto-mode-alist '("\\.\\(?:arc\\|[ejw]ar\\|zip\\|lzh\\|zoo\\)\\'" . archive-mode))
 (provide 'archive-mode)