Mercurial > hg > xemacs-beta
diff lisp/viper/viper-mous.el @ 163:0132846995bd r20-3b8
Import from CVS: tag r20-3b8
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:43:35 +0200 |
parents | 6a378aca36af |
children | 2d532a89d707 |
line wrap: on
line diff
--- a/lisp/viper/viper-mous.el Mon Aug 13 09:42:28 2007 +0200 +++ b/lisp/viper/viper-mous.el Mon Aug 13 09:43:35 2007 +0200 @@ -32,13 +32,16 @@ (defvar vip-s-string) (defvar vip-re-search) -(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) - (load "viper.el" nil nil 'nosuffix)) - )) +;; 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-cmd) + (load "viper-cmd.el" nil nil 'nosuffix)) + ))) ;; end pacifier (require 'viper-util) @@ -63,9 +66,11 @@ ;; time interval in millisecond within which successive clicks are ;; considered related -(defconst vip-multiclick-timeout (if vip-xemacs-p - mouse-track-multi-click-time - double-click-time) +(defconst vip-multiclick-timeout (if (vip-window-display-p) + (if vip-xemacs-p + mouse-track-multi-click-time + double-click-time) + 500) "*Time interval in millisecond within which successive clicks are considered related.") @@ -396,7 +401,7 @@ (defun vip-mouse-catch-frame-switch (event arg) "Catch the event of switching frame. Usually is bound to a 'down-mouse' event to work properly. See sample -bindings in viper.el and in the Viper manual." +bindings in the Viper manual." (interactive "e\nP") (setq vip-frame-of-focus nil) ;; pass prefix arg along to vip-mouse-click-search/insert-word @@ -427,46 +432,5 @@ vip-current-frame-saved (selected-frame))) -(cond ((vip-window-display-p) - (let* ((search-key (if vip-xemacs-p - [(meta shift button1up)] [M-S-mouse-1])) - (search-key-catch (if vip-xemacs-p - [(meta shift button1)] [M-S-down-mouse-1])) - (insert-key (if vip-xemacs-p - [(meta shift button2up)] [M-S-mouse-2])) - (insert-key-catch (if vip-xemacs-p - [(meta shift button2)] [M-S-down-mouse-2])) - (search-key-unbound (and (not (key-binding search-key)) - (not (key-binding search-key-catch)))) - (insert-key-unbound (and (not (key-binding insert-key)) - (not (key-binding insert-key-catch)))) - ) - - (if search-key-unbound - (global-set-key search-key 'vip-mouse-click-search-word)) - (if insert-key-unbound - (global-set-key insert-key 'vip-mouse-click-insert-word)) - - ;; The following would be needed if you want to use the above two - ;; while clicking in another frame. If you only want to use them - ;; by clicking in another window, not frame, the bindings below - ;; aren't necessary. - - ;; These must be bound to mouse-down event for the same mouse - ;; buttons as 'vip-mouse-click-search-word and - ;; 'vip-mouse-click-insert-word - (if search-key-unbound - (global-set-key search-key-catch 'vip-mouse-catch-frame-switch)) - (if insert-key-unbound - (global-set-key insert-key-catch 'vip-mouse-catch-frame-switch)) - - (if vip-xemacs-p - (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-remember-current-frame (selected-frame)))) - ))) - ;;; viper-mous.el ends here