diff options
author | Karl Heuer <kwzh@gnu.org> | 1995-06-09 00:12:29 +0000 |
---|---|---|
committer | Karl Heuer <kwzh@gnu.org> | 1995-06-09 00:12:29 +0000 |
commit | 96d82de79af08ce8706c04a76b883105cd1a0a4c (patch) | |
tree | 6988845e1f5a77ac1d38ab51c386991ffdfd5b4e | |
parent | 3d33df2833d26130511188f6090f21f0926d9b1c (diff) | |
download | emacs-96d82de79af08ce8706c04a76b883105cd1a0a4c.tar.gz |
Changed vip-*-frame-* to *-frame-*, incorporated overlay strings,
unread-command-events, removed support for emacs versions 19.28 and
xemacs 19.11 and earlier.
-rw-r--r-- | lisp/emulation/viper-keym.el | 12 | ||||
-rw-r--r-- | lisp/emulation/viper-macs.el | 27 | ||||
-rw-r--r-- | lisp/emulation/viper-mous.el | 50 |
3 files changed, 48 insertions, 41 deletions
diff --git a/lisp/emulation/viper-keym.el b/lisp/emulation/viper-keym.el index 2e59a7b87ff..606f17324c0 100644 --- a/lisp/emulation/viper-keym.el +++ b/lisp/emulation/viper-keym.el @@ -1,6 +1,5 @@ ;;; viper-keym.el -- Main Viper keymaps - -;; Copyright (C) 1995 Free Software Foundation, Inc. +;; Copyright (C) 1994, 1995 Free Software Foundation, Inc. ;; This file is part of GNU Emacs. @@ -89,6 +88,11 @@ vip-insert-basic-map. Not recommended, except for novice users.") ;; This keymap should stay empty (defvar vip-empty-keymap (make-sparse-keymap)) +;; This was the main Vi mode in old versions of VIP which may have been +;; extensively used by VIP users. We declare it as a global var +;; and, after .vip is loaded, we add this keymap to vip-vi-basic-map. +(defvar vip-mode-map (make-sparse-keymap)) + ;;; Variables used by minor modes @@ -294,7 +298,7 @@ vip-insert-basic-map. Not recommended, except for novice users.") (define-key vip-vi-basic-map "t" 'vip-goto-char-forward) (define-key vip-vi-basic-map "u" 'vip-undo) (define-key vip-vi-basic-map "v" 'find-file) -(define-key vip-vi-basic-map "\C-v" 'vip-find-file-other-frame) +(define-key vip-vi-basic-map "\C-v" 'find-file-other-frame) (define-key vip-vi-basic-map "w" 'vip-forward-word) (define-key vip-vi-basic-map "x" 'vip-delete-char) (define-key vip-vi-basic-map "y" 'vip-command-argument) @@ -428,8 +432,8 @@ Arguments: (major-mode vip-state keymap)" (vip-set-mode-vars-for vip-current-state))) +;; Displays variables that control Viper's keymaps (defun vip-debug-keymaps () - "Displays variables that control Viper's keymaps." (interactive) (with-output-to-temp-buffer " *vip-debug*" (princ (format "Buffer name: %s\n\n" (buffer-name))) diff --git a/lisp/emulation/viper-macs.el b/lisp/emulation/viper-macs.el index 1b001636100..5cce77a5874 100644 --- a/lisp/emulation/viper-macs.el +++ b/lisp/emulation/viper-macs.el @@ -1,6 +1,5 @@ ;;; viper-macs.el -- functions implementing keyboard macros for Viper - -;; Copyright (C) 1995 Free Software Foundation, Inc. +;; Copyright (C) 1994, 1995 Free Software Foundation, Inc. ;; This file is part of GNU Emacs. @@ -45,7 +44,7 @@ "Vector of keys representing the name of last Viper keyboard macro.") (defconst vip-fast-keyseq-timeout 200 - "*Key sequences separated by this many miliseconds are interpreted as a macro, if such a macro is defined. + "*Key sequence separated by no more than this many milliseconds is viewed as a macro, if such a macro is defined. This also controls ESC-keysequences generated by keyboard function keys.") @@ -62,8 +61,8 @@ a key is a symbol, e.g., `a', `\\1', `f2', etc., or a list, e.g., ;;; Code +;; Ex map command (defun ex-map () - "Ex map command." (let ((mod-char "") macro-name macro-body map-args ins) (save-window-excursion @@ -93,8 +92,8 @@ a key is a symbol, e.g., `a', `\\1', `f2', etc., or a list, e.g., )) +;; Ex unmap (defun ex-unmap () - "Ex unmap." (let ((mod-char "") temp macro-name ins) (save-window-excursion @@ -178,8 +177,8 @@ a key is a symbol, e.g., `a', `\\1', `f2', etc., or a list, e.g., (setq macro-body (vip-char-array-to-macro macro-body))) ((vectorp macro-body) nil) (t (error "map: Invalid syntax in macro definition")))) - (cons macro-name macro-body) - )) + (setq cursor-in-echo-area nil)(sit-for 0) ; this overcomes xemacs tty bug + (cons macro-name macro-body))) @@ -444,6 +443,12 @@ If SCOPE is nil, the user is asked to specify the scope." ;; macro name must be a vector of vip-style keys (defun vip-unrecord-kbd-macro (macro-name state) + "Delete macro MACRO-NAME from Viper STATE. +MACRO-NAME must be a vector of vip-style keys. This command is used by Viper +internally, but the user can also use it in ~/.vip to delete pre-defined macros +supplied with Viper. The best way to avoid mistakes in macro names to be passed +to this function is to use vip-describe-kbd-macros and copy the name from +there." (let* (state-name keymap (macro-alist-var (cond ((eq state 'vi-state) @@ -521,7 +526,7 @@ If SCOPE is nil, the user is asked to specify the scope." )) )) -;; Checks if MACRO-ALIST has an entry for a macro name starting with +;; Check if MACRO-ALIST has an entry for a macro name starting with ;; CHAR. If not, this indicates that the binding for this char ;; in vip-vi/insert-kbd-map can be released. (defun vip-can-release-key (char macro-alist) @@ -751,8 +756,8 @@ If SCOPE is nil, the user is asked to specify the scope." (setq candidates (delq nil candidates)))) -;; if seq of key symbols can be converted to a string--do so. Otherwise, do -;; nothing. +;; if seq of Viper key symbols (representing a macro) can be converted to a +;; string--do so. Otherwise, do nothing. (defun vip-display-macro (macro-name) (cond ((vip-char-symbol-sequence-p macro-name) (mapconcat 'symbol-name macro-name "")) @@ -763,7 +768,7 @@ If SCOPE is nil, the user is asked to specify the scope." (defun vip-events-to-macro (event-seq) (vconcat (mapcar 'vip-event-key event-seq))) -;; convert strings of characters or arrays of characters to Viper macro form +;; convert strings or arrays of characters to Viper macro form (defun vip-char-array-to-macro (array) (let ((vec (vconcat array)) macro) diff --git a/lisp/emulation/viper-mous.el b/lisp/emulation/viper-mous.el index e3a31abc855..5f154411830 100644 --- a/lisp/emulation/viper-mous.el +++ b/lisp/emulation/viper-mous.el @@ -1,6 +1,5 @@ ;;; viper-mous.el -- Mouse support for Viper - -;; Copyright (C) 1995 Free Software Foundation, Inc. +;; Copyright (C) 1994, 1995 Free Software Foundation, Inc. ;; This file is part of GNU Emacs. @@ -30,7 +29,7 @@ (defvar vip-frame-of-focus nil) ;; Frame that was selected before the switch-frame event. -(defconst vip-pre-click-frame (vip-selected-frame)) +(defconst vip-current-frame-saved (selected-frame)) (defvar vip-surrounding-word-function 'vip-surrounding-word "*Function that determines what constitutes a word for clicking events. @@ -67,7 +66,7 @@ considered related.") ;;; Code -(defun vip-multiclick-p () +(defsubst vip-multiclick-p () (not (vip-sit-for-short vip-multiclick-timeout t))) (defun vip-surrounding-word (count click-count) @@ -188,27 +187,26 @@ Click may be in another window. Current window and buffer isn't changed." (error "Click must be over a window.")) click-word)))) -(defun vip-mouse-click-frame (click) - "Returns window where click occurs." - (vip-window-frame (vip-mouse-click-window click))) +;; Returns window where click occurs +(defsubst vip-mouse-click-frame (click) + (window-frame (vip-mouse-click-window click))) -(defun vip-mouse-click-window (click) - "Returns window where click occurs." +;; Returns window where click occurs +(defsubst vip-mouse-click-window (click) (if vip-xemacs-p (event-window click) (posn-window (event-start click)))) -(defun vip-mouse-click-window-buffer (click) - "Returns the buffer of the window where click occurs." +;; Returns the buffer of the window where click occurs +(defsubst vip-mouse-click-window-buffer (click) (window-buffer (vip-mouse-click-window click))) -(defun vip-mouse-click-window-buffer-name (click) - "Returns the name of the buffer in the window where click occurs." +;; Returns the name of the buffer in the window where click occurs +(defsubst vip-mouse-click-window-buffer-name (click) (buffer-name (vip-mouse-click-window-buffer click))) -(defun vip-mouse-click-posn (click) - "Returns position of a click." - (interactive "e") +;; Returns position of a click +(defsubst vip-mouse-click-posn (click) (if vip-xemacs-p (event-point click) (posn-point (event-start click)))) @@ -222,7 +220,7 @@ The double-click action of the same mouse button must not be bound See `vip-surrounding-word' for the definition of a word in this case." (interactive "e\nP") (if vip-frame-of-focus ;; to handle clicks in another frame - (vip-select-frame vip-frame-of-focus)) + (select-frame vip-frame-of-focus)) ;; turn arg into a number (cond ((numberp arg) nil) @@ -287,7 +285,7 @@ See `vip-surrounding-word' for the details on what constitutes a word for this command." (interactive "e\nP") (if vip-frame-of-focus ;; to handle clicks in another frame - (vip-select-frame vip-frame-of-focus)) + (select-frame vip-frame-of-focus)) (let (click-word click-count (previous-search-string vip-s-string)) @@ -388,7 +386,7 @@ bindings in viper.el and in the Viper manual." ;; pass prefix arg along to vip-mouse-click-search/insert-word (setq prefix-arg arg) (if (eq last-command 'handle-switch-frame) - (setq vip-frame-of-focus vip-pre-click-frame)) + (setq vip-frame-of-focus vip-current-frame-saved)) ;; make Emacs forget that it executed vip-mouse-catch-frame-switch (setq this-command last-command)) @@ -408,12 +406,12 @@ bindings in viper.el and in the Viper manual." ;; until you do something other than vip-mouse-click-* command. ;; In XEmacs, you have to manually select frame B (with the mouse click) in ;; order to shift focus to frame B. -(defun vip-save-pre-click-frame (frame) - (setq last-command 'handle-switch-frame) - (setq vip-pre-click-frame (vip-selected-frame))) +(defsubst vip-remember-current-frame (frame) + (setq last-command 'handle-switch-frame + vip-current-frame-saved (selected-frame))) -(cond (window-system +(cond ((vip-window-display-p) (let* ((search-key (if vip-xemacs-p [(meta button1up)] [S-mouse-1])) (search-key-catch (if vip-xemacs-p [(meta button1)] [S-down-mouse-1])) @@ -445,11 +443,11 @@ bindings in viper.el and in the Viper manual." (global-set-key insert-key-catch 'vip-mouse-catch-frame-switch)) (if vip-xemacs-p - (add-hook 'mouse-leave-screen-hook - 'vip-save-pre-click-frame) + (add-hook 'mouse-leave-frame-hook + 'vip-remember-current-frame) (defadvice handle-switch-frame (before vip-frame-advice activate) "Remember the selected frame before the switch-frame event." - (vip-save-pre-click-frame (vip-selected-frame)))) + (vip-remember-current-frame (selected-frame)))) ))) |