1 ;;; riece-emacs.el --- FSF Emacs specific functions
2 ;; Copyright (C) 1999 Daiki Ueno
4 ;; Author: Daiki Ueno <ueno@unixuser.org>
8 ;; This file is part of Riece.
10 ;; This program is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
15 ;; This program is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
27 (defalias 'riece-set-case-syntax-pair
28 'set-case-syntax-pair)
30 ;;; stolen (and renamed) from gnus-ems.el.
31 ;;; In GNU Emacs, user can intercept whole mouse tracking events by
32 ;;; assigning [mouse-X]. In XEmacs, however, which causes different
33 ;;; effect, that is, the command assigned to [mouse-X] only catches
34 ;;; button-release events.
35 (defvar riece-mouse-2 [mouse-2])
37 ;;; popup-menu compatibility stuff, stolen (and renamed) from
39 (defmacro riece-popup-menu-bogus-filter-constructor (menu)
40 ;; #### Kludge for FSF Emacs-style menu.
41 (let ((bogus-menu (make-symbol "bogus-menu")))
42 `(let (,bogus-menu selection function)
43 (easy-menu-define ,bogus-menu nil nil ,menu)
44 (setq selection (x-popup-menu t ,bogus-menu))
46 (setq function (lookup-key ,bogus-menu (apply #'vector selection)))
47 ;; If a callback entry has no name, easy-menu wraps its value.
48 ;; See `easy-menu-make-symbol'.
49 (if (eq t (compare-strings "menu-function-" 0 nil
50 (symbol-name function) 0 14))
51 (car (last (symbol-function function)))
54 (defun riece-popup-menu-popup (menu event)
55 (let ((function (riece-popup-menu-bogus-filter-constructor menu)))
59 (defun riece-event-buffer (event)
60 "Return the buffer of the window over which mouse event EVENT occurred."
61 (window-buffer (posn-window (event-start event))))
63 (defun riece-event-point (event)
64 "Return the character position of the mouse event EVENT."
65 (posn-point (event-start event)))
67 ;;; stolen (and renamed) from gnus-ems.el.
68 (defun riece-region-active-p ()
69 "Say whether the region is active."
70 (and (boundp 'transient-mark-mode)
75 (defalias 'riece-make-overlay 'make-overlay)
76 (defalias 'riece-overlay-put 'overlay-put)
77 (defalias 'riece-overlay-start 'overlay-start)
78 (defalias 'riece-overlay-buffer 'overlay-buffer)
80 (defalias 'riece-run-at-time 'run-at-time)
82 (provide 'riece-emacs)
84 ;;; riece-emacs.el ends here