CVS update by michaelk packages/xemacs-packages/viper, viper-mous.el,
viper-init.el ...
xemacs-cvs at xemacs.org
xemacs-cvs at xemacs.org
Wed Jan 9 01:27:32 EST 2008
User: michaelk
Date: 08/01/09 07:27:32
Modified: packages/xemacs-packages/viper 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*.el: many minor changes from the emacs tree.
* viper-ex.el (viper-info-on-file): take care of indiret buffers.
* viper.el (viper-set-hooks, set-cursor-color): set viper-vi-state-cursor-color.
Revision Changes Path
1.47 +20 -30 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.46
retrieving revision 1.47
diff -u -p -r1.46 -r1.47
--- viper.el 2007/11/02 06:16:32 1.46
+++ viper.el 2008/01/09 06:27:29 1.47
@@ -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, 2006, 2007 Free Software Foundation, Inc.
+;; 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
;; Author: Michael Kifer <kifer at cs.stonybrook.edu>
;; Keywords: emulations
-(defconst viper-version "3.14 of August 18, 2007"
+(defconst viper-version "3.14 of January 09, 2008"
"The current version of Viper")
;; This file is part of GNU Emacs.
@@ -297,28 +297,15 @@
;;; Code:
-(require 'advice)
-(require 'ring)
-
;; compiler pacifier
(defvar mark-even-if-inactive)
(defvar quail-mode)
(defvar viper-expert-level)
(defvar viper-mode-string)
(defvar viper-major-mode-modifier-list)
-
-;; loading happens only in non-interactive compilation
-;; in order to spare non-viperized emacs from being viperized
-(if noninteractive
- (eval-when-compile
- (let ((load-path (cons (expand-file-name ".") load-path)))
- (or (featurep 'viper-init)
- (load "viper-init.el" nil nil 'nosuffix))
- (or (featurep 'viper-cmd)
- (load "viper-cmd.el" nil nil 'nosuffix))
- )))
;; end pacifier
+(require 'advice)
(require 'viper-init)
(require 'viper-keym)
@@ -690,7 +677,7 @@ It also can't undo some Viper settings."
(setq default-major-mode
(viper-standard-value 'default-major-mode viper-saved-non-viper-variables))
- (if viper-emacs-p
+ (if (featurep 'emacs)
(setq-default
mark-even-if-inactive
(viper-standard-value
@@ -701,7 +688,7 @@ It also can't undo some Viper settings."
(and (fboundp 'add-to-ordered-list) (boundp 'emulation-mode-map-alists))
(viper-delocalize-var 'minor-mode-map-alist))
(viper-delocalize-var 'require-final-newline)
- (if viper-xemacs-p (viper-delocalize-var 'bar-cursor))
+ (if (featurep 'xemacs) (viper-delocalize-var 'bar-cursor))
;; deactivate all advices done by Viper.
@@ -788,7 +775,7 @@ It also can't undo some Viper settings."
;; In emacs, we have to advice handle-switch-frame
;; This advice is undone earlier, when all advices matchine "viper-" are
;; deactivated.
- (if viper-xemacs-p
+ (if (featurep 'xemacs)
(remove-hook 'mouse-leave-frame-hook 'viper-remember-current-frame))
) ; end viper-go-away
@@ -870,7 +857,9 @@ It also can't undo some Viper settings."
(modify-frame-parameters
(selected-frame)
(list (cons 'viper-vi-state-cursor-color
- (viper-get-cursor-color))))))
+ (viper-get-cursor-color))))
+ (setq viper-vi-state-cursor-color (viper-get-cursor-color))
+ ))
;; Tell vc-diff to put *vc* in Vi mode
(if (featurep 'vc)
@@ -913,6 +902,7 @@ It also can't undo some Viper settings."
(modify-frame-parameters
(selected-frame)
(list (cons 'viper-vi-state-cursor-color (ad-get-arg 0))))
+ (setq viper-vi-state-cursor-color (ad-get-arg 0))
)
(when (and (fboundp 'add-to-ordered-list) (boundp 'emulation-mode-map-alists))
@@ -981,7 +971,7 @@ It also can't undo some Viper settings."
)))
;; International input methods
- (if viper-emacs-p
+ (if (featurep 'emacs)
(eval-after-load "mule-cmds"
'(progn
(defadvice inactivate-input-method (after viper-mule-advice activate)
@@ -1022,7 +1012,7 @@ It also can't undo some Viper settings."
require-final-newline t)
;; don't bark when mark is inactive
- (if viper-emacs-p
+ (if (featurep 'emacs)
(setq mark-even-if-inactive t))
(setq scroll-step 1)
@@ -1094,12 +1084,12 @@ It also can't undo some Viper settings."
"Use `read-file-name' for reading arguments."
(interactive (cons (read-file-name "Find file: " nil default-directory)
;; XEmacs: if Mule & prefix arg, ask for coding system
- (cond ((and viper-xemacs-p (featurep 'mule))
+ (cond ((and (featurep 'xemacs) (featurep 'mule))
(list
(and current-prefix-arg
(read-coding-system "Coding-system: "))))
;; Emacs: do wildcards
- ((and viper-emacs-p (boundp 'find-file-wildcards))
+ ((and (featurep 'emacs) (boundp 'find-file-wildcards))
(list find-file-wildcards))))
))
@@ -1108,12 +1098,12 @@ It also can't undo some Viper settings."
(interactive (cons (read-file-name "Find file in other window: "
nil default-directory)
;; XEmacs: if Mule & prefix arg, ask for coding system
- (cond ((and viper-xemacs-p (featurep 'mule))
+ (cond ((and (featurep 'xemacs) (featurep 'mule))
(list
(and current-prefix-arg
(read-coding-system "Coding-system: "))))
;; Emacs: do wildcards
- ((and viper-emacs-p (boundp 'find-file-wildcards))
+ ((and (featurep 'emacs) (boundp 'find-file-wildcards))
(list find-file-wildcards))))
))
@@ -1123,12 +1113,12 @@ It also can't undo some Viper settings."
(interactive (cons (read-file-name "Find file in other frame: "
nil default-directory)
;; XEmacs: if Mule & prefix arg, ask for coding system
- (cond ((and viper-xemacs-p (featurep 'mule))
+ (cond ((and (featurep 'xemacs) (featurep 'mule))
(list
(and current-prefix-arg
(read-coding-system "Coding-system: "))))
;; Emacs: do wildcards
- ((and viper-emacs-p (boundp 'find-file-wildcards))
+ ((and (featurep 'emacs) (boundp 'find-file-wildcards))
(list find-file-wildcards))))
))
@@ -1159,7 +1149,7 @@ It also can't undo some Viper settings."
;; catch frame switching event
(if (viper-window-display-p)
- (if viper-xemacs-p
+ (if (featurep 'xemacs)
(add-hook 'mouse-leave-frame-hook
'viper-remember-current-frame)
(defadvice handle-switch-frame (before viper-frame-advice activate)
@@ -1227,7 +1217,7 @@ These two lines must come in the order g
(cons 'mode-line-buffer-identification
(list (default-value 'mode-line-buffer-identification)))
(cons 'global-mode-string (list global-mode-string))
- (if viper-emacs-p
+ (if (featurep 'emacs)
(cons 'mark-even-if-inactive (list mark-even-if-inactive)))
)))
1.31 +62 -77 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.30
retrieving revision 1.31
diff -u -p -r1.30 -r1.31
--- viper-util.el 2007/11/02 06:16:32 1.30
+++ viper-util.el 2008/01/09 06:27:29 1.31
@@ -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, 2006, 2007 Free Software Foundation, Inc.
+;; 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
;; Author: Michael Kifer <kifer at cs.stonybrook.edu>
@@ -44,12 +44,6 @@
(require 'ring)
-(if noninteractive
- (eval-when-compile
- (let ((load-path (cons (expand-file-name ".") load-path)))
- (or (featurep 'viper-init)
- (load "viper-init.el" nil nil 'nosuffix))
- )))
;; end pacifier
(require 'viper-init)
@@ -64,50 +58,36 @@
(fset 'x-color-defined-p (symbol-function 'ns-color-defined-p)))
-;;; XEmacs support
-
-
-(viper-cond-compile-for-xemacs-or-emacs
- (progn ; xemacs
- (fset 'viper-overlay-p (symbol-function 'extentp))
- (fset 'viper-make-overlay (symbol-function 'make-extent))
- (fset 'viper-overlay-live-p (symbol-function 'extent-live-p))
- (fset 'viper-move-overlay (symbol-function 'set-extent-endpoints))
- (fset 'viper-overlay-start (symbol-function 'extent-start-position))
- (fset 'viper-overlay-end (symbol-function 'extent-end-position))
- (fset 'viper-overlay-get (symbol-function 'extent-property))
- (fset 'viper-overlay-put (symbol-function 'set-extent-property))
- (fset 'viper-read-event (symbol-function 'next-command-event))
- (fset 'viper-characterp (symbol-function 'characterp))
- (fset 'viper-int-to-char (symbol-function 'int-to-char))
- (if (viper-window-display-p)
- (fset 'viper-iconify (symbol-function 'iconify-frame)))
- (cond ((viper-has-face-support-p)
- (fset 'viper-get-face (symbol-function 'get-face))
- (fset 'viper-color-defined-p (symbol-function 'valid-color-name-p))
- )))
- (progn ; emacs
- (fset 'viper-overlay-p (symbol-function 'overlayp))
- (fset 'viper-make-overlay (symbol-function 'make-overlay))
- (fset 'viper-overlay-live-p (symbol-function 'overlayp))
- (fset 'viper-move-overlay (symbol-function 'move-overlay))
- (fset 'viper-overlay-start (symbol-function 'overlay-start))
- (fset 'viper-overlay-end (symbol-function 'overlay-end))
- (fset 'viper-overlay-get (symbol-function 'overlay-get))
- (fset 'viper-overlay-put (symbol-function 'overlay-put))
- (fset 'viper-read-event (symbol-function 'read-event))
- (fset 'viper-characterp (symbol-function 'integerp))
- (fset 'viper-int-to-char (symbol-function 'identity))
- (if (viper-window-display-p)
- (fset 'viper-iconify (symbol-function 'iconify-or-deiconify-frame)))
- (cond ((viper-has-face-support-p)
- (fset 'viper-get-face (symbol-function 'internal-get-face))
- (fset 'viper-color-defined-p (symbol-function 'x-color-defined-p))
- )))
- )
+(defalias 'viper-overlay-p
+ (if (featurep 'xemacs) 'extentp 'overlayp))
+(defalias 'viper-make-overlay
+ (if (featurep 'xemacs) 'make-extent 'make-overlay))
+(defalias 'viper-overlay-live-p
+ (if (featurep 'xemacs) 'extent-live-p 'overlayp))
+(defalias 'viper-move-overlay
+ (if (featurep 'xemacs) 'set-extent-endpoints 'move-overlay))
+(defalias 'viper-overlay-start
+ (if (featurep 'xemacs) 'extent-start-position 'overlay-start))
+(defalias 'viper-overlay-end
+ (if (featurep 'xemacs) 'extent-end-position 'overlay-end))
+(defalias 'viper-overlay-get
+ (if (featurep 'xemacs) 'extent-property 'overlay-get))
+(defalias 'viper-overlay-put
+ (if (featurep 'xemacs) 'set-extent-property 'overlay-put))
+(defalias 'viper-read-event
+ (if (featurep 'xemacs) 'next-command-event 'read-event))
+(defalias 'viper-characterp
+ (if (featurep 'xemacs) 'characterp 'integerp))
+(defalias 'viper-int-to-char
+ (if (featurep 'xemacs) 'int-to-char 'identity))
+(defalias 'viper-get-face
+ (if (featurep 'xemacs) 'get-face 'internal-get-face))
+(defalias 'viper-color-defined-p
+ (if (featurep 'xemacs) 'valid-color-name-p 'x-color-defined-p))
+(defalias 'viper-iconify
+ (if (featurep 'xemacs) 'iconify-frame 'iconify-or-deiconify-frame))
-
;; CHAR is supposed to be a char or an integer (positive or negative)
;; LIST is a list of chars, nil, and negative numbers
;; Check if CHAR is a member by trying to convert in characters, if necessary.
@@ -201,7 +181,7 @@
(defsubst viper-get-saved-cursor-color-in-replace-mode ()
(or
(funcall
- (if viper-emacs-p 'frame-parameter 'frame-property)
+ (if (featurep 'emacs) 'frame-parameter 'frame-property)
(selected-frame)
'viper-saved-cursor-color-in-replace-mode)
(if (and (eq viper-current-state 'emacs-mode) viper-emacs-state-cursor-color)
@@ -211,7 +191,7 @@
(defsubst viper-get-saved-cursor-color-in-insert-mode ()
(or
(funcall
- (if viper-emacs-p 'frame-parameter 'frame-property)
+ (if (featurep 'emacs) 'frame-parameter 'frame-property)
(selected-frame)
'viper-saved-cursor-color-in-insert-mode)
(if (and (eq viper-current-state 'emacs-mode) viper-emacs-state-cursor-color)
@@ -221,7 +201,7 @@
(defsubst viper-get-saved-cursor-color-in-emacs-mode ()
(or
(funcall
- (if viper-emacs-p 'frame-parameter 'frame-property)
+ (if (featurep 'emacs) 'frame-parameter 'frame-property)
(selected-frame)
'viper-saved-cursor-color-in-emacs-mode)
viper-vi-state-cursor-color))
@@ -249,8 +229,8 @@
;; testing for sufficiently high Emacs versions.
(defun viper-check-version (op major minor &optional type-of-emacs)
(if (and (boundp 'emacs-major-version) (boundp 'emacs-minor-version))
- (and (cond ((eq type-of-emacs 'xemacs) viper-xemacs-p)
- ((eq type-of-emacs 'emacs) viper-emacs-p)
+ (and (cond ((eq type-of-emacs 'xemacs) (featurep 'xemacs))
+ ((eq type-of-emacs 'emacs) (featurep 'emacs))
(t t))
(cond ((eq op '=) (and (= emacs-minor-version minor)
(= emacs-major-version major)))
@@ -267,7 +247,7 @@
(defun viper-get-visible-buffer-window (wind)
- (if viper-xemacs-p
+ (if (featurep 'xemacs)
(get-buffer-window wind t)
(get-buffer-window wind 'visible)))
@@ -394,6 +374,9 @@
+;; declare-function is not defined in XEmacs
+;;(declare-function viper-forward-Word "viper-cmd" (arg))
+
;;; Support for :e, :r, :w file globbing
;; Glob the file spec.
@@ -654,7 +637,7 @@
(regexp (format "^[^;]*%s[ \t\n]*[a-zA-Z---_']*[ \t\n)]" var-name))
(buf (find-file-noselect (substitute-in-file-name custom-file)))
)
- (message message)
+ (message "%s" (or message ""))
(save-excursion
(set-buffer buf)
(goto-char (point-min))
@@ -724,13 +707,14 @@
(defsubst viper-file-checked-in-p (file)
(and (featurep 'vc-hooks)
;; CVS files are considered not checked in
+ ;; FIXME: Should this deal with more than CVS?
(not (memq (vc-backend file) '(nil CVS)))
(if (fboundp 'vc-state)
(and
(not (memq (vc-state file) '(edited needs-merge)))
(not (stringp (vc-state file))))
;; XEmacs has no vc-state
- (not (vc-locking-user file)))
+ (if (featurep 'xemacs) (not (vc-locking-user file))))
))
;; checkout if visited file is checked in
@@ -787,7 +771,7 @@
(setq viper-replace-overlay (viper-make-overlay beg end (current-buffer)))
;; never detach
(viper-overlay-put
- viper-replace-overlay (if viper-emacs-p 'evaporate 'detachable) nil)
+ viper-replace-overlay (if (featurep 'emacs) 'evaporate 'detachable) nil)
(viper-overlay-put
viper-replace-overlay 'priority viper-replace-overlay-priority)
;; If Emacs will start supporting overlay maps, as it currently supports
@@ -795,7 +779,7 @@
;; just have keymap attached to replace overlay.
;;(viper-overlay-put
;; viper-replace-overlay
- ;; (if viper-xemacs-p 'keymap 'local-map)
+ ;; (if (featurep 'xemacs) 'keymap 'local-map)
;; viper-replace-map)
)
(if (viper-has-face-support-p)
@@ -811,8 +795,8 @@
(viper-set-replace-overlay (point-min) (point-min)))
(if (or (not (viper-has-face-support-p))
viper-use-replace-region-delimiters)
- (let ((before-name (if viper-xemacs-p 'begin-glyph 'before-string))
- (after-name (if viper-xemacs-p 'end-glyph 'after-string)))
+ (let ((before-name (if (featurep 'xemacs) 'begin-glyph 'before-string))
+ (after-name (if (featurep 'xemacs) 'end-glyph 'after-string)))
(viper-overlay-put viper-replace-overlay before-name before-glyph)
(viper-overlay-put viper-replace-overlay after-name after-glyph))))
@@ -843,11 +827,11 @@
;; never detach
(viper-overlay-put
viper-minibuffer-overlay
- (if viper-emacs-p 'evaporate 'detachable)
+ (if (featurep 'emacs) 'evaporate 'detachable)
nil)
;; make viper-minibuffer-overlay open-ended
;; In emacs, it is made open ended at creation time
- (if viper-xemacs-p
+ (if (featurep 'xemacs)
(progn
(viper-overlay-put viper-minibuffer-overlay 'start-open nil)
(viper-overlay-put viper-minibuffer-overlay 'end-open nil)))
@@ -860,7 +844,7 @@
(if (fboundp 'minibuffer-prompt-end) (minibuffer-prompt-end) 1)
(1+ (buffer-size)))
(setq viper-minibuffer-overlay
- (if viper-xemacs-p
+ (if (featurep 'xemacs)
(viper-make-overlay 1 (1+ (buffer-size)) (current-buffer))
;; make overlay open-ended
(viper-make-overlay
@@ -983,7 +967,7 @@
(defun viper-read-key-sequence (prompt &optional continue-echo)
(let (inhibit-quit event keyseq)
(setq keyseq (read-key-sequence prompt continue-echo))
- (setq event (if viper-xemacs-p
+ (setq event (if (featurep 'xemacs)
(elt keyseq 0) ; XEmacs returns vector of events
(elt (listify-key-sequence keyseq) 0)))
(if (viper-ESC-event-p event)
@@ -1078,7 +1062,7 @@
(defun viper-key-to-emacs-key (key)
(let (key-name char-p modifiers mod-char-list base-key base-key-name)
- (cond (viper-xemacs-p key)
+ (cond ((featurep 'xemacs) key)
((symbolp key)
(setq key-name (symbol-name key))
@@ -1086,10 +1070,10 @@
(string-to-char key-name))
;; Emacs doesn't recognize `return' and `escape' as events on
;; dumb terminals, so we translate them into characters
- ((and viper-emacs-p (not (viper-window-display-p))
+ ((and (featurep 'emacs) (not (viper-window-display-p))
(string= key-name "return"))
?\C-m)
- ((and viper-emacs-p (not (viper-window-display-p))
+ ((and (featurep 'emacs) (not (viper-window-display-p))
(string= key-name "escape"))
?\e)
;; pass symbol-event as is
@@ -1123,14 +1107,15 @@
;; LIS is assumed to be a list of events of characters
(defun viper-eventify-list-xemacs (lis)
- (mapcar
- (lambda (elt)
- (cond ((viper-characterp elt) (character-to-event elt))
- ((eventp elt) elt)
- (t (error
- "viper-eventify-list-xemacs: can't convert to event, %S"
- elt))))
- lis))
+ (if (featurep 'xemacs)
+ (mapcar
+ (lambda (elt)
+ (cond ((viper-characterp elt) (character-to-event elt))
+ ((eventp elt) elt)
+ (t (error
+ "viper-eventify-list-xemacs: can't convert to event, %S"
+ elt))))
+ lis)))
;; Smoothes out the difference between Emacs' unread-command-events
@@ -1142,7 +1127,7 @@
;; into an event. Below, we delete nil from event lists, since nil is the most
;; common symbol that might appear in this wrong context.
(defun viper-set-unread-command-events (arg)
- (if viper-emacs-p
+ (if (featurep 'emacs)
(setq
unread-command-events
(let ((new-events
1.13 +16 -18 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.12
retrieving revision 1.13
diff -u -p -r1.12 -r1.13
--- viper-mous.el 2007/11/02 06:16:32 1.12
+++ viper-mous.el 2008/01/09 06:27:30 1.13
@@ -1,7 +1,7 @@
;;; viper-mous.el --- mouse support for Viper
;; Copyright (C) 1994, 1995, 1996, 1997, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007 Free Software Foundation, Inc.
+;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
;; Author: Michael Kifer <kifer at cs.stonybrook.edu>
@@ -42,10 +42,8 @@
(if noninteractive
(eval-when-compile
(let ((load-path (cons (expand-file-name ".") load-path)))
- (or (featurep 'viper-util)
- (load "viper-util.el" nil nil 'nosuffix))
(or (featurep 'viper-cmd)
- (load "viper-cmd.el" nil nil 'nosuffix))
+ (load "viper-cmd.el" nil t 'nosuffix))
)))
;; end pacifier
@@ -79,7 +77,7 @@ or a tripple-click."
;; time interval in millisecond within which successive clicks are
;; considered related
(defcustom viper-multiclick-timeout (if (viper-window-display-p)
- (if viper-xemacs-p
+ (if (featurep 'xemacs)
mouse-track-multi-click-time
double-click-time)
500)
@@ -227,7 +225,7 @@ is ignored."
) ; if
;; XEmacs doesn't have set-text-properties, but there buffer-substring
;; doesn't return properties together with the string, so it's not needed.
- (if viper-emacs-p
+ (if (featurep 'emacs)
(set-text-properties 0 (length result) nil result))
result
))
@@ -273,7 +271,7 @@ See `viper-surrounding-word' for the def
'viper-mouse-catch-frame-switch))
(not (eq (key-binding viper-mouse-up-insert-key-parsed)
'viper-mouse-click-insert-word))
- (and viper-xemacs-p (not (event-over-text-area-p click)))))
+ (and (featurep 'xemacs) (not (event-over-text-area-p click)))))
() ; do nothing, if binding isn't right or not over text
;; turn arg into a number
(cond ((integerp arg) nil)
@@ -364,7 +362,7 @@ this command."
'viper-mouse-catch-frame-switch))
(not (eq (key-binding viper-mouse-up-search-key-parsed)
'viper-mouse-click-search-word))
- (and viper-xemacs-p (not (event-over-text-area-p click)))))
+ (and (featurep 'xemacs) (not (event-over-text-area-p click)))))
() ; do nothing, if binding isn't right or not over text
(let ((previous-search-string viper-s-string)
click-word click-count)
@@ -507,19 +505,19 @@ bindings in the Viper manual."
()
(setq button-spec
(cond ((memq 1 key)
- (if viper-emacs-p
+ (if (featurep 'emacs)
(if (eq 'up event-type)
"mouse-1" "down-mouse-1")
(if (eq 'up event-type)
'button1up 'button1)))
((memq 2 key)
- (if viper-emacs-p
+ (if (featurep 'emacs)
(if (eq 'up event-type)
"mouse-2" "down-mouse-2")
(if (eq 'up event-type)
'button2up 'button2)))
((memq 3 key)
- (if viper-emacs-p
+ (if (featurep 'emacs)
(if (eq 'up event-type)
"mouse-3" "down-mouse-3")
(if (eq 'up event-type)
@@ -528,18 +526,18 @@ bindings in the Viper manual."
"%S: invalid button number, %S" key-var key)))
meta-spec
(if (memq 'meta key)
- (if viper-emacs-p "M-" 'meta)
- (if viper-emacs-p "" nil))
+ (if (featurep 'emacs) "M-" 'meta)
+ (if (featurep 'emacs) "" nil))
shift-spec
(if (memq 'shift key)
- (if viper-emacs-p "S-" 'shift)
- (if viper-emacs-p "" nil))
+ (if (featurep 'emacs) "S-" 'shift)
+ (if (featurep 'emacs) "" nil))
control-spec
(if (memq 'control key)
- (if viper-emacs-p "C-" 'control)
- (if viper-emacs-p "" nil)))
+ (if (featurep 'emacs) "C-" 'control)
+ (if (featurep 'emacs) "" nil)))
- (setq key-spec (if viper-emacs-p
+ (setq key-spec (if (featurep 'emacs)
(vector
(intern
(concat
1.15 +3 -9 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.14
retrieving revision 1.15
diff -u -p -r1.14 -r1.15
--- viper-macs.el 2007/11/02 06:16:33 1.14
+++ viper-macs.el 2008/01/09 06:27:30 1.15
@@ -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, 2006, 2007 Free Software Foundation, Inc.
+;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
;; Author: Michael Kifer <kifer at cs.stonybrook.edu>
@@ -39,14 +39,8 @@
(if noninteractive
(eval-when-compile
(let ((load-path (cons (expand-file-name ".") load-path)))
- (or (featurep 'viper-util)
- (load "viper-util.el" nil nil 'nosuffix))
- (or (featurep 'viper-keym)
- (load "viper-keym.el" nil nil 'nosuffix))
- (or (featurep 'viper-mous)
- (load "viper-mous.el" nil nil 'nosuffix))
(or (featurep 'viper-cmd)
- (load "viper-cmd.el" nil nil 'nosuffix))
+ (load "viper-cmd.el" nil t 'nosuffix))
)))
;; end pacifier
@@ -826,7 +820,7 @@ name from there."
(defun viper-char-array-to-macro (array)
(let ((vec (vconcat array))
macro)
- (if viper-xemacs-p
+ (if (featurep 'xemacs)
(setq macro (mapcar 'character-to-event vec))
(setq macro vec))
(vconcat (mapcar 'viper-event-key macro))))
1.19 +8 -12 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.18
retrieving revision 1.19
diff -u -p -r1.18 -r1.19
--- viper-keym.el 2007/11/02 06:16:33 1.18
+++ viper-keym.el 2008/01/09 06:27:30 1.19
@@ -1,7 +1,7 @@
;;; viper-keym.el --- Viper keymaps
;; Copyright (C) 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007 Free Software Foundation, Inc.
+;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
;; Author: Michael Kifer <kifer at cs.stonybrook.edu>
@@ -26,8 +26,6 @@
;;; Code:
-(provide 'viper-keym)
-
;; compiler pacifier
(defvar viper-always)
(defvar viper-current-state)
@@ -35,19 +33,14 @@
(defvar viper-expert-level)
(defvar viper-ex-style-editing)
(defvar viper-ex-style-motion)
-
-;; loading happens only in non-interactive compilation
-;; in order to spare non-viperized emacs from being viperized
-(if noninteractive
- (eval-when-compile
- (let ((load-path (cons (expand-file-name ".") load-path)))
- (or (featurep 'viper-util)
- (load "viper-util.el" nil nil 'nosuffix))
- )))
;; end pacifier
(require 'viper-util)
+;; declare-function is not defined in XEmacs
+;;(declare-function viper-ex "viper-ex" (arg &optional string))
+;;(declare-function viper-normalize-minor-mode-map-alist "viper-cmd" ())
+;;(declare-function viper-set-mode-vars-for "viper-cmd" (state))
;;; Variables
@@ -700,6 +693,9 @@ Arguments: (major-mode viper-state keyma
form ((key . function) (key . function) ... )."
(mapcar (lambda (p) (define-key map (eval (car p)) (cdr p)))
alist))
+
+
+(provide 'viper-keym)
;;; Local Variables:
1.27 +17 -22 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.26
retrieving revision 1.27
diff -u -p -r1.26 -r1.27
--- viper-init.el 2007/11/02 06:16:33 1.26
+++ viper-init.el 2008/01/09 06:27:30 1.27
@@ -1,7 +1,7 @@
;;; viper-init.el --- some common definitions for Viper
;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007 Free Software Foundation, Inc.
+;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
;; Author: Michael Kifer <kifer at cs.stonybrook.edu>
@@ -26,8 +26,6 @@
;;; Code:
-(provide 'viper-init)
-
;; compiler pacifier
(defvar mark-even-if-inactive)
(defvar quail-mode)
@@ -49,10 +47,6 @@
(interactive)
(message "Viper version is %s" viper-version))
-;; Is it XEmacs?
-(defconst viper-xemacs-p (featurep 'xemacs))
-;; Is it Emacs?
-(defconst viper-emacs-p (not viper-xemacs-p))
;; Tell whether we are running as a window application or on a TTY
;; This is used to avoid compilation warnings. When emacs/xemacs forms can
@@ -116,8 +110,8 @@ In all likelihood, you don't need to bot
(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)))))
+ ((featurep 'emacs) (memq (viper-device-type) '(pc)))
+ ((featurep 'xemacs) (memq (viper-device-type) '(tty pc)))))
;;; Macros
@@ -356,9 +350,9 @@ Use `M-x viper-set-expert-level' to chan
"")))))
(defun viper-inactivate-input-method ()
- (cond ((and viper-emacs-p (fboundp 'inactivate-input-method))
+ (cond ((and (featurep 'emacs) (fboundp 'inactivate-input-method))
(inactivate-input-method))
- ((and viper-xemacs-p (boundp 'current-input-method))
+ ((and (featurep 'xemacs) (boundp 'current-input-method))
;; XEmacs had broken quil-mode for some time, so we are working around
;; it here
(setq quail-mode nil)
@@ -370,7 +364,7 @@ Use `M-x viper-set-expert-level' to chan
(force-mode-line-update))
))
(defun viper-activate-input-method ()
- (cond ((and viper-emacs-p (fboundp 'activate-input-method))
+ (cond ((and (featurep 'emacs) (fboundp 'activate-input-method))
(activate-input-method default-input-method))
((featurep 'xemacs)
(if (fboundp 'quail-mode) (quail-mode 1)))))
@@ -433,15 +427,11 @@ delete the text being replaced, as in st
"*Cursor color when Viper is in Replace state."
:type 'string
:group 'viper)
-(if (fboundp 'make-variable-frame-local)
- (make-variable-frame-local 'viper-replace-overlay-cursor-color))
(defcustom viper-insert-state-cursor-color "Green"
"Cursor color when Viper is in insert state."
:type 'string
:group 'viper)
-(if (fboundp 'make-variable-frame-local)
- (make-variable-frame-local 'viper-insert-state-cursor-color))
;; 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.
@@ -450,13 +440,15 @@ delete the text being replaced, as in st
"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)
+
(if (fboundp 'make-variable-frame-local)
- (make-variable-frame-local 'viper-vi-state-cursor-color))
+ (dolist (v '(viper-replace-overlay-cursor-color
+ viper-insert-state-cursor-color viper-emacs-state-cursor-color
+ viper-vi-state-cursor-color))
+ (make-variable-frame-local v)))
(viper-deflocalvar viper-replace-overlay nil "")
(put 'viper-replace-overlay 'permanent-local t)
@@ -475,7 +467,7 @@ is non-nil."
:group 'viper)
(defcustom viper-use-replace-region-delimiters
(or (not (viper-has-face-support-p))
- (and viper-xemacs-p (eq (viper-device-type) 'tty)))
+ (and (featurep 'xemacs) (eq (viper-device-type) 'tty)))
"*If non-nil, Viper will always use `viper-replace-region-end-delimiter' and
`viper-replace-region-start-delimiter' to delimit replacement regions, even on
color displays. By default, the delimiters are used only on TTYs."
@@ -1018,15 +1010,18 @@ Should be set in `~/.viper' file."
(defun viper-restore-cursor-type ()
(condition-case nil
- (if viper-xemacs-p
+ (if (featurep 'xemacs)
(set (make-local-variable 'bar-cursor) nil)
(setq cursor-type default-cursor-type))
(error nil)))
(defun viper-set-insert-cursor-type ()
- (if viper-xemacs-p
+ (if (featurep 'xemacs)
(set (make-local-variable 'bar-cursor) 2)
(setq cursor-type '(bar . 2))))
+
+
+(provide 'viper-init)
;; Local Variables:
1.31 +11 -13 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.30
retrieving revision 1.31
diff -u -p -r1.30 -r1.31
--- viper-ex.el 2007/11/02 06:16:33 1.30
+++ viper-ex.el 2008/01/09 06:27:30 1.31
@@ -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, 2006, 2007 Free Software Foundation, Inc.
+;; 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
;; Author: Michael Kifer <kifer at cs.stonybrook.edu>
@@ -47,12 +47,8 @@
(if noninteractive
(eval-when-compile
(let ((load-path (cons (expand-file-name ".") load-path)))
- (or (featurep 'viper-util)
- (load "viper-util.el" nil nil 'nosuffix))
- (or (featurep 'viper-keym)
- (load "viper-keym.el" nil nil 'nosuffix))
(or (featurep 'viper-cmd)
- (load "viper-cmd.el" nil nil 'nosuffix))
+ (load "viper-cmd.el" nil t 'nosuffix))
)))
;; end pacifier
@@ -1103,7 +1099,7 @@ reversed."
beg end cont val)
(viper-add-keymap ex-read-filename-map
- (if viper-emacs-p
+ (if (featurep 'emacs)
minibuffer-local-completion-map
read-file-name-map))
@@ -1558,7 +1554,7 @@ reversed."
;; setup buffer
(if (setq wind (viper-get-visible-buffer-window buf))
()
- (setq wind (get-lru-window (if viper-xemacs-p nil 'visible)))
+ (setq wind (get-lru-window (if (featurep 'xemacs) nil 'visible)))
(set-window-buffer wind buf))
(if (viper-window-display-p)
@@ -1878,7 +1874,7 @@ reversed."
(condition-case nil
(progn
(pop-to-buffer (get-buffer-create "*info*"))
- (info (if viper-xemacs-p "viper.info" "viper"))
+ (info (if (featurep 'xemacs) "viper.info" "viper"))
(message "Type `i' to search for a specific topic"))
(error (beep 1)
(with-output-to-temp-buffer " *viper-info*"
@@ -1887,7 +1883,7 @@ The Info file for Viper does not seem to
This file is part of the standard distribution of %sEmacs.
Please contact your system administrator. "
- (if viper-xemacs-p "X" "")
+ (if (featurep 'xemacs) "X" "")
))))))
;; Ex source command. Loads the file specified as argument or `~/.viper'
@@ -2220,9 +2216,11 @@ Type 'mak ' (including the space) to run
(pos2 (viper-line-pos 'end))
lines file info)
(setq lines (count-lines (point-min) (viper-line-pos 'end))
- file (if (buffer-file-name)
- (concat (viper-abbreviate-file-name (buffer-file-name)) ":")
- (concat (buffer-name) " [Not visiting any file]:"))
+ file (cond ((buffer-file-name)
+ (concat (viper-abbreviate-file-name (buffer-file-name)) ":"))
+ ((buffer-file-name (buffer-base-buffer))
+ (concat (viper-abbreviate-file-name (buffer-file-name (buffer-base-buffer))) " (indirect buffer):"))
+ (t (concat (buffer-name) " [Not visiting any file]:")))
info (format "line=%d/%d pos=%d/%d col=%d %s"
(if (= pos1 pos2)
(1+ lines)
1.42 +22 -30 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.41
retrieving revision 1.42
diff -u -p -r1.41 -r1.42
--- viper-cmd.el 2007/11/02 06:16:33 1.41
+++ viper-cmd.el 2008/01/09 06:27:30 1.42
@@ -1,7 +1,7 @@
;;; viper-cmd.el --- Vi command support for Viper
;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007 Free Software Foundation, Inc.
+;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
;; Author: Michael Kifer <kifer at cs.stonybrook.edu>
@@ -27,7 +27,6 @@
;;; Code:
(provide 'viper-cmd)
-(require 'advice)
;; Compiler pacifier
(defvar viper-minibuffer-current-face)
@@ -48,23 +47,6 @@
(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
-(if noninteractive
- (eval-when-compile
- (let ((load-path (cons (expand-file-name ".") load-path)))
- (or (featurep 'viper-util)
- (load "viper-util.el" nil nil 'nosuffix))
- (or (featurep 'viper-keym)
- (load "viper-keym.el" nil nil 'nosuffix))
- (or (featurep 'viper-mous)
- (load "viper-mous.el" nil nil 'nosuffix))
- (or (featurep 'viper-macs)
- (load "viper-macs.el" nil nil 'nosuffix))
- (or (featurep 'viper-ex)
- (load "viper-ex.el" nil nil 'nosuffix))
- )))
;; end pacifier
@@ -834,7 +816,7 @@ Vi's prefix argument will be used. Othe
viper-emacs-kbd-minor-mode
ch)
(cond ((and viper-special-input-method
- viper-emacs-p
+ (featurep 'emacs)
(fboundp 'quail-input-method))
;; (let ...) is used to restore unread-command-events to the
;; original state. We don't want anything left in there after
@@ -861,7 +843,7 @@ Vi's prefix argument will be used. Othe
(1- (length quail-current-str)))))
))
((and viper-special-input-method
- viper-xemacs-p
+ (featurep 'xemacs)
(fboundp 'quail-start-translation))
;; same as above but for XEmacs, which doesn't have
;; quail-input-method
@@ -893,7 +875,7 @@ Vi's prefix argument will be used. Othe
(t
;;(setq ch (read-char-exclusive))
(setq ch (aref (read-key-sequence nil) 0))
- (if viper-xemacs-p
+ (if (featurep 'xemacs)
(setq ch (event-to-character ch)))
;; replace ^M with the newline
(if (eq ch ?\C-m) (setq ch ?\n))
@@ -902,13 +884,13 @@ Vi's prefix argument will be used. Othe
(progn
;;(setq ch (read-char-exclusive))
(setq ch (aref (read-key-sequence nil) 0))
- (if viper-xemacs-p
+ (if (featurep 'xemacs)
(setq ch (event-to-character ch))))
)
(insert ch))
)
(setq last-command-event
- (viper-copy-event (if viper-xemacs-p
+ (viper-copy-event (if (featurep 'xemacs)
(character-to-event ch) ch)))
) ; let
(error nil)
@@ -1080,10 +1062,10 @@ as a Meta key and any number of multiple
;; and return ESC as the key-sequence
(viper-set-unread-command-events (viper-subseq keyseq 1))
(setq last-input-event event
- keyseq (if viper-emacs-p
+ keyseq (if (featurep 'emacs)
"\e"
(vector (character-to-event ?\e)))))
- ((and viper-xemacs-p
+ ((and (featurep 'xemacs)
(key-press-event-p first-key)
(equal '(meta) key-mod))
(viper-set-unread-command-events
@@ -1320,7 +1302,7 @@ as a Meta key and any number of multiple
(setq last-command-char char)
(setq last-command-event
(viper-copy-event
- (if viper-xemacs-p (character-to-event char) char)))
+ (if (featurep 'xemacs) (character-to-event char) char)))
(condition-case err
(funcall cmd-to-exec-at-end cmd-info)
(error
@@ -2791,7 +2773,9 @@ On reaching beginning of line, stop and
(defun viper-next-line-carefully (arg)
(condition-case nil
;; do not use forward-line! need to keep column
- (next-line arg)
+ (if (featurep 'emacs)
+ (with-no-warnings (next-line arg))
+ (next-line arg))
(error nil)))
@@ -3091,12 +3075,18 @@ On reaching beginning of line, stop and
(com (viper-getCom arg)))
(if com (viper-move-marker-locally 'viper-com-point (point)))
;; do not use forward-line! need to keep column
- (next-line val)
+ (if (featurep 'emacs)
+ (with-no-warnings (next-line val))
+ (next-line val))
(if viper-ex-style-motion
(if (and (eolp) (not (bolp))) (backward-char 1)))
(setq this-command 'next-line)
(if com (viper-execute-com 'viper-next-line val com))))
+;; declare-function is not defined in XEmacs
+;;(declare-function widget-type "wid-edit" (widget))
+;;(declare-function widget-button-press "wid-edit" (pos &optional event))
+;;(declare-function viper-set-hooks "viper" ())
(defun viper-next-line-at-bol (arg)
"Next line at beginning of line.
@@ -3135,7 +3125,9 @@ If point is on a widget or a button, sim
(com (viper-getCom arg)))
(if com (viper-move-marker-locally 'viper-com-point (point)))
;; do not use forward-line! need to keep column
- (previous-line val)
+ (if (featurep 'emacs)
+ (with-no-warnings (previous-line val))
+ (previous-line val))
(if viper-ex-style-motion
(if (and (eolp) (not (bolp))) (backward-char 1)))
(setq this-command 'previous-line)
1.96 +8 -0 XEmacs/packages/xemacs-packages/viper/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/viper/ChangeLog,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -p -r1.95 -r1.96
--- ChangeLog 2007/11/05 10:11:38 1.95
+++ ChangeLog 2008/01/09 06:27:31 1.96
@@ -1,3 +1,11 @@
+2008-01-09 Michael Kifer <kifer at cs.stonybrook.edu>
+
+ * viper*.el: many minor changes from the emacs tree.
+
+ * viper-ex.el (viper-info-on-file): take care of indiret buffers.
+
+ * viper.el (viper-set-hooks, set-cursor-color): set viper-vi-state-cursor-color.
+
2007-11-05 Norbert Koch <viteno at xemacs.org>
* Makefile (VERSION): XEmacs package 1.59 released.
More information about the XEmacs-CVS
mailing list