User: michaelk
Date: 06/02/19 04:23:17
Modified: packages/xemacs-packages/viper viper.texi viper.el
viper-util.el viper-mous.el viper-macs.el
viper-keym.el viper-init.el viper-ex.el
viper-cmd.el ChangeLog
Log:
* viper-cmd.el (viper-insert-state-post-command-sentinel,
viper-change-state-to-vi, viper-change-state-to-emacs):
made aware of cursor coloring in the emacs state.
(viper-special-read-and-insert-char): use read-char-exclusive.
(viper-minibuffer-trim-tail): workaround for fields in minibuffer.
* viper-init.el (viper-emacs-state-cursor-color): new variable.
* viper-util.el (viper-save-cursor-color,
viper-get-saved-cursor-color-in-replace-mode,
viper-get-saved-cursor-color-in-insert-mode,
viper-restore-cursor-color): make aware of the cursor color in emacs
state.
(viper-get-saved-cursor-color-in-emacs-mode): new function.
Revision Changes Path
1.30 +7 -3 XEmacs/packages/xemacs-packages/viper/viper.texi
Index: viper.texi
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/viper/viper.texi,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -p -r1.29 -r1.30
--- viper.texi 2005/09/20 17:58:30 1.29
+++ viper.texi 2006/02/19 03:23:12 1.30
@@ -8,7 +8,7 @@
@copying
Copyright @copyright{} 1995, 1996, 1997, 2001, 2002, 2003, 2004,
- 2005 Free Software Foundation, Inc.
+ 2005, 2006 Free Software Foundation, Inc.
@quotation
Permission is granted to copy, distribute and/or modify this document
@@ -206,7 +206,7 @@ Emacs can edit several files at once. A
@dfn{buffer} that usually has the same name as the file. Buffers are also used
for other purposes, such as shell interfaces, directory editing, etc.
@xref{Dired,,Directory Editor,emacs,The
-Gnu Emacs Manual}, for an example.@refill
+GNU Emacs Manual}, for an example.@refill
A buffer has a distinguished position called the @dfn{point}.
A @dfn{point} is always between 2 characters, and is @dfn{looking at}
@@ -1870,6 +1870,10 @@ application.
@vindex @code{viper-insert-state-cursor-color}
If set to a valid color, this will be the cursor color when Viper is in
insert state.
+@item viper-emacs-state-cursor-color nil
+@vindex @code{viper-emacs-state-cursor-color}
+If set to a valid color, this will be the cursor color when Viper is in
+emacs state.
@item viper-replace-region-end-delimiter "$"
A string used to mark the end of replacement regions. It is used only on
TTYs or if @code{viper-use-replace-region-delimiters} is non-@code{nil}.
@@ -2582,7 +2586,7 @@ above block should be commented out.
Even though these commands are sometimes useful, they are no substitute for
the powerful @emph{tag table} facility of Emacs. Viper's @kbd{:tag} command
in a primitive interface to Emacs tags. @xref{Tags,Tags,Tags,emacs,
-The Gnu Emacs Manual}, for more information on tags.
+The GNU Emacs Manual}, for more information on tags.
The following two commands are normally bound to a mouse click and are part
of Viper. They work only if Emacs runs as an application under X
1.37 +7 -2 XEmacs/packages/xemacs-packages/viper/viper.el
Index: viper.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/viper/viper.el,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -p -r1.36 -r1.37
--- viper.el 2005/11/25 07:20:46 1.36
+++ viper.el 2006/02/19 03:23:12 1.37
@@ -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(a)cs.stonybrook.edu>
;; Keywords: emulations
-(defconst viper-version "3.11.5 of November 25, 2005"
+(defconst viper-version "3.12 of February 18, 2006"
"The current version of Viper")
;; This file is part of GNU Emacs.
@@ -458,6 +458,7 @@ unless it is coming up in a wrong Viper
'(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."
@@ -494,6 +495,8 @@ unless it is coming up in a wrong Viper
(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
@@ -768,6 +771,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)
@@ -913,6 +917,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)))
1.26 +25 -8 XEmacs/packages/xemacs-packages/viper/viper-util.el
Index: viper-util.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/viper/viper-util.el,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -p -r1.25 -r1.26
--- viper-util.el 2005/11/15 18:53:49 1.25
+++ viper-util.el 2006/02/19 03:23:12 1.26
@@ -1,7 +1,7 @@
;;; viper-util.el --- Utilities used by viper.el
;; Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003,
-;; 2004, 2005 Free Software Foundation, Inc.
+;; 2004, 2005, 2006 Free Software Foundation, Inc.
;; Author: Michael Kifer <kifer(a)cs.stonybrook.edu>
@@ -175,9 +175,12 @@
(selected-frame)
(list
(cons
- (if (eq before-which-mode 'before-replace-mode)
- 'viper-saved-cursor-color-in-replace-mode
- 'viper-saved-cursor-color-in-insert-mode)
+ (cond ((eq before-which-mode 'before-replace-mode)
+ 'viper-saved-cursor-color-in-replace-mode)
+ ((eq before-which-mode 'before-emacs-mode)
+ 'viper-saved-cursor-color-in-emacs-mode)
+ (t
+ 'viper-saved-cursor-color-in-insert-mode))
color)))
))))
@@ -188,7 +191,9 @@
(if viper-emacs-p 'frame-parameter 'frame-property)
(selected-frame)
'viper-saved-cursor-color-in-replace-mode)
- viper-vi-state-cursor-color))
+ (if (eq viper-current-state 'emacs-mode)
+ viper-emacs-state-cursor-color
+ viper-vi-state-cursor-color)))
(defsubst viper-get-saved-cursor-color-in-insert-mode ()
(or
@@ -196,15 +201,27 @@
(if viper-emacs-p 'frame-parameter 'frame-property)
(selected-frame)
'viper-saved-cursor-color-in-insert-mode)
+ (if (eq viper-current-state 'emacs-mode)
+ viper-emacs-state-cursor-color
+ viper-vi-state-cursor-color)))
+
+(defsubst viper-get-saved-cursor-color-in-emacs-mode ()
+ (or
+ (funcall
+ (if viper-emacs-p 'frame-parameter 'frame-property)
+ (selected-frame)
+ 'viper-saved-cursor-color-in-emacs-mode)
viper-vi-state-cursor-color))
;; restore cursor color from replace overlay
(defun viper-restore-cursor-color(after-which-mode)
(if (viper-overlay-p viper-replace-overlay)
(viper-change-cursor-color
- (if (eq after-which-mode 'after-replace-mode)
- (viper-get-saved-cursor-color-in-replace-mode)
- (viper-get-saved-cursor-color-in-insert-mode))
+ (cond ((eq after-which-mode 'after-replace-mode)
+ (viper-get-saved-cursor-color-in-replace-mode))
+ ((eq after-which-mode 'after-emacs-mode)
+ (viper-get-saved-cursor-color-in-emacs-mode))
+ (t (viper-get-saved-cursor-color-in-insert-mode)))
)))
1.10 +1 -1 XEmacs/packages/xemacs-packages/viper/viper-mous.el
Index: viper-mous.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/viper/viper-mous.el,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -p -r1.9 -r1.10
--- viper-mous.el 2005/08/06 17:05:11 1.9
+++ viper-mous.el 2006/02/19 03:23:12 1.10
@@ -1,7 +1,7 @@
;;; viper-mous.el --- mouse support for Viper
;; Copyright (C) 1994, 1995, 1996, 1997, 2001, 2002, 2003, 2004,
-;; 2005 Free Software Foundation, Inc.
+;; 2005, 2006 Free Software Foundation, Inc.
;; Author: Michael Kifer <kifer(a)cs.stonybrook.edu>
1.12 +1 -1 XEmacs/packages/xemacs-packages/viper/viper-macs.el
Index: viper-macs.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/viper/viper-macs.el,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -p -r1.11 -r1.12
--- viper-macs.el 2005/09/20 17:58:30 1.11
+++ viper-macs.el 2006/02/19 03:23:12 1.12
@@ -1,7 +1,7 @@
;;; viper-macs.el --- functions implementing keyboard macros for Viper
;; Copyright (C) 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2003, 2004,
-;; 2005 Free Software Foundation, Inc.
+;; 2005, 2006 Free Software Foundation, Inc.
;; Author: Michael Kifer <kifer(a)cs.stonybrook.edu>
1.14 +1 -1 XEmacs/packages/xemacs-packages/viper/viper-keym.el
Index: viper-keym.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/viper/viper-keym.el,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -p -r1.13 -r1.14
--- viper-keym.el 2005/11/25 07:20:46 1.13
+++ viper-keym.el 2006/02/19 03:23:13 1.14
@@ -1,7 +1,7 @@
;;; viper-keym.el --- Viper keymaps
;; Copyright (C) 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2003, 2004,
-;; 2005 Free Software Foundation, Inc.
+;; 2005, 2006 Free Software Foundation, Inc.
;; Author: Michael Kifer <kifer(a)cs.stonybrook.edu>
1.21 +8 -1 XEmacs/packages/xemacs-packages/viper/viper-init.el
Index: viper-init.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/viper/viper-init.el,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -p -r1.20 -r1.21
--- viper-init.el 2005/10/06 00:22:01 1.20
+++ viper-init.el 2006/02/19 03:23:13 1.21
@@ -1,7 +1,7 @@
;;; viper-init.el --- some common definitions for Viper
;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-;; 2005 Free Software Foundation, Inc.
+;; 2005, 2006 Free Software Foundation, Inc.
;; Author: Michael Kifer <kifer(a)cs.stonybrook.edu>
@@ -433,6 +433,13 @@ delete the text being replaced, as in st
:group 'viper)
(if (fboundp 'make-variable-frame-local)
(make-variable-frame-local 'viper-insert-state-cursor-color))
+
+(defcustom viper-emacs-state-cursor-color "Magenta"
+ "Cursor color when Viper is in emacs state."
+:type 'string
+:group 'viper)
+(if (fboundp 'make-variable-frame-local)
+ (make-variable-frame-local 'viper-emacs-state-cursor-color))
;; internal var, used to remember the default cursor color of emacs frames
(defvar viper-vi-state-cursor-color nil)
1.25 +1 -1 XEmacs/packages/xemacs-packages/viper/viper-ex.el
Index: viper-ex.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/viper/viper-ex.el,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -p -r1.24 -r1.25
--- viper-ex.el 2005/09/20 17:58:30 1.24
+++ viper-ex.el 2006/02/19 03:23:13 1.25
@@ -1,7 +1,7 @@
;;; viper-ex.el --- functions implementing the Ex commands for Viper
;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003,
-;; 2004, 2005 Free Software Foundation, Inc.
+;; 2004, 2005, 2006 Free Software Foundation, Inc.
;; Author: Michael Kifer <kifer(a)cs.stonybrook.edu>
1.32 +31 -11 XEmacs/packages/xemacs-packages/viper/viper-cmd.el
Index: viper-cmd.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/viper/viper-cmd.el,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -p -r1.31 -r1.32
--- viper-cmd.el 2005/10/06 00:22:01 1.31
+++ viper-cmd.el 2006/02/19 03:23:13 1.32
@@ -1,7 +1,7 @@
;;; viper-cmd.el --- Vi command support for Viper
;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-;; 2005 Free Software Foundation, Inc.
+;; 2005, 2006 Free Software Foundation, Inc.
;; Author: Michael Kifer <kifer(a)cs.stonybrook.edu>
@@ -196,6 +196,15 @@
(viper-save-cursor-color 'before-insert-mode))
;; set insert mode cursor color
(viper-change-cursor-color viper-insert-state-cursor-color)))
+ (if (eq viper-current-state 'emacs-state)
+ (let ((has-saved-cursor-color-in-emacs-mode
+ (stringp (viper-get-saved-cursor-color-in-emacs-mode))))
+ (or has-saved-cursor-color-in-emacs-mode
+ (string= (viper-get-cursor-color) viper-emacs-state-cursor-color)
+ ;; save current color, if not already saved
+ (viper-save-cursor-color 'before-emacs-mode))
+ ;; set emacs mode cursor color
+ (viper-change-cursor-color viper-emacs-state-cursor-color)))
(if (and (memq this-command '(dabbrev-expand hippie-expand))
(integerp viper-pre-command-point)
@@ -643,9 +652,12 @@
(indent-to-left-margin))
(viper-add-newline-at-eob-if-necessary)
(viper-adjust-undo)
- (viper-change-state 'vi-state)
- (viper-restore-cursor-color 'after-insert-mode)
+ (if (eq viper-current-state 'emacs-state)
+ (viper-restore-cursor-color 'after-emacs-mode)
+ (viper-restore-cursor-color 'after-insert-mode))
+
+ (viper-change-state 'vi-state)
;; Protect against user errors in hooks
(condition-case conds
@@ -709,9 +721,17 @@
(or (viper-overlay-p viper-replace-overlay)
(viper-set-replace-overlay (point-min) (point-min)))
(viper-hide-replace-overlay)
+
+ (let ((has-saved-cursor-color-in-emacs-mode
+ (stringp (viper-get-saved-cursor-color-in-emacs-mode))))
+ (or has-saved-cursor-color-in-emacs-mode
+ (string= (viper-get-cursor-color) viper-emacs-state-cursor-color)
+ (viper-save-cursor-color 'before-emacs-mode))
+ (viper-change-cursor-color viper-emacs-state-cursor-color))
+
(viper-change-state 'emacs-state)
- ;; Protect agains user errors in hooks
+ ;; Protect against user errors in hooks
(condition-case conds
(run-hooks 'viper-emacs-state-hook)
(error
@@ -820,12 +840,12 @@ Vi's prefix argument will be used. Othe
;; The next cmd and viper-set-unread-command-events
;; are intended to prevent the input method
;; from swallowing ^M, ^Q and other special characters
- (setq ch (read-char))
+ (setq ch (read-char-exclusive))
;; replace ^M with the newline
(if (eq ch ?\C-m) (setq ch ?\n))
;; Make sure ^V and ^Q work as quotation chars
(if (memq ch '(?\C-v ?\C-q))
- (setq ch (read-char)))
+ (setq ch (read-char-exclusive)))
(viper-set-unread-command-events ch)
(quail-input-method nil)
@@ -842,12 +862,12 @@ Vi's prefix argument will be used. Othe
;; same as above but for XEmacs, which doesn't have
;; quail-input-method
(let (unread-command-events)
- (setq ch (read-char))
+ (setq ch (read-char-exclusive))
;; replace ^M with the newline
(if (eq ch ?\C-m) (setq ch ?\n))
;; Make sure ^V and ^Q work as quotation chars
(if (memq ch '(?\C-v ?\C-q))
- (setq ch (read-char)))
+ (setq ch (read-char-exclusive)))
(viper-set-unread-command-events ch)
(quail-start-translation nil)
@@ -867,12 +887,12 @@ Vi's prefix argument will be used. Othe
(setq ch (aref (read-key-sequence nil) 0)))
(insert ch))
(t
- (setq ch (read-char))
+ (setq ch (read-char-exclusive))
;; replace ^M with the newline
(if (eq ch ?\C-m) (setq ch ?\n))
;; Make sure ^V and ^Q work as quotation chars
(if (memq ch '(?\C-v ?\C-q))
- (setq ch (read-char)))
+ (setq ch (read-char-exclusive)))
(insert ch))
)
(setq last-command-event
@@ -2131,7 +2151,7 @@ To turn this feature off, set this varia
Remove this function from `viper-minibuffer-exit-hook', if this causes
problems."
(if (viper-is-in-minibuffer)
- (progn
+ (let ((inhibit-field-text-motion t))
(goto-char (viper-minibuffer-real-start))
(end-of-line)
(delete-region (point) (point-max)))))
1.72 +18 -1 XEmacs/packages/xemacs-packages/viper/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/viper/ChangeLog,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -p -r1.71 -r1.72
--- ChangeLog 2005/11/25 08:15:37 1.71
+++ ChangeLog 2006/02/19 03:23:13 1.72
@@ -1,7 +1,24 @@
+2006-02-19 Michael Kifer <kifer(a)cs.stonybrook.edu>
+
+ * viper-cmd.el (viper-insert-state-post-command-sentinel,
+ viper-change-state-to-vi, viper-change-state-to-emacs):
+ made aware of cursor coloring in the emacs state.
+ (viper-special-read-and-insert-char): use read-char-exclusive.
+ (viper-minibuffer-trim-tail): workaround for fields in minibuffer.
+
+ * viper-init.el (viper-emacs-state-cursor-color): new variable.
+
+ * viper-util.el (viper-save-cursor-color,
+ viper-get-saved-cursor-color-in-replace-mode,
+ viper-get-saved-cursor-color-in-insert-mode,
+ viper-restore-cursor-color): make aware of the cursor color in emacs
+ state.
+ (viper-get-saved-cursor-color-in-emacs-mode): new function.
+
2005-11-25 Norbert Koch <viteno(a)xemacs.org>
* Makefile (VERSION): XEmacs package 1.47 released.
-
+
2005-11-25 Michael Kifer <kifer(a)cs.stonybrook.edu>
* viper-keym.el (viper-ESC-key): use different values in terminal and