User: michaelk
Date: 05/02/19 20:30:10
Modified: packages/xemacs-packages/viper viper.texi viper.el
viper-util.el viper-macs.el viper-keym.el
viper-init.el viper-ex.el viper-cmd.el ChangeLog
Log:
* viper-cmd.el (viper-prefix-commands): make into a defconst.
(viper-exec-buffer-search): use regexp-quote to quote the buffer
string.
(viper-minibuffer-setup-sentinel): make some variables buffer-local.
(viper-skip-separators): bug fix.
(viper-set-searchstyle-toggling-macros): allow to unset macros in a
particular major mode.
(viper-del-backward-char-in-replace): don't put deleted char on the
kill ring.
* viper-ex.el (viper-color-display-p): new function.
(viper-has-face-support-p): use viper-color-display-p.
* viper-keym.el (viper-gnus-modifier-map): new keymap.
* viper-macs.el (viper-unrecord-kbd-macro): bug fix.
* viper-util.el (viper-glob-unix-files): fix shell status check.
(viper-file-remote-p): make equivalent to file-remote-p.
* viper.el (viper-major-mode-modifier-list): use
viper-gnus-modifier-map.
Revision Changes Path
1.26 +52 -31 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.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- viper.texi 2002/10/16 06:16:26 1.25
+++ viper.texi 2005/02/19 19:30:03 1.26
@@ -314,8 +314,8 @@
Viper defines @kbd{C-\} as its Meta key in Vi state. @xref{Vi State}, for
more info.@refill
-Emacs is structured as a lisp interpreter around a C core. Emacs keys
-cause lisp functions to be called. It is possible to call these
+Emacs is structured as a Lisp interpreter around a C core. Emacs keys
+cause Lisp functions to be called. It is possible to call these
functions directly, by typing @kbd{M-x function-name}.
@node Loading Viper, States in Viper, Emacs Preliminaries, Overview
@@ -596,7 +596,7 @@
Viper uses Emacs Regular Expressions for searches. These are a superset of
Vi regular
expressions, excepting the change-of-case escapes @samp{\u}, @samp{\L},
-@dots{}, etc. @xref{Regular Expressions,,Regular Expressions,emacs,The
+@dots{}, etc. @xref{Regexps,,Syntax of Regular Expressions,emacs,The
GNU Emacs Manual}, for details.
Files specified to @kbd{:e} use @code{csh} regular expressions
(globbing, wildcards, what have you).
@@ -1194,7 +1194,7 @@
from the menubar. Viper customization group is located under the
@emph{Emulations} customization group, which in turn is under the
@emph{Editing} group (or simply by typing @kbd{:customize}). All Viper
-faces are grouped together under Viper's
+faces are grouped together under Viper's
@emph{Highlighting} group.
Try it: it is really simple!
@@ -1312,7 +1312,7 @@
hit @kbd{C-x} followed by @kbd{2}, then the current window will be split
into 2. Except for novice users, @kbd{C-c} is also set to execute an Emacs
command from the current major mode. @key{ESC} will do the same, if you
-configure @key{ESC} as Meta by setting @code{viper-no-multiple-ESC} to nil
+configure @key{ESC} as Meta by setting @code{viper-no-multiple-ESC} to @code{nil}
in @file{.viper}. @xref{Customization}. @kbd{C-\} in Insert, Replace, or Vi
states will make Emacs think @kbd{Meta} has been hit.@refill
@item \
@@ -1742,18 +1742,18 @@
Setting this variable too high may slow down your typing. Setting it too
low may make it hard to type macros quickly enough.
-@item viper-translate-all-ESC-keysequences t on tty, nil on windowing display
+@item viper-translate-all-ESC-keysequences @code{t} on tty, @code{nil} on windowing
display
Normally, Viper lets Emacs translate only those ESC key sequences that are
defined in the low-level key-translation-map or function-key-map, such as those
emitted by the arrow and function keys. Other sequences, e.g., @kbd{\\e/}, are
treated as @kbd{ESC} command followed by a @kbd{/}. This is good for people
who type fast and tend to hit other characters right after they hit
-ESC. Other people like Emacs to translate @kbd{ESC} sequences all the time.
+ESC. Other people like Emacs to translate @kbd{ESC} sequences all the time.
The default is to translate all sequences only when using a dumb terminal.
This permits you to use @kbd{ESC} as a meta key in insert mode. For instance,
hitting @kbd{ESC x} fast would have the effect of typing @kbd{M-x}.
If your dumb terminal is not so dumb and understands the meta key, then you
-probably will be better off setting this variable to nil. Try and see which
+probably will be better off setting this variable to @code{nil}. Try and see which
way suits you best.
@item viper-ex-style-motion t
Set this to @code{nil}, if you want @kbd{l,h} to cross
@@ -1764,8 +1764,8 @@
at the beginning of a line in Insert state, @key{X} and @key{x} to delete
characters across lines in Vi command state, etc.
@item viper-ESC-moves-cursor-back t
-It t, cursor moves back 1 character when switching from insert state to vi
-state. If nil, the cursor stays where it was before the switch.
+It @code{t}, cursor moves back 1 character when switching from insert state to vi
+state. If @code{nil}, the cursor stays where it was before the switch.
@item viper-always t
@code{t} means: leave it to Viper to decide when a buffer must be brought
up in Vi state,
@@ -1873,17 +1873,17 @@
insert 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-nil.
+TTYs or if @code{viper-use-replace-region-delimiters} is non-@code{nil}.
@item viper-replace-region-start-delimiter ""
A string used to mark the beginning of replacement regions. It is used
-only on TTYs or if @code{viper-use-replace-region-delimiters} is non-nil.
+only on TTYs or if @code{viper-use-replace-region-delimiters} is non-@code{nil}.
@item viper-use-replace-region-delimiters
-If non-nil, Viper will always use @code{viper-replace-region-end-delimiter} and
+If non-@code{nil}, Viper will always use @code{viper-replace-region-end-delimiter} and
@code{viper-replace-region-start-delimiter} to delimit replacement regions,
even on color displays (where this is unnecessary). By default, this
-variable is non-nil only on TTYs or monochrome displays.
+variable is non-@code{nil} only on TTYs or monochrome displays.
@item viper-allow-multiline-replace-regions t
-If non-nil, multi-line text replacement regions, such as those produced by
+If non-@code{nil}, multi-line text replacement regions, such as those produced by
commands @kbd{c55w}, @kbd{3C}, etc., will stay around until the user exits
the replacement mode. In this variable is set to @code{nil}, Viper will
emulate the standard Vi behavior, which supports only intra-line
@@ -2035,7 +2035,7 @@
@code{viper-insert-global-user-map}, and @code{viper-emacs-global-user-map}, as
explained below. Each of these key maps affects the corresponding Viper state.
The keymap @code{viper-insert-global-user-map} also affects Viper's Replace
-state.
+state.
@noindent
If you want to
@@ -2066,7 +2066,7 @@
@end example
@noindent
-Each Emacs command key calls some lisp function. If you have enabled the
+Each Emacs command key calls some Lisp function. If you have enabled the
Help, (@pxref{Rudimentary Changes}) @kbd{C-h k} will show you the function
for each specific key; @kbd{C-h b} will show all bindings, and @kbd{C-h m}
will provide information on the major mode in effect. If Help is not
@@ -2219,7 +2219,7 @@
@code{viper-want-emacs-keys-in-vi} and @code{viper-want-emacs-keys-in-insert} to
@code{nil}).
If @code{viper-always} is set to @code{t} (which is the default), Viper
-will try to bring each buffer
+will try to bring each buffer
in the Viper state that is most appropriate for that buffer.
Usually, this would be the Vi state, but sometimes it could be the Insert
state or the Emacs state.
@@ -2285,7 +2285,7 @@
bind common keys to specialized commands. This might make sense for modes
that bind only a small number of common keys. For instance, Viper subverts
the Shell mode by changing the bindings for @kbd{C-m} and @kbd{C-d} using
-@code{viper-add-local-keys} described in section on customization
+@code{viper-add-local-keys} described in the section on customization
(@pxref{Customization}).
In some cases, some @emph{minor} modes might override certain essential
@@ -2294,7 +2294,7 @@
@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
is usually not necessary. If you find that some minor mode, e.g.,
-(a)code{nasty-mode.el} interferes with Viper, putting the following in
+@code{nasty-mode} interferes with Viper, putting the following in
@file{.viper} should fix the problem:
@lisp
(viper-harness-minor-mode "nasty-mode")
@@ -2305,7 +2305,7 @@
It may not be always obvious which minor mode is at fault. The only
guidance here is to look into the file that defines the minor mode you are
-suspecting, say @code{nasty-mode.el}, and see if it has a variable called
+suspecting, say @file{nasty-mode.el}, and see if it has a variable called
@code{nasty-mode-map}. Then check if there is a statement of the form
@lisp
(define-key nasty-mode-map key function)
@@ -2316,6 +2316,18 @@
suspicion is wrong, no harm is done if you harness a minor mode that
doesn't need to be harnessed.
+It is recommended to harness even those minor modes that don't override
+Viper keys, but still have their own keymaps. A general way to
+make a minor mode, @code{my-mode},
+compatible with Viper is to have the file @file{my-mode.el} include the following
code:
+
+@lisp
+(when (fboundp 'viper-harness-minor-mode)
+ (let ((lib (file-name-sans-extension
+ (file-name-nondirectory load-file-name))))
+ (viper-harness-minor-mode lib)))
+@end lisp
+
@vindex @code{viper-want-emacs-keys-in-vi}
@vindex @code{viper-want-emacs-keys-in-insert}
@vindex @code{viper-always}
@@ -2371,11 +2383,19 @@
@end example
@findex @code{viper-set-searchstyle-toggling-macros}
+If you don't like this feature as a default, but would still like to have
+it in some major modes, you can do so by first unsetting it globally, as
+shown above, and then setting it in the desired major modes as follows:
+@example
+(viper-set-searchstyle-toggling-macros nil 'c-mode)
+(viper-set-searchstyle-toggling-macros nil 'lisp-mode)
+@end example
+
@item Vi-isms in Emacs state
Some people find it useful to use the Vi-style search key, `/', to invoke
search in modes which Viper leaves in emacs-state. These modes are:
-@code{dired-mode}, @code{mh-folder-mode}, @code{gnus-group-mode},
-@code{gnus-summary-mode}, @code{Info-mode}, and @code{Buffer-menu-mode}
+@code{dired-mode}, @code{mh-folder-mode},
+@code{Info-mode}, and @code{Buffer-menu-mode}
(more may be added in the future). So, in the above modes, Viper binds `/'
so that it will behave Vi-style. Furthermore, in those major modes, Viper
binds `:' to invoke ex-style commands, like in vi-state. And, as described
@@ -2390,7 +2410,7 @@
To unbind the macros `//' and `///' for a major mode where you feel they
are undesirable, execute @code{viper-set-emacs-state-searchstyle-macros} with a
-non-nil argument. This can be done either interactively, by supplying a
+non-@code{nil} argument. This can be done either interactively, by supplying a
prefix argument, or by placing
@example
(viper-set-emacs-state-searchstyle-macros 'undefine)
@@ -2661,7 +2681,7 @@
purpose of mouse search and mouse insert. By default, this is set to
@code{double-click-time} in Emacs and to
@code{mouse-track-multi-click-time} milliseconds in XEmacs.
-@end table
+@end table
@kindex @kbd{S-Mouse-1}
@kindex @kbd{S-Mouse-2}
@kindex @kbd{meta shift button1up}
@@ -2731,7 +2751,7 @@
specially, if this key sequence is bound to a macro.
Viper provides Vi-style keyboard macros through the usual Ex commands,
-@kbd{:map} and
+@kbd{:map} and
@kbd{:map!}. These macros are much more powerful in Viper than
they are in the original Vi and in other emulators. This is because Viper
implements an enhanced vi-style
@@ -2779,7 +2799,7 @@
macros) lets the user define keyboard macros that ask for confirmation or
even prompt the user for input and then continue. To do this, one should
type @kbd{C-x q} (for confirmation) or @kbd{C-u C-x q} (for prompt).
-For details, @pxref{Kbd Macro Query,,Customization,emacs,The GNU Emacs
+For details, @pxref{Keyboard Macro Query,,Customization,emacs,The GNU Emacs
Manual} @refill
When the user finishes defining a macro (which is done by typing @kbd{C-x)} ---
@@ -3143,7 +3163,7 @@
We also use @samp{word} for alphanumeric/non-alphanumeric words, and
@samp{WORD} for whitespace delimited words. @samp{char} refers to any
-ASCII character, @samp{CHAR} to non-whitespace character.
+@acronym{ASCII} character, @samp{CHAR} to non-whitespace character.
Brackets @samp{[]} indicate optional parameters; @samp{<count>} also
optional, usually defaulting to 1. Brackets are elided for
@samp{<count>} to eschew obfuscation.
@@ -3363,7 +3383,7 @@
Find the next bracket/parenthesis/brace and go to its match.
By default, Viper ignores brackets/parentheses/braces that occur inside
parentheses. You can change this by setting
-@code{viper-parse-sexp-ignore-comments} to nil in your @file{.viper} file.
+@code{viper-parse-sexp-ignore-comments} to @code{nil} in your @file{.viper} file.
This option can also be toggled interactively if you quickly hit @kbd{%%%}.
This latter feature is implemented as a vi-style keyboard macro. If you
@@ -4047,8 +4067,8 @@
@item :args
List files not shown anywhere with counts for next
@item :n [count] [+<cmd>] [<files>]
-Edit <count> file, or edit files. The count comes from @kbd{:args}.
-@item :N [count] [+<cmd>] [<files>]
+Edit <count> file, or edit files. The count comes from @kbd{:args}.
+@item :N [count] [+<cmd>] [<files>]
Like @kbd{:n}, but the meaning of the variable
@var{ex-cycle-other-window} is reversed.
@item :b
@@ -4475,6 +4495,7 @@
gvr@(a)halcyon.com (George V.@: Reilly),
hatazaki@(a)bach.convex.com (Takao Hatazaki),
hpz@(a)ibmhpz.aug.ipp-garching.mpg.de (Hans-Peter Zehrfeld),
+irie@(a)t.email.ne.jp (Irie Tetsuya),
jackr@(a)dblues.engr.sgi.com (Jack Repenning),
jamesm@(a)bga.com (D.J.@: Miller II),
jjm@(a)hplb.hpl.hp.com (Jean-Jacques Moreau),
1.27 +5 -5 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.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- viper.el 2003/05/18 17:57:25 1.26
+++ viper.el 2005/02/19 19:30:04 1.27
@@ -3,12 +3,12 @@
;; and a venomous VI PERil.
;; Viper Is also a Package for Emacs Rebels.
-;; Copyright (C) 1994, 95, 96, 97, 98, 99, 2000, 01, 02 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 95, 96, 97, 98, 99, 2000, 01, 02, 05 Free Software Foundation,
Inc.
;; Author: Michael Kifer <kifer(a)cs.stonybrook.edu>
;; Keywords: emulations
-(defconst viper-version "3.11.2 of January 4, 2002"
+(defconst viper-version "3.11.4 of February 19, 2005"
"The current version of Viper")
;; This file is part of GNU Emacs.
@@ -466,7 +466,7 @@
(nth 0 triple) (nth 1 triple) (eval (nth 2 triple))))
viper-major-mode-modifier-list))
-;; We change standard bindings in some major mode, making them slightly
+;; We change standard bindings in some major modes, making them slightly
;; different than in "normal" vi/insert/emacs states
(defcustom viper-major-mode-modifier-list
'((help-mode emacs-state viper-slash-and-colon-map)
@@ -482,8 +482,8 @@
(dired-mode emacs-state viper-dired-modifier-map)
(tar-mode emacs-state viper-slash-and-colon-map)
(mh-folder-mode emacs-state viper-slash-and-colon-map)
- (gnus-group-mode emacs-state viper-slash-and-colon-map)
- (gnus-summary-mode emacs-state viper-slash-and-colon-map)
+ (gnus-group-mode emacs-state viper-gnus-modifier-map)
+ (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)
)
1.20 +13 -19 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.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- viper-util.el 2003/05/18 17:57:25 1.19
+++ viper-util.el 2005/02/19 19:30:04 1.20
@@ -394,17 +394,17 @@
command)))
(goto-char (point-min))
;; Issue an error, if no match.
- (if (> status 0)
- (save-excursion
- (skip-chars-forward " \t\n\j")
- (if (looking-at "ls:")
- (viper-forward-Word 1))
- (error "%s: %s"
- (if (stringp gshell)
- gshell
- "shell")
- (buffer-substring (point) (viper-line-pos 'end)))
- ))
+ (unless (eq 0 status)
+ (save-excursion
+ (skip-chars-forward " \t\n\j")
+ (if (looking-at "ls:")
+ (viper-forward-Word 1))
+ (error "%s: %s"
+ (if (stringp gshell)
+ gshell
+ "shell")
+ (buffer-substring (point) (viper-line-pos 'end)))
+ ))
(goto-char (point-min))
(viper-get-filenames-from-buffer 'one-per-line))
))
@@ -662,14 +662,8 @@
;; define remote file test
-(or (fboundp 'viper-file-remote-p) ; user supplied his own function: use it
- (defun viper-file-remote-p (file-name)
- (car (cond ((featurep 'efs-auto) (efs-ftp-path file-name))
- ((fboundp 'file-remote-p) (file-remote-p file-name))
- (t (require 'ange-ftp)
- ;; Can happen only in Emacs, since XEmacs has file-remote-p
- (ange-ftp-ftp-name file-name))))))
-
+(defun viper-file-remote-p (file-name)
+ (file-remote-p file-name))
;; This is a simple-minded check for whether a file is under version control.
1.7 +25 -18 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.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- viper-macs.el 2003/05/18 17:57:25 1.6
+++ viper-macs.el 2005/02/19 19:30:04 1.7
@@ -329,6 +329,8 @@
;; Accepts as macro names: strings and vectors.
;; strings must be strings of characters; vectors must be vectors of keys
;; in canonic form. The canonic form is essentially the form used in XEmacs
+;; More general definitions are inherited by more specific scopes:
+;; global->major mode->buffer. More specific definitions override more general
(defun viper-record-kbd-macro (macro-name state macro-body &optional scope)
"Record a Vi macro. Can be used in `.viper' file to define permanent
macros.
MACRO-NAME is a string of characters or a vector of keys. STATE is
@@ -451,22 +453,22 @@
(list (list (cons scope nil)) nil (cons t nil))))))
(setq old-elt (assoc macro-name (eval macro-alist-var)))
- (if (null old-elt)
- (progn
- ;; insert new-elt in macro-alist-var and keep the list sorted
- (define-key
- keymap
- (vector (viper-key-to-emacs-key (aref macro-name 0)))
- 'viper-exec-mapped-kbd-macro)
- (setq lis (eval macro-alist-var))
- (while (and lis (string< (viper-array-to-string (car (car lis)))
- (viper-array-to-string macro-name)))
- (setq lis2 (cons (car lis) lis2))
- (setq lis (cdr lis)))
-
- (setq lis2 (reverse lis2))
- (set macro-alist-var (append lis2 (cons new-elt lis)))
- (setq old-elt new-elt)))
+ (if (null old-elt)
+ (progn
+ ;; insert new-elt in macro-alist-var and keep the list sorted
+ (define-key
+ keymap
+ (vector (viper-key-to-emacs-key (aref macro-name 0)))
+ 'viper-exec-mapped-kbd-macro)
+ (setq lis (eval macro-alist-var))
+ (while (and lis (string< (viper-array-to-string (car (car lis)))
+ (viper-array-to-string macro-name)))
+ (setq lis2 (cons (car lis) lis2))
+ (setq lis (cdr lis)))
+
+ (setq lis2 (reverse lis2))
+ (set macro-alist-var (append lis2 (cons new-elt lis)))
+ (setq old-elt new-elt)))
(setq old-sub-elt
(cond ((eq scope t) (viper-kbd-global-pair old-elt))
((symbolp scope) (assoc scope (viper-kbd-mode-alist old-elt)))
@@ -484,6 +486,11 @@
;; macro name must be a vector of viper-style keys
+;; viper-unrecord-kbd-macro doesn't have scope. Macro definitions are inherited
+;; from global -> major mode -> buffer
+;; More specific definition overrides more general
+;; Can't unrecord definition for more specific, if a more general definition is
+;; in effect
(defun viper-unrecord-kbd-macro (macro-name state)
"Delete macro MACRO-NAME from Viper STATE.
MACRO-NAME must be a vector of viper-style keys. This command is used by Viper
@@ -546,7 +553,7 @@
(setq macro-pair mode-mapping)
(message "%S is unmapped for %s in %S"
(viper-display-macro macro-name) state-name major-mode))
- ((cdr (setq macro-pair (viper-kbd-global-pair macro-entry)))
+ ((cdr (setq macro-pair global-mapping))
(message
"Global mapping for %S in %s is removed"
(viper-display-macro macro-name) state-name))
@@ -560,7 +567,7 @@
(progn
(set macro-alist-var (delq macro-entry (eval macro-alist-var)))
(if (viper-can-release-key (aref macro-name 0)
- (eval macro-alist-var))
+ (eval macro-alist-var))
(define-key
keymap
(vector (viper-key-to-emacs-key (aref macro-name 0)))
1.9 +4 -0 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.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- viper-keym.el 2003/05/18 17:57:25 1.8
+++ viper-keym.el 2005/02/19 19:30:04 1.9
@@ -455,6 +455,10 @@
(define-key viper-dired-modifier-map ":" 'viper-ex)
(define-key viper-dired-modifier-map "/" 'viper-search-forward)
+(defvar viper-gnus-modifier-map (make-sparse-keymap)
+ "This map modifies Gnus behavior.")
+(define-key viper-gnus-modifier-map ":" 'viper-ex)
+
;;; Code
1.15 +11 -0 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.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- viper-init.el 2003/05/18 17:57:25 1.14
+++ viper-init.el 2005/02/19 19:30:04 1.15
@@ -70,6 +70,16 @@
window-system
))
+(defun viper-color-display-p ()
+ (condition-case nil
+ (viper-cond-compile-for-xemacs-or-emacs
+ (eq (device-class (selected-device)) 'color) ; xemacs form
+ (if (fboundp 'display-color-p) ; emacs form
+ (display-color-p)
+ (x-display-color-p))
+ )
+ (error nil)))
+
;; in XEmacs: device-type is tty on tty and stream in batch.
(defun viper-window-display-p ()
(and (viper-device-type) (not (memq (viper-device-type) '(tty stream pc)))))
@@ -97,6 +107,7 @@
(defun viper-has-face-support-p ()
(cond ((viper-window-display-p))
(viper-force-faces)
+ ((viper-color-display-p))
(viper-emacs-p (memq (viper-device-type) '(pc)))
(viper-xemacs-p (memq (viper-device-type) '(tty pc)))))
1.20 +2 -2 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.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- viper-ex.el 2003/05/18 17:57:25 1.19
+++ viper-ex.el 2005/02/19 19:30:05 1.20
@@ -1,6 +1,6 @@
;;; viper-ex.el --- functions implementing the Ex commands for Viper
-;; Copyright (C) 1994, 95, 96, 97, 98, 2000, 01, 02 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 95, 96, 97, 98, 2000, 01, 02, 04, 05 Free Software Foundation,
Inc.
;; Author: Michael Kifer <kifer(a)cs.stonybrook.edu>
@@ -1458,7 +1458,7 @@
(if (eq 1 (length name))
(setq char (string-to-char name))
(error "`%s': Spurious text \"%s\" after mark name"
- name (substring name 1) viper-SpuriousText))
+ name (substring name 1)))
(save-window-excursion
(setq viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name))
(set-buffer viper-ex-work-buf)
1.25 +49 -29 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.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- viper-cmd.el 2003/05/18 17:57:25 1.24
+++ viper-cmd.el 2005/02/19 19:30:05 1.25
@@ -1063,7 +1063,7 @@
;; call the actual function to execute ESC (if no other symbols followed)
;; or the key bound to the ESC sequence (if the sequence was issued
- ;; with very short delay between characters.
+ ;; with very short delay between characters).
(if (eq cmd 'viper-intercept-ESC-key)
(setq cmd
(cond ((eq viper-current-state 'vi-state)
@@ -1529,7 +1529,8 @@
nil)
(defun viper-exec-buffer-search (m-com com)
- (setq viper-s-string (buffer-substring (point) viper-com-point))
+ (setq viper-s-string
+ (regexp-quote (buffer-substring (point) viper-com-point)))
(setq viper-s-forward t)
(setq viper-search-history (cons viper-s-string viper-search-history))
(setq viper-intermediate-command 'viper-exec-buffer-search)
@@ -1982,6 +1983,16 @@
(let ((hook (if viper-vi-style-in-minibuffer
'viper-change-state-to-insert
'viper-change-state-to-emacs)))
+ ;; making buffer-local variables so that normal buffers won't affect the
+ ;; minibuffer and vice versa. Otherwise, command arguments will affect
+ ;; minibuffer ops and insertions from the minibuffer will change those in
+ ;; the normal buffers
+ (make-local-variable 'viper-d-com)
+ (make-local-variable 'viper-last-insertion)
+ (make-local-variable 'viper-command-ring)
+ (setq viper-d-com nil
+ viper-last-insertion nil
+ viper-command-ring nil)
(funcall hook)
))
@@ -2707,7 +2718,7 @@
(viper-backward-char-carefully)
(if (looking-at "\n")
(viper-skip-all-separators-backward 'within-line)
- (or (bobp) (forward-char)))))
+ (or (viper-looking-at-separator) (forward-char)))))
(defun viper-forward-word-kernel (val)
@@ -3630,33 +3641,39 @@
(setq msg "Search style remains unchanged")))
(princ msg t)))
-(defun viper-set-searchstyle-toggling-macros (unset)
+(defun viper-set-searchstyle-toggling-macros (unset &optional major-mode)
"Set the macros for toggling the search style in Viper's vi-state.
The macro that toggles case sensitivity is bound to `//', and the one that
toggles regexp search is bound to `///'.
-With a prefix argument, this function unsets the macros. "
+With a prefix argument, this function unsets the macros.
+If MAJOR-MODE is set, set the macros only in that major mode."
(interactive "P")
- (or noninteractive
- (if (not unset)
- (progn
- ;; toggle case sensitivity in search
- (viper-record-kbd-macro
- "//" 'vi-state
- [1 (meta x) v i p e r - t o g g l e - s e a r c h - s t y l e return]
- 't)
- ;; toggle regexp/vanila search
- (viper-record-kbd-macro
- "///" 'vi-state
- [2 (meta x) v i p e r - t o g g l e - s e a r c h - s t y l e return]
- 't)
- (if (interactive-p)
- (message
- "// and /// now toggle case-sensitivity and regexp search")))
- (viper-unrecord-kbd-macro "//" 'vi-state)
- (sit-for 2)
- (viper-unrecord-kbd-macro "///" 'vi-state))))
-
-
+ (let (scope)
+ (if (and major-mode (symbolp major-mode))
+ (setq scope major-mode)
+ (setq scope 't))
+ (or noninteractive
+ (if (not unset)
+ (progn
+ ;; toggle case sensitivity in search
+ (viper-record-kbd-macro
+ "//" 'vi-state
+ [1 (meta x) v i p e r - t o g g l e - s e a r c h - s t y l e return]
+ scope)
+ ;; toggle regexp/vanila search
+ (viper-record-kbd-macro
+ "///" 'vi-state
+ [2 (meta x) v i p e r - t o g g l e - s e a r c h - s t y l e return]
+ scope)
+ (if (interactive-p)
+ (message
+ "// and /// now toggle case-sensitivity and regexp search")))
+ (viper-unrecord-kbd-macro "//" 'vi-state)
+ (sit-for 2)
+ (viper-unrecord-kbd-macro "///" 'vi-state)))
+ ))
+
+
(defun viper-set-parsing-style-toggling-macro (unset)
"Set `%%%' to be a macro that toggles whether comment fields should be
parsed for matching parentheses.
This is used in conjunction with the `%' command.
@@ -4112,7 +4129,8 @@
(interactive)
(if (and viper-ex-style-editing (bolp))
(beep 1)
- (delete-backward-char 1 t)))
+ ;; don't put on kill ring
+ (delete-backward-char 1 nil)))
(defun viper-del-backward-char-in-replace ()
@@ -4124,13 +4142,15 @@
(interactive)
(cond (viper-delete-backwards-in-replace
(cond ((not (bolp))
- (delete-backward-char 1 t))
+ ;; don't put on kill ring
+ (delete-backward-char 1 nil))
(viper-ex-style-editing
(beep 1))
((bobp)
(beep 1))
(t
- (delete-backward-char 1 t))))
+ ;; don't put on kill ring
+ (delete-backward-char 1 nil))))
(viper-ex-style-editing
(if (bolp)
(beep 1)
1.51 +26 -1 XEmacs/packages/xemacs-packages/viper/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/viper/ChangeLog,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- ChangeLog 2003/10/31 17:14:39 1.50
+++ ChangeLog 2005/02/19 19:30:05 1.51
@@ -1,3 +1,28 @@
+2005-02-19 Michael Kifer <kifer(a)cs.stonybrook.edu>
+
+ * viper-cmd.el (viper-prefix-commands): make into a defconst.
+ (viper-exec-buffer-search): use regexp-quote to quote the buffer
+ string.
+ (viper-minibuffer-setup-sentinel): make some variables buffer-local.
+ (viper-skip-separators): bug fix.
+ (viper-set-searchstyle-toggling-macros): allow to unset macros in a
+ particular major mode.
+ (viper-del-backward-char-in-replace): don't put deleted char on the
+ kill ring.
+
+ * viper-ex.el (viper-color-display-p): new function.
+ (viper-has-face-support-p): use viper-color-display-p.
+
+ * viper-keym.el (viper-gnus-modifier-map): new keymap.
+
+ * viper-macs.el (viper-unrecord-kbd-macro): bug fix.
+
+ * viper-util.el (viper-glob-unix-files): fix shell status check.
+ (viper-file-remote-p): make equivalent to file-remote-p.
+
+ * viper.el (viper-major-mode-modifier-list): use
+ viper-gnus-modifier-map.
+
2003-10-31 Norbert Koch <viteno(a)xemacs.org>
* Makefile (VERSION): XEmacs package 1.37 released.
@@ -6,7 +31,7 @@
* Makefile (VERSION): XEmacs package 1.36 released.
-2002-05-18 Michael Kifer <kifer(a)cs.stonybrook.edu>
+2003-05-18 Michael Kifer <kifer(a)cs.stonybrook.edu>
* all files: eliminated trailing spaces from lines.