Commit c92d7d39 authored by Glenn Morris's avatar Glenn Morris
Browse files

Expand all viper-cond-compile-for-xemacs-or-emacs calls to a featurep test.

(viper-counting-clicks-p): Only define on XEmacs.
parent 2994902a
...@@ -120,10 +120,8 @@ considered related." ...@@ -120,10 +120,8 @@ considered related."
;; Returns window where click occurs ;; Returns window where click occurs
(defun viper-mouse-click-window (click) (defun viper-mouse-click-window (click)
(let ((win (viper-cond-compile-for-xemacs-or-emacs (let ((win (if (featurep 'xemacs) (event-window click)
(event-window click) ; xemacs (posn-window (event-start click)))))
(posn-window (event-start click)) ; emacs
)))
(if (window-live-p win) (if (window-live-p win)
win win
(error "Click was not over a live window")))) (error "Click was not over a live window"))))
...@@ -142,10 +140,8 @@ considered related." ...@@ -142,10 +140,8 @@ considered related."
;; Returns position of a click ;; Returns position of a click
(defsubst viper-mouse-click-posn (click) (defsubst viper-mouse-click-posn (click)
(viper-cond-compile-for-xemacs-or-emacs (if (featurep 'xemacs) (event-point click)
(event-point click) ; xemacs (posn-point (event-start click))))
(posn-point (event-start click)) ; emacs
))
(defun viper-surrounding-word (count click-count) (defun viper-surrounding-word (count click-count)
...@@ -318,33 +314,30 @@ See `viper-surrounding-word' for the definition of a word in this case." ...@@ -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. ;; XEmacs has no double-click events. So, we must simulate.
;; So, we have to simulate event-click-count. ;; So, we have to simulate event-click-count.
(defun viper-event-click-count (click) (defun viper-event-click-count (click)
(viper-cond-compile-for-xemacs-or-emacs (if (featurep 'xemacs) (viper-event-click-count-xemacs click)
(viper-event-click-count-xemacs click) ; xemacs (event-click-count click)))
(event-click-count click) ; emacs
)) (when (featurep 'xemacs)
;; kind of semaphore for updating viper-current-click-count ;; kind of semaphore for updating viper-current-click-count
(defvar viper-counting-clicks-p nil) (defvar viper-counting-clicks-p nil)
(viper-cond-compile-for-xemacs-or-emacs
(defun viper-event-click-count-xemacs (click) (defun viper-event-click-count-xemacs (click)
(let ((time-delta (- (event-timestamp click) (let ((time-delta (- (event-timestamp click)
viper-last-click-event-timestamp)) viper-last-click-event-timestamp))
inhibit-quit) inhibit-quit)
(while viper-counting-clicks-p (while viper-counting-clicks-p
(ignore)) (ignore))
(setq viper-counting-clicks-p t) (setq viper-counting-clicks-p t)
(if (> time-delta viper-multiclick-timeout) (if (> time-delta viper-multiclick-timeout)
(setq viper-current-click-count 0)) (setq viper-current-click-count 0))
(discard-input) (discard-input)
(setq viper-current-click-count (1+ viper-current-click-count) (setq viper-current-click-count (1+ viper-current-click-count)
viper-last-click-event-timestamp (event-timestamp click)) viper-last-click-event-timestamp (event-timestamp click))
(setq viper-counting-clicks-p nil) (setq viper-counting-clicks-p nil)
(if (viper-sit-for-short viper-multiclick-timeout t) (if (viper-sit-for-short viper-multiclick-timeout t)
viper-current-click-count viper-current-click-count
0) 0))))
))
nil ; emacs
)
(defun viper-mouse-click-search-word (click arg) (defun viper-mouse-click-search-word (click arg)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment