Changeset 4210 for trunk/lisp/xt-mouse.el
- Timestamp:
- 2007年06月02日 09時29分41秒 (1 year ago)
- Files:
-
- trunk/lisp/xt-mouse.el (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lisp/xt-mouse.el
r4200 r4210 123 123 c))) 124 124 125 (defun xterm-mouse-truncate-wrap (f) 126 "Truncate with wrap-around." 127 (condition-case nil 128 ;; First try the built-in truncate, in case there's no overflow. 129 (truncate f) 130 ;; In case of overflow, do wraparound by hand. 131 (range-error 132 ;; In our case, we wrap around every 3 days or so, so if we assume 133 ;; a maximum of 65536 wraparounds, we're safe for a couple years. 134 ;; Using a power of 2 makes rounding errors less likely. 135 (let* ((maxwrap (* 65536 2048)) 136 (dbig (truncate (/ f maxwrap))) 137 (fdiff (- f (* 1.0 maxwrap dbig)))) 138 (+ (truncate fdiff) (* maxwrap dbig)))))) 139 140 125 141 (defun xterm-mouse-event () 126 142 "Convert XTerm mouse event to Emacs mouse event." … … 130 146 ;; Emulate timestamp information. This is accurate enough 131 147 ;; for default value of mouse-1-click-follows-link (450msec). 132 (timestamp ( truncate148 (timestamp (xterm-mouse-truncate-wrap 133 149 (* 1000 134 150 (- (float-time) … … 207 223 (provide 'xt-mouse) 208 224 209 ;; ;arch-tag: 84962d4e-fae9-4c13-a9d7-ef4925a4ac03225 ;; arch-tag: 84962d4e-fae9-4c13-a9d7-ef4925a4ac03 210 226 ;;; xt-mouse.el ends here
