User: michaelk
Date: 06/08/25 18:48:43
Modified: packages/xemacs-packages/viper viper.texi viper.el
viper-util.el viper-init.el viper-ex.el
viper-cmd.el ChangeLog
Log:
* viper.el (viper-set-hooks): use frame bindings for
viper-vi-state-cursor-color.
(viper-non-hook-settings): don't set default
mode-line-buffer-identification.
* viper-util.el (viper-set-cursor-color-according-to-state): new
function.
(viper-set-cursor-color-according-to-state,
viper-get-saved-cursor-color-in-replace-mode,
viper-get-saved-cursor-color-in-insert-mode): make conditional on
viper-emacs-state-cursor-color.
* viper-cmd.el (viper-envelop-ESC-key): bug fix.
(viper-undo): use point if undo-beg-posn is nil.
(viper-insert-state-post-command-sentinel,viper-change-state-to-emacs,
viper-after-change-undo-hook): don't use
viper-emacs-state-cursor-color by default.
(viper-undo): more sensible positioning after undo.
* viper-ex.el (ex-splice-args-in-1-letr-cmd): got rid of caddr.
(viper-emacs-state-cursor-color): default to nil, since this feature
doesn't work well yet.
* viper-cmd.el (viper-special-read-and-insert-char): use
read-key-sequence.
(viper-after-change-undo-hook): enhancements.
(viper-after-change-undo-hook): new hook.
(viper-undo): use viper-after-change-undo-hook.
(viper-add-newline-at-eob-if-necessary): widen before making changes.
(viper-next-line-at-bol): If point is on a widget or a button, simulate
clicking on that widget/button.
* viper.el (viper-mode): allow for a separate cursor color in Emacs
state.
Revision Changes Path
1.31 +6 -6 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.30
retrieving revision 1.31
diff -u -p -r1.30 -r1.31
--- viper.texi 2006/02/19 03:23:12 1.30
+++ viper.texi 2006/08/25 16:48:41 1.31
@@ -8,7 +8,7 @@
@copying
Copyright @copyright{} 1995, 1996, 1997, 2001, 2002, 2003, 2004,
- 2005, 2006 Free Software Foundation, Inc.
+2005, 2006 Free Software Foundation, Inc.
@quotation
Permission is granted to copy, distribute and/or modify this document
@@ -236,7 +236,7 @@ etc.
Furthermore, Viper lets Ex-style commands to work on the current region.
This is done by typing a digit argument before @kbd{:}. For instance,
-typing @kbd{1:} will propmt you with something like @emph{:123,135},
+typing @kbd{1:} will prompt you with something like @emph{:123,135},
assuming that the current region starts at line 123 and ends at line
135. There is no need to type the line numbers, since Viper inserts them
automatically in front of the Ex command.
@@ -417,7 +417,7 @@ should start them with a @kbd{:}, e.g.,
In Viper, Ex commands can be made to work on the current Emacs region.
This is done by typing a digit argument before @kbd{:}.
-For instance, typing @kbd{1:} will propmt you with something like
+For instance, typing @kbd{1:} will prompt you with something like
@emph{:123,135}, assuming that the current region starts at line 123 and
ends at line 135. There is no need to type the line numbers, since Viper
inserts them automatically in front of the Ex command.
@@ -2292,7 +2292,7 @@ the Shell mode by changing the bindings
(@pxref{Customization}).
In some cases, some @emph{minor} modes might override certain essential
-bindings in Vi command state. This is not a big priblem because this
+bindings in Vi command state. This is not a big problem because this
can happen only in the beginning, when the minor mode kicks in. Typing
@code{M-x viper-mode} will correct the situation. Viper knows about
several such minor modes and takes care of them, so the above trick
@@ -2670,7 +2670,7 @@ placing this command in @code{~/.viper}:
(setq viper-mouse-insert-key '(meta 2))
@end lisp
If you want to bind mouse-insert to an action even if this action is
-already taked for other purposes in Emacs, then you should add this command
+already taken for other purposes in Emacs, then you should add this command
to @code{~/.viper}, after setting @code{viper-mouse-insert-key}:
@lisp
(viper-bind-mouse-insert-key 'force)
@@ -3239,7 +3239,7 @@ Control character.
Finally, we note that Viper's Ex-style commands can be made to work on the
current Emacs region. This is done by typing a digit argument before
-@kbd{:}. For instance, typing @kbd{1:} will propmt you with something like
+@kbd{:}. For instance, typing @kbd{1:} will prompt you with something like
@emph{:123,135}, assuming that the current region starts at line 123 and
ends at line 135. There is no need to type the line numbers, since Viper
inserts them automatically in front of the Ex command.
1.38 +9 -8 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.37
retrieving revision 1.38
diff -u -p -r1.37 -r1.38
--- viper.el 2006/02/19 03:23:12 1.37
+++ viper.el 2006/08/25 16:48:41 1.38
@@ -545,8 +545,6 @@ If Viper is enabled, turn it off. Other
(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)
@@ -616,7 +614,8 @@ This startup message appears whenever yo
(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
@@ -860,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)
@@ -901,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))))
@@ -1006,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
1.27 +21 -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.26
retrieving revision 1.27
diff -u -p -r1.26 -r1.27
--- viper-util.el 2006/02/19 03:23:12 1.26
+++ viper-util.el 2006/08/25 16:48:42 1.27
@@ -137,10 +137,10 @@
(x-display-color-p) ; emacs
))
-(defsubst viper-get-cursor-color ()
+(defun viper-get-cursor-color (&optional frame)
(viper-cond-compile-for-xemacs-or-emacs
- ;; xemacs
- (color-instance-name (frame-property (selected-frame) 'cursor-color))
+ (color-instance-name
+ (frame-property (or frame (selected-frame)) 'cursor-color)) ; xemacs
(cdr (assoc 'cursor-color (frame-parameters))) ; emacs
))
@@ -152,18 +152,31 @@
;; cursor colors
-(defun viper-change-cursor-color (new-color)
+(defun viper-change-cursor-color (new-color &optional frame)
(if (and (viper-window-display-p) (viper-color-display-p)
(stringp new-color) (viper-color-defined-p new-color)
(not (string= new-color (viper-get-cursor-color))))
(viper-cond-compile-for-xemacs-or-emacs
(set-frame-property
- (selected-frame) 'cursor-color (make-color-instance new-color))
+ (or frame (selected-frame))
+ 'cursor-color (make-color-instance new-color))
(modify-frame-parameters
- (selected-frame) (list (cons 'cursor-color new-color)))
+ (or frame (selected-frame))
+ (list (cons 'cursor-color new-color)))
)
))
+(defun viper-set-cursor-color-according-to-state (&optional frame)
+ (cond ((eq viper-current-state 'replace-state)
+ (viper-change-cursor-color viper-replace-state-cursor-color frame))
+ ((and (eq viper-current-state 'emacs-state)
+ viper-emacs-state-cursor-color)
+ (viper-change-cursor-color viper-emacs-state-cursor-color frame))
+ ((eq viper-current-state 'insert-state)
+ (viper-change-cursor-color viper-insert-state-cursor-color frame))
+ (t
+ (viper-change-cursor-color viper-vi-state-cursor-color frame))))
+
;; By default, saves current frame cursor color in the
;; viper-saved-cursor-color-in-replace-mode property of viper-replace-overlay
(defun viper-save-cursor-color (before-which-mode)
@@ -191,7 +204,7 @@
(if viper-emacs-p 'frame-parameter 'frame-property)
(selected-frame)
'viper-saved-cursor-color-in-replace-mode)
- (if (eq viper-current-state 'emacs-mode)
+ (if (and (eq viper-current-state 'emacs-mode) viper-emacs-state-cursor-color)
viper-emacs-state-cursor-color
viper-vi-state-cursor-color)))
@@ -201,7 +214,7 @@
(if viper-emacs-p 'frame-parameter 'frame-property)
(selected-frame)
'viper-saved-cursor-color-in-insert-mode)
- (if (eq viper-current-state 'emacs-mode)
+ (if (and (eq viper-current-state 'emacs-mode) viper-emacs-state-cursor-color)
viper-emacs-state-cursor-color
viper-vi-state-cursor-color)))
1.22 +4 -15 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.21
retrieving revision 1.22
diff -u -p -r1.21 -r1.22
--- viper-init.el 2006/02/19 03:23:13 1.21
+++ viper-init.el 2006/08/25 16:48:42 1.22
@@ -434,7 +434,10 @@ delete the text being replaced, as in st
(if (fboundp 'make-variable-frame-local)
(make-variable-frame-local 'viper-insert-state-cursor-color))
-(defcustom viper-emacs-state-cursor-color "Magenta"
+;; viper-emacs-state-cursor-color doesn't work well. Causes cursor colors to be
+;; confused in some cases. So, this var is nulled for now.
+;; (defcustom viper-emacs-state-cursor-color "Magenta"
+(defcustom viper-emacs-state-cursor-color nil
"Cursor color when Viper is in emacs state."
:type 'string
:group 'viper)
@@ -854,11 +857,6 @@ Related buffers can be cycled through vi
;;; Face-saving tricks
-(defun viper-hide-face (face)
- (if (and (viper-has-face-support-p) viper-emacs-p)
- (add-to-list 'facemenu-unlisted-faces face)))
-
-
(defgroup viper-highlighting nil
"Hilighting of replace region, search pattern, minibuffer, etc."
:prefix "viper-"
@@ -876,8 +874,6 @@ Related buffers can be cycled through vi
DO NOT CHANGE this variable. Instead, use the customization widget
to customize the actual face object `viper-search'
this variable represents.")
-(viper-hide-face viper-search-face)
-
(defface viper-replace-overlay
'((((class color)) (:foreground "Black" :background
"darkseagreen2"))
@@ -890,9 +886,7 @@ this variable represents.")
DO NOT CHANGE this variable. Instead, use the customization widget
to customize the actual face object `viper-replace-overlay'
this variable represents.")
-(viper-hide-face viper-replace-overlay-face)
-
(defface viper-minibuffer-emacs
'((((class color)) (:foreground "Black" :background
"darkseagreen2"))
(t (:weight bold)))
@@ -904,8 +898,6 @@ this variable represents.")
DO NOT CHANGE this variable. Instead, use the customization widget
to customize the actual face object `viper-minibuffer-emacs'
this variable represents.")
-(viper-hide-face viper-minibuffer-emacs-face)
-
(defface viper-minibuffer-insert
'((((class color)) (:foreground "Black" :background "pink"))
@@ -918,8 +910,6 @@ this variable represents.")
DO NOT CHANGE this variable. Instead, use the customization widget
to customize the actual face object `viper-minibuffer-insert'
this variable represents.")
-(viper-hide-face viper-minibuffer-insert-face)
-
(defface viper-minibuffer-vi
'((((class color)) (:foreground "DarkGreen" :background
"grey"))
@@ -932,7 +922,6 @@ this variable represents.")
DO NOT CHANGE this variable. Instead, use the customization widget
to customize the actual face object `viper-minibuffer-vi'
this variable represents.")
-(viper-hide-face viper-minibuffer-vi-face)
;; the current face to be used in the minibuffer
(viper-deflocalvar
1.26 +4 -4 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.25
retrieving revision 1.26
diff -u -p -r1.25 -r1.26
--- viper-ex.el 2006/02/19 03:23:13 1.25
+++ viper-ex.el 2006/08/25 16:48:42 1.26
@@ -208,12 +208,12 @@
;; If this is a one-letter magic command, splice in args.
(defun ex-splice-args-in-1-letr-cmd (key list)
- (let ((onelet (ex-cmd-is-one-letter (assoc (substring key 0 1) list))))
- (if onelet
+ (let ((oneletter (ex-cmd-is-one-letter (assoc (substring key 0 1) list))))
+ (if oneletter
(list key
- (append (cadr onelet)
+ (append (cadr oneletter)
(if (< 1 (length key)) (list (substring key 1))))
- (caddr onelet)))
+ (car (cdr (cdr oneletter))) ))
))
1.33 +104 -55 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.32
retrieving revision 1.33
diff -u -p -r1.32 -r1.33
--- viper-cmd.el 2006/02/19 03:23:13 1.32
+++ viper-cmd.el 2006/08/25 16:48:42 1.33
@@ -46,6 +46,8 @@
(defvar mark-even-if-inactive)
(defvar init-message)
(defvar initial)
+(defvar undo-beg-posn)
+(defvar undo-end-posn)
;; loading happens only in non-interactive compilation
;; in order to spare non-viperized emacs from being viperized
@@ -196,7 +198,7 @@
(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)
+ (if (and viper-emacs-state-cursor-color (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
@@ -722,12 +724,13 @@
(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))
+ (if viper-emacs-state-cursor-color
+ (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)
@@ -887,12 +890,15 @@ Vi's prefix argument will be used. Othe
(setq ch (aref (read-key-sequence nil) 0)))
(insert ch))
(t
- (setq ch (read-char-exclusive))
+ ;;(setq ch (read-char-exclusive))
+ (setq ch (aref (read-key-sequence nil) 0))
;; 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-exclusive)))
+ ;;(setq ch (read-char-exclusive))
+ (setq ch (aref (read-key-sequence nil) 0))
+ )
(insert ch))
)
(setq last-command-event
@@ -1027,10 +1033,13 @@ as a Meta key and any number of multiple
(inhibit-quit t))
(if (viper-ESC-event-p event)
(progn
- ;; Emacs 22.50.8 introduced a bug, which makes even a single ESC into
- ;; a fast keyseq. To guard against this, we added a check if there
- ;; are other events as well
- (if (and (viper-fast-keysequence-p) unread-command-events)
+ ;; Some versions of Emacs (eg., 22.50.8 have a bug, which makes even
+ ;; a single ESC into ;; a fast keyseq. To guard against this, we
+ ;; added a check if there are other events as well. Keep the next
+ ;; line for the next time the bug reappears, so that will remember to
+ ;; report it.
+ ;;(if (and (viper-fast-keysequence-p) unread-command-events)
+ (if (viper-fast-keysequence-p) ;; for Emacsen without the above bug
(progn
(let (minor-mode-map-alist emulation-mode-map-alists)
(viper-set-unread-command-events event)
@@ -1730,42 +1739,63 @@ invokes the command before that, etc."
;; undoing
+;; hook used inside undo
+(defvar viper-undo-functions nil)
+
+;; Runs viper-before-change-functions inside before-change-functions
+(defun viper-undo-sentinel (beg end length)
+ (run-hook-with-args 'viper-undo-functions beg end length))
+
+(add-hook 'after-change-functions 'viper-undo-sentinel)
+
+;; Hook used in viper-undo
+(defun viper-after-change-undo-hook (beg end len)
+ (if undo-in-progress
+ (setq undo-beg-posn beg
+ undo-end-posn (or end beg))
+ ;; some other hooks may be changing various text properties in
+ ;; the buffer in response to 'undo'; so remove this hook to avoid
+ ;; its repeated invocation
+ (remove-hook 'viper-undo-functions 'viper-after-change-undo-hook 'local)
+ ))
+
(defun viper-undo ()
"Undo previous change."
(interactive)
(message "undo!")
(let ((modified (buffer-modified-p))
(before-undo-pt (point-marker))
- (after-change-functions after-change-functions)
undo-beg-posn undo-end-posn)
- ;; no need to remove this hook, since this var has scope inside a let.
- (add-hook 'after-change-functions
- '(lambda (beg end len)
- (setq undo-beg-posn beg
- undo-end-posn (or end beg))))
+ ;; the viper-after-change-undo-hook removes itself after the 1st invocation
+ (add-hook 'viper-undo-functions 'viper-after-change-undo-hook nil
'local)
(undo-start)
(undo-more 2)
- (setq undo-beg-posn (or undo-beg-posn before-undo-pt)
- undo-end-posn (or undo-end-posn undo-beg-posn))
+ ;;(setq undo-beg-posn (or undo-beg-posn (point))
+ ;; undo-end-posn (or undo-end-posn (point)))
+ ;;(setq undo-beg-posn (or undo-beg-posn before-undo-pt)
+ ;; undo-end-posn (or undo-end-posn undo-beg-posn))
+
+ (if (and undo-beg-posn undo-end-posn)
+ (progn
+ (goto-char undo-beg-posn)
+ (sit-for 0)
+ (if (and viper-keep-point-on-undo
+ (pos-visible-in-window-p before-undo-pt))
+ (progn
+ (push-mark (point-marker) t)
+ (viper-sit-for-short 300)
+ (goto-char undo-end-posn)
+ (viper-sit-for-short 300)
+ (if (pos-visible-in-window-p undo-beg-posn)
+ (goto-char before-undo-pt)
+ (goto-char undo-beg-posn)))
+ (push-mark before-undo-pt t))
+ ))
- (goto-char undo-beg-posn)
- (sit-for 0)
- (if (and viper-keep-point-on-undo
- (pos-visible-in-window-p before-undo-pt))
- (progn
- (push-mark (point-marker) t)
- (viper-sit-for-short 300)
- (goto-char undo-end-posn)
- (viper-sit-for-short 300)
- (if (and (> (viper-chars-in-region undo-beg-posn before-undo-pt) 1)
- (> (viper-chars-in-region undo-end-posn before-undo-pt) 1))
- (goto-char before-undo-pt)
- (goto-char undo-beg-posn)))
- (push-mark before-undo-pt t))
(if (and (eolp) (not (bolp))) (backward-char 1))
- (if (not modified) (set-buffer-modified-p t)))
+ )
(setq this-command 'viper-undo))
;; Continue undoing previous changes.
@@ -1813,8 +1843,8 @@ invokes the command before that, etc."
(setq viper-undo-needs-adjustment t)))))
+;;; Viper's destructive Command ring utilities
-
(defun viper-display-current-destructive-command ()
(let ((text (nth 4 viper-d-com))
(keys (nth 5 viper-d-com))
@@ -1927,12 +1957,15 @@ Undo previous insertion and inserts new.
(end-of-line)
;; make sure all lines end with newline, unless in the minibuffer or
;; when requested otherwise (require-final-newline is nil)
- (if (and (eobp)
- (not (bolp))
- require-final-newline
- (not (viper-is-in-minibuffer))
- (not buffer-read-only))
- (insert "\n"))))
+ (save-restriction
+ (widen)
+ (if (and (eobp)
+ (not (bolp))
+ require-final-newline
+ (not (viper-is-in-minibuffer))
+ (not buffer-read-only))
+ (insert "\n")))
+ ))
(defun viper-yank-defun ()
(mark-defun)
@@ -3045,19 +3078,34 @@ On reaching beginning of line, stop and
(setq this-command 'next-line)
(if com (viper-execute-com 'viper-next-line val com))))
+
(defun viper-next-line-at-bol (arg)
- "Next line at beginning of line."
+ "Next line at beginning of line.
+If point is on a widget or a button, simulate clicking on that widget/button."
(interactive "P")
- (viper-leave-region-active)
- (save-excursion
- (end-of-line)
- (if (eobp) (error "Last line in buffer")))
- (let ((val (viper-p-val arg))
- (com (viper-getCom arg)))
- (if com (viper-move-marker-locally 'viper-com-point (point)))
- (forward-line val)
- (back-to-indentation)
- (if com (viper-execute-com 'viper-next-line-at-bol val com))))
+ (let* ((field (get-char-property (point) 'field))
+ (button (get-char-property (point) 'button))
+ (doc (get-char-property (point) 'widget-doc))
+ (widget (or field button doc)))
+ (if (and widget
+ (if (symbolp widget)
+ (get widget 'widget-type)
+ (and (consp widget)
+ (get (widget-type widget) 'widget-type))))
+ (widget-button-press (point))
+ (if (button-at (point))
+ (push-button)
+ ;; not a widget or a button
+ (viper-leave-region-active)
+ (save-excursion
+ (end-of-line)
+ (if (eobp) (error "Last line in buffer")))
+ (let ((val (viper-p-val arg))
+ (com (viper-getCom arg)))
+ (if com (viper-move-marker-locally 'viper-com-point (point)))
+ (forward-line val)
+ (back-to-indentation)
+ (if com (viper-execute-com 'viper-next-line-at-bol val com)))))))
(defun viper-previous-line (arg)
@@ -3916,7 +3964,8 @@ Null string will repeat previous search.
(let ((val (viper-p-val arg))
(com (viper-getcom arg))
debug-on-error)
- (if (null viper-s-string) (error viper-NoPrevSearch))
+ (if (or (null viper-s-string) (string= viper-s-string ""))
+ (error viper-NoPrevSearch))
(viper-search viper-s-string viper-s-forward arg)
(if com
(progn
1.74 +39 -0 XEmacs/packages/xemacs-packages/viper/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/viper/ChangeLog,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -p -r1.73 -r1.74
--- ChangeLog 2006/02/20 07:27:44 1.73
+++ ChangeLog 2006/08/25 16:48:42 1.74
@@ -1,3 +1,42 @@
+2006-08-25 Michael Kifer <kifer(a)cs.stonybrook.edu>
+
+ * viper.el (viper-set-hooks): use frame bindings for
+ viper-vi-state-cursor-color.
+ (viper-non-hook-settings): don't set default
+ mode-line-buffer-identification.
+
+ * viper-util.el (viper-set-cursor-color-according-to-state): new
+ function.
+ (viper-set-cursor-color-according-to-state,
+ viper-get-saved-cursor-color-in-replace-mode,
+ viper-get-saved-cursor-color-in-insert-mode): make conditional on
+ viper-emacs-state-cursor-color.
+
+ * viper-cmd.el (viper-envelop-ESC-key): bug fix.
+ (viper-undo): use point if undo-beg-posn is nil.
+ (viper-insert-state-post-command-sentinel,viper-change-state-to-emacs,
+ viper-after-change-undo-hook): don't use
+ viper-emacs-state-cursor-color by default.
+ (viper-undo): more sensible positioning after undo.
+
+ * viper-ex.el (ex-splice-args-in-1-letr-cmd): got rid of caddr.
+ (viper-emacs-state-cursor-color): default to nil, since this feature
+ doesn't work well yet.
+
+2006-06-18 Michael Kifer <kifer(a)cs.stonybrook.edu>
+
+ * viper-cmd.el (viper-special-read-and-insert-char): use
+ read-key-sequence.
+ (viper-after-change-undo-hook): enhancements.
+ (viper-after-change-undo-hook): new hook.
+ (viper-undo): use viper-after-change-undo-hook.
+ (viper-add-newline-at-eob-if-necessary): widen before making changes.
+ (viper-next-line-at-bol): If point is on a widget or a button, simulate
+ clicking on that widget/button.
+
+ * viper.el (viper-mode): allow for a separate cursor color in Emacs
+ state.
+
2006-02-20 Norbert Koch <viteno(a)xemacs.org>
* Makefile (VERSION): XEmacs package 1.48 released.