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.
32 ;;; In GNU Emacs, user can intercept whole mouse tracking events by
33 ;;; assigning [mouse-X]. In XEmacs, however, which causes different
34 ;;; effect, that is, the command assigned to [mouse-X] only catches
35 ;;; button-release events.
36 (defvar riece-mouse-2 [mouse-2])
38 ;;; popup-menu compatibility stuff, stolen (and renamed) from
40 (defmacro riece-popup-menu-bogus-filter-constructor (menu)
41 ;; #### Kludge for FSF Emacs-style menu.
42 (let ((bogus-menu (make-symbol "bogus-menu")))
43 `(let (,bogus-menu selection function)
44 (easy-menu-define ,bogus-menu nil nil ,menu)
45 (setq selection (x-popup-menu t ,bogus-menu))
47 (setq function (lookup-key ,bogus-menu (apply #'vector selection)))
48 ;; If a callback entry has no name, easy-menu wraps its value.
49 ;; See `easy-menu-make-symbol'.
50 (if (eq t (compare-strings "menu-function-" 0 nil
51 (symbol-name function) 0 14))
52 (car (last (symbol-function function)))
55 (defun riece-popup-menu-popup (menu event)
56 (let ((function (riece-popup-menu-bogus-filter-constructor menu))
57 (pos (event-start event)))
58 (when (symbolp function)
59 (select-window (posn-window pos))
60 (goto-char (posn-point pos))
63 (provide 'riece-emacs)
65 ;;; riece-emacs.el ends here