Some fixes to follow coding conventions in files from Gnus.
[bpt/emacs.git] / lisp / emulation / viper.el
index 644bff6..9e8efaf 100644 (file)
@@ -6,9 +6,9 @@
 ;;  Keywords: emulations
 ;;  Author: Michael Kifer <kifer@cs.sunysb.edu>
 
-;; Copyright (C) 1994, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 95, 96, 97, 98, 99, 2000, 01 Free Software Foundation, Inc.
 
-(defconst viper-version "3.08 of October 31, 1999"
+(defconst viper-version "3.10 of March 3, 2001"
   "The current version of Viper")
 
 ;; This file is part of GNU Emacs.
@@ -403,6 +403,7 @@ widget."
     diff-mode
     
     perl-mode
+    cperl-mode
     javascript-mode
     tcl-mode
     python-mode
@@ -443,7 +444,10 @@ unless it is coming up in a wrong Viper state."
   :group 'viper-misc)
 
 (defcustom viper-insert-state-mode-list
-  '(internal-ange-ftp-mode comint-mode shell-mode)
+  '(internal-ange-ftp-mode
+    comint-mode
+    eshell-mode
+    shell-mode)
   "*A list of major modes that should come up in Vi Insert state."
   :type '(repeat symbol)
   :group 'viper-misc)
@@ -589,6 +593,9 @@ This startup message appears whenever you load Viper, unless you type `y' now."
                    ))
              (viper-set-expert-level 'dont-change-unless)))
 
+       (if viper-xemacs-p
+           (make-variable-buffer-local 'bar-cursor))
+
        (or (memq major-mode viper-emacs-state-mode-list) ; don't switch to Vi
            (memq major-mode viper-insert-state-mode-list) ; don't switch
            (viper-change-state-to-vi)))))
@@ -657,6 +664,7 @@ remains buffer-local."
   ;; Ideally, we would like to be able to de-localize local variables 
   (viper-delocalize-var 'minor-mode-map-alist)
   (viper-delocalize-var 'require-final-newline)
+  (if viper-xemacs-p (viper-delocalize-var 'bar-cursor))
 
   
   ;; deactivate all advices done by Viper.
@@ -1241,8 +1249,8 @@ These two lines must come in the order given.
             (and (< viper-expert-level 5) (> viper-expert-level 0))))
     (viper-set-hooks))
     
-;; Let all minor modes take effect after loading
-;; this may not be enough, so we also set default minor-mode-alist.
+;; Let all minor modes take effect after loading.
+;; This may not be enough, so we also set default minor-mode-alist.
 ;; Without setting the default, new buffers that come up in emacs mode have
 ;; minor-mode-map-alist = nil, unless we call viper-change-state-*
 (if (and viper-mode (eq viper-current-state 'emacs-state))
@@ -1254,6 +1262,14 @@ These two lines must come in the order given.
 (if (and viper-mode (memq major-mode viper-vi-state-mode-list))
     (viper-mode))
 
+(if viper-mode
+    (setq initial-major-mode
+         `(lambda ()
+            (funcall (quote ,initial-major-mode))
+            (set-viper-state-in-major-mode))
+         ))
+
+
 
 (run-hooks 'viper-load-hook) ; the last chance to change something