diff options
| author | Glenn Morris | 2008-03-01 20:09:54 +0000 |
|---|---|---|
| committer | Glenn Morris | 2008-03-01 20:09:54 +0000 |
| commit | c92d7d39c85025be4a5521ca72f747c4d453cd50 (patch) | |
| tree | 76e983a2746961a10c27ca3cd578dcd125fc1079 /lisp | |
| parent | 2994902a288df56bdb3e45fb0435cd1c86f1b01d (diff) | |
| download | emacs-c92d7d39c85025be4a5521ca72f747c4d453cd50.tar.gz emacs-c92d7d39c85025be4a5521ca72f747c4d453cd50.zip | |
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')
| -rw-r--r-- | lisp/emulation/viper-mous.el | 63 |
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." | |||
| 120 | 120 | ||
| 121 | ;; Returns window where click occurs | 121 | ;; Returns window where click occurs |
| 122 | (defun viper-mouse-click-window (click) | 122 | (defun viper-mouse-click-window (click) |
| 123 | (let ((win (viper-cond-compile-for-xemacs-or-emacs | 123 | (let ((win (if (featurep 'xemacs) (event-window click) |
| 124 | (event-window click) ; xemacs | 124 | (posn-window (event-start click))))) |
| 125 | (posn-window (event-start click)) ; emacs | ||
| 126 | ))) | ||
| 127 | (if (window-live-p win) | 125 | (if (window-live-p win) |
| 128 | win | 126 | win |
| 129 | (error "Click was not over a live window")))) | 127 | (error "Click was not over a live window")))) |
| @@ -142,10 +140,8 @@ considered related." | |||
| 142 | 140 | ||
| 143 | ;; Returns position of a click | 141 | ;; Returns position of a click |
| 144 | (defsubst viper-mouse-click-posn (click) | 142 | (defsubst viper-mouse-click-posn (click) |
| 145 | (viper-cond-compile-for-xemacs-or-emacs | 143 | (if (featurep 'xemacs) (event-point click) |
| 146 | (event-point click) ; xemacs | 144 | (posn-point (event-start click)))) |
| 147 | (posn-point (event-start click)) ; emacs | ||
| 148 | )) | ||
| 149 | 145 | ||
| 150 | 146 | ||
| 151 | (defun viper-surrounding-word (count click-count) | 147 | (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 | ;; XEmacs has no double-click events. So, we must simulate. | 314 | ;; XEmacs has no double-click events. So, we must simulate. |
| 319 | ;; So, we have to simulate event-click-count. | 315 | ;; So, we have to simulate event-click-count. |
| 320 | (defun viper-event-click-count (click) | 316 | (defun viper-event-click-count (click) |
| 321 | (viper-cond-compile-for-xemacs-or-emacs | 317 | (if (featurep 'xemacs) (viper-event-click-count-xemacs click) |
| 322 | (viper-event-click-count-xemacs click) ; xemacs | 318 | (event-click-count click))) |
| 323 | (event-click-count click) ; emacs | 319 | |
| 324 | )) | 320 | (when (featurep 'xemacs) |
| 325 | 321 | ||
| 326 | ;; kind of semaphore for updating viper-current-click-count | 322 | ;; kind of semaphore for updating viper-current-click-count |
| 327 | (defvar viper-counting-clicks-p nil) | 323 | (defvar viper-counting-clicks-p nil) |
| 328 | (viper-cond-compile-for-xemacs-or-emacs | 324 | |
| 329 | (defun viper-event-click-count-xemacs (click) | 325 | (defun viper-event-click-count-xemacs (click) |
| 330 | (let ((time-delta (- (event-timestamp click) | 326 | (let ((time-delta (- (event-timestamp click) |
| 331 | viper-last-click-event-timestamp)) | 327 | viper-last-click-event-timestamp)) |
| 332 | inhibit-quit) | 328 | inhibit-quit) |
| 333 | (while viper-counting-clicks-p | 329 | (while viper-counting-clicks-p |
| 334 | (ignore)) | 330 | (ignore)) |
| 335 | (setq viper-counting-clicks-p t) | 331 | (setq viper-counting-clicks-p t) |
| 336 | (if (> time-delta viper-multiclick-timeout) | 332 | (if (> time-delta viper-multiclick-timeout) |
| 337 | (setq viper-current-click-count 0)) | 333 | (setq viper-current-click-count 0)) |
| 338 | (discard-input) | 334 | (discard-input) |
| 339 | (setq viper-current-click-count (1+ viper-current-click-count) | 335 | (setq viper-current-click-count (1+ viper-current-click-count) |
| 340 | viper-last-click-event-timestamp (event-timestamp click)) | 336 | viper-last-click-event-timestamp (event-timestamp click)) |
| 341 | (setq viper-counting-clicks-p nil) | 337 | (setq viper-counting-clicks-p nil) |
| 342 | (if (viper-sit-for-short viper-multiclick-timeout t) | 338 | (if (viper-sit-for-short viper-multiclick-timeout t) |
| 343 | viper-current-click-count | 339 | viper-current-click-count |
| 344 | 0) | 340 | 0)))) |
| 345 | )) | ||
| 346 | nil ; emacs | ||
| 347 | ) | ||
| 348 | 341 | ||
| 349 | 342 | ||
| 350 | (defun viper-mouse-click-search-word (click arg) | 343 | (defun viper-mouse-click-search-word (click arg) |