1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
;(***********************************************************************)
;(* *)
;(* Objective Caml *)
;(* *)
;(* Didier Remy, projet Cristal, INRIA Rocquencourt *)
;(* *)
;(* Copyright 2003 Institut National de Recherche en Informatique et *)
;(* en Automatique. All rights reserved. This file is distributed *)
;(* under the terms of the GNU General Public License. *)
;(* *)
;(***********************************************************************)
;(* $Id: caml-xemacs.el 11113 2011-07-07 14:32:00Z maranget $ *)
(require 'overlay)
;; for caml-help.el
(defun caml-info-other-window (arg)
(save-excursion (info arg))
(view-buffer-other-window "*info*"))
;; for caml-types.el
(defun caml-line-beginning-position ()
(save-excursion (beginning-of-line) (point)))
(defalias 'caml-read-event 'next-event)
(defalias 'caml-window-edges 'window-pixel-edges)
(defun caml-mouse-vertical-position ()
(let ((e (mouse-position-as-motion-event)))
(and e (event-y-pixel e))))
(defalias 'caml-mouse-movement-p 'motion-event-p)
(defun caml-event-window (e)
(and (mouse-event-p e) (event-window e)))
(defun caml-event-point-start (e) (event-closest-point e))
(defun caml-event-point-end (e) (event-closest-point e))
(defun caml-ignore-event-p (e)
(if (and (key-press-event-p e) (equal (key-binding e) 'keyboard-quit))
(keyboard-quit))
(not (mouse-event-p e)))
(defun caml-sit-for (sec &optional mili)
(sit-for (+ sec (if mili (* 0.001 mili) 0))))
(defmacro caml-track-mouse (&rest body) (cons 'progn body))
(defun caml-release-event-p (original event)
(and (button-release-event-p event)
(equal (event-button original) (event-button event))))
(if (fboundp 'string-to-number)
(defalias 'caml-string-to-int 'string-to-number)
(defalias 'caml-string-to-int 'string-to-int))
(provide 'caml-xemacs)
|