diff lisp/emulation/viper-mous.el @ 12140:75379a19c5d5

Changed vip-*-frame-* to *-frame-*, incorporated overlay strings, unread-command-events, removed support for emacs versions 19.28 and xemacs 19.11 and earlier.
author Karl Heuer <kwzh@gnu.org>
date Fri, 09 Jun 1995 00:12:29 +0000
parents d1f620273acb
children 9dedaee6ee1c
line wrap: on
line diff
--- a/lisp/emulation/viper-mous.el	Fri Jun 09 00:11:53 1995 +0000
+++ b/lisp/emulation/viper-mous.el	Fri Jun 09 00:12:29 1995 +0000
@@ -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 @@
 
 ;;; 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 @@
 	  (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 @@
 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 @@
 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 @@
   ;; 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 @@
 ;; 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 @@
 	     (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))))
        )))