summaryrefslogtreecommitdiff
path: root/lisp/emulation
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2008-03-01 20:09:54 +0000
committerGlenn Morris <rgm@gnu.org>2008-03-01 20:09:54 +0000
commitc92d7d39c85025be4a5521ca72f747c4d453cd50 (patch)
tree76e983a2746961a10c27ca3cd578dcd125fc1079 /lisp/emulation
parent2994902a288df56bdb3e45fb0435cd1c86f1b01d (diff)
downloademacs-c92d7d39c85025be4a5521ca72f747c4d453cd50.tar.gz
Expand all viper-cond-compile-for-xemacs-or-emacs calls to a featurep test.
(viper-counting-clicks-p): Only define on XEmacs.
Diffstat (limited to 'lisp/emulation')
-rw-r--r--lisp/emulation/viper-mous.el63
1 files changed, 28 insertions, 35 deletions
diff --git a/lisp/emulation/viper-mous.el b/lisp/emulation/viper-mous.el
index be2739777eb..1d60d1eb5ee 100644
--- a/lisp/emulation/viper-mous.el
+++ b/lisp/emulation/viper-mous.el
@@ -120,10 +120,8 @@ considered related."
;; Returns window where click occurs
(defun viper-mouse-click-window (click)
- (let ((win (viper-cond-compile-for-xemacs-or-emacs
- (event-window click) ; xemacs
- (posn-window (event-start click)) ; emacs
- )))
+ (let ((win (if (featurep 'xemacs) (event-window click)
+ (posn-window (event-start click)))))
(if (window-live-p win)
win
(error "Click was not over a live window"))))
@@ -142,10 +140,8 @@ considered related."
;; Returns position of a click
(defsubst viper-mouse-click-posn (click)
- (viper-cond-compile-for-xemacs-or-emacs
- (event-point click) ; xemacs
- (posn-point (event-start click)) ; emacs
- ))
+ (if (featurep 'xemacs) (event-point click)
+ (posn-point (event-start click))))
(defun viper-surrounding-word (count click-count)
@@ -318,33 +314,30 @@ See `viper-surrounding-word' for the definition of a word in this case."
;; XEmacs has no double-click events. So, we must simulate.
;; So, we have to simulate event-click-count.
(defun viper-event-click-count (click)
- (viper-cond-compile-for-xemacs-or-emacs
- (viper-event-click-count-xemacs click) ; xemacs
- (event-click-count click) ; emacs
- ))
-
-;; kind of semaphore for updating viper-current-click-count
-(defvar viper-counting-clicks-p nil)
-(viper-cond-compile-for-xemacs-or-emacs
- (defun viper-event-click-count-xemacs (click)
- (let ((time-delta (- (event-timestamp click)
- viper-last-click-event-timestamp))
- inhibit-quit)
- (while viper-counting-clicks-p
- (ignore))
- (setq viper-counting-clicks-p t)
- (if (> time-delta viper-multiclick-timeout)
- (setq viper-current-click-count 0))
- (discard-input)
- (setq viper-current-click-count (1+ viper-current-click-count)
- viper-last-click-event-timestamp (event-timestamp click))
- (setq viper-counting-clicks-p nil)
- (if (viper-sit-for-short viper-multiclick-timeout t)
- viper-current-click-count
- 0)
- ))
- nil ; emacs
- )
+ (if (featurep 'xemacs) (viper-event-click-count-xemacs click)
+ (event-click-count click)))
+
+(when (featurep 'xemacs)
+
+ ;; kind of semaphore for updating viper-current-click-count
+ (defvar viper-counting-clicks-p nil)
+
+ (defun viper-event-click-count-xemacs (click)
+ (let ((time-delta (- (event-timestamp click)
+ viper-last-click-event-timestamp))
+ inhibit-quit)
+ (while viper-counting-clicks-p
+ (ignore))
+ (setq viper-counting-clicks-p t)
+ (if (> time-delta viper-multiclick-timeout)
+ (setq viper-current-click-count 0))
+ (discard-input)
+ (setq viper-current-click-count (1+ viper-current-click-count)
+ viper-last-click-event-timestamp (event-timestamp click))
+ (setq viper-counting-clicks-p nil)
+ (if (viper-sit-for-short viper-multiclick-timeout t)
+ viper-current-click-count
+ 0))))
(defun viper-mouse-click-search-word (click arg)