]> code.delx.au - gnu-emacs/blobdiff - lisp/emulation/viper.el
Update maintainer's email address.
[gnu-emacs] / lisp / emulation / viper.el
index 7bcaf8be3992bc5b9739351ac84a03452106cde0..fd1a8aa92ea84a86876cd012bbccc5a81ae8aadb 100644 (file)
@@ -4,12 +4,12 @@
 ;;              Viper Is also a Package for Emacs Rebels.
 
 ;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-;;   2003, 2004, 2005 Free Software Foundation, Inc.
+;;   2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 ;; Keywords: emulations
 
-(defconst viper-version "3.11.5 of October 5, 2005"
+(defconst viper-version "3.13.1 of October 23, 2006"
   "The current version of Viper")
 
 ;; This file is part of GNU Emacs.
@@ -359,7 +359,7 @@ user decide when to invoke Viper in a major mode."
 (defcustom viper-mode (cond (noninteractive nil)
                            (t 'ask))
   "To Viperize or not to Viperize.
-If t, viperize emacs.  If nil -- don't.  If `ask', ask the user.
+If t, viperize Emacs.  If nil -- don't.  If `ask', ask the user.
 This variable is used primatily when Viper is being loaded.
 
 Must be set in `~/.emacs' before Viper is loaded.
@@ -429,7 +429,6 @@ widget."
     occur-mode
 
     mh-folder-mode
-    mail-mode
     gnus-group-mode
     gnus-summary-mode
 
@@ -442,6 +441,8 @@ widget."
 
     rcirc-mode
 
+    jde-javadoc-checker-report-mode
+
     view-mode
     vm-mode
     vm-summary-mode)
@@ -457,6 +458,7 @@ unless it is coming up in a wrong Viper state."
   '(internal-ange-ftp-mode
     comint-mode
     inferior-emacs-lisp-mode
+    erc-mode
     eshell-mode
     shell-mode)
   "*A list of major modes that should come up in Vi Insert state."
@@ -493,15 +495,17 @@ unless it is coming up in a wrong Viper state."
     (gnus-summary-mode emacs-state viper-gnus-modifier-map)
     (Info-mode emacs-state viper-slash-and-colon-map)
     (Buffer-menu-mode emacs-state viper-slash-and-colon-map)
+    (erc-mode insert-state viper-comint-mode-modifier-map)
+    (erc-mode vi-state viper-comint-mode-modifier-map)
     )
   "List specifying how to modify the various major modes to enable some Viperisms.
 The list has the structure: ((mode viper-state keymap) (mode viper-state
 keymap) ...).  If `mode' is on the list, the `kemap' will be made active (on
 the minor-mode-map-alist) in the specified viper state.
-If you change this list, have to restart emacs for the change to take effect.
-However, if you did the change through the customization widget, then emacs
+If you change this list, have to restart Emacs for the change to take effect.
+However, if you did the change through the customization widget, then Emacs
 needs to be restarted only if you deleted a triple mode-state-keymap from the
-list.  No need to restart emacs in case of insertion or modification of an
+list.  No need to restart Emacs in case of insertion or modification of an
 existing triple."
   :type '(repeat
          (list symbol
@@ -541,8 +545,6 @@ If Viper is enabled, turn it off.  Otherwise, turn it on."
        (if viper-first-time ; Important check.  Prevents mix-up of startup
            (progn           ; and expert-level msgs when viper-mode recurses
              (setq viper-first-time nil)
-             (setq viper-vi-state-cursor-color
-                   (viper-get-cursor-color))
              (if (not viper-inhibit-startup-message)
                  (save-window-excursion
                    (setq viper-inhibit-startup-message t)
@@ -612,7 +614,8 @@ This startup message appears whenever you load Viper, unless you type `y' now."
 
        (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)))))
+           (viper-change-state-to-vi))
+       )))
 
 
 ;; Apply a little heuristic to invoke vi state on major-modes
@@ -767,6 +770,7 @@ It also can't undo some Viper settings."
   ;; remove all hooks set by viper
   (mapatoms 'viper-remove-hooks)
   (remove-hook 'comint-mode-hook 'viper-comint-mode-hook)
+  (remove-hook 'erc-mode-hook 'viper-comint-mode-hook)
   (remove-hook 'minibuffer-setup-hook 'viper-minibuffer-setup-sentinel)
   (remove-hook 'change-major-mode-hook 'viper-major-mode-change-sentinel)
   (remove-hook 'post-command-hook 'viper-minibuffer-post-command-hook)
@@ -855,8 +859,11 @@ It also can't undo some Viper settings."
   ;; info about the display and windows until emacs initialization is complete
   ;; So do it via the window-setup-hook
   (add-hook 'window-setup-hook
-           '(lambda ()
-              (setq viper-vi-state-cursor-color (viper-get-cursor-color))))
+           '(lambda ()
+              (modify-frame-parameters
+               (selected-frame)
+               (list (cons 'viper-vi-state-cursor-color
+                           (viper-get-cursor-color))))))
 
   ;; Tell vc-diff to put *vc* in Vi mode
   (if (featurep 'vc)
@@ -884,7 +891,7 @@ It also can't undo some Viper settings."
   (eval-after-load
    "passwd"
    '(defadvice read-passwd-1 (before viper-passwd-ad activate)
-      "Switch to emacs state while reading password."
+      "Switch to Emacs state while reading password."
       (viper-change-state-to-emacs)))
 
   (defadvice self-insert-command (around viper-self-insert-ad activate)
@@ -896,7 +903,6 @@ It also can't undo some Viper settings."
 
   (defadvice set-cursor-color (after viper-set-cursor-color-ad activate)
     "Change cursor color in VI state."
-    ;;(setq viper-vi-state-cursor-color (ad-get-arg 0))
     (modify-frame-parameters
        (selected-frame)
        (list (cons 'viper-vi-state-cursor-color (ad-get-arg 0))))
@@ -912,6 +918,7 @@ It also can't undo some Viper settings."
 
   ;; Emacs shell, ange-ftp, and comint-based modes
   (add-hook 'comint-mode-hook 'viper-comint-mode-hook) ; comint
+  (add-hook 'erc-mode-hook 'viper-comint-mode-hook) ; ERC
 
   (add-hook 'eshell-mode-hook
            (lambda () (setq viper-auto-indent nil)))
@@ -932,7 +939,7 @@ It also can't undo some Viper settings."
   (eval-after-load
    "rmailedit"
    '(defadvice rmail-cease-edit (after viper-rmail-advice activate)
-      "Switch to emacs state when done editing message."
+      "Switch to Emacs state when done editing message."
       (viper-change-state-to-emacs)))
   ;; In case RMAIL was loaded before Viper.
   (defadvice rmail-cease-edit (after viper-rmail-advice activate)
@@ -1000,8 +1007,8 @@ It also can't undo some Viper settings."
 ;; these are primarily advices and Vi-ish variable settings
 (defun viper-non-hook-settings ()
 
-  ;; Viper changes the default mode-line-buffer-identification
-  (setq-default mode-line-buffer-identification '(" %b"))
+  ;;;; Viper changes the default mode-line-buffer-identification
+  ;;(setq-default mode-line-buffer-identification '(" %b"))
 
   ;; setup emacs-supported vi-style feel
   (setq next-line-add-newlines nil
@@ -1114,7 +1121,7 @@ It also can't undo some Viper settings."
        (save-window-excursion
         (with-output-to-temp-buffer " *viper-info*"
           (princ "
-You have loaded Viper, and are about to Viperize your emacs!
+You have loaded Viper, and are about to Viperize your Emacs!
 
 Viper is a Package for Emacs Rebels and a venomous VI PERil,