Mercurial > hg > xemacs-beta
comparison lisp/hyperbole/hmouse-key.el @ 70:131b0175ea99 r20-0b30
Import from CVS: tag r20-0b30
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:02:59 +0200 |
parents | 4103f0995bd7 |
children | 4be1180a9e89 |
comparison
equal
deleted
inserted
replaced
69:804d1389bcd6 | 70:131b0175ea99 |
---|---|
4 ;; SUMMARY: Load "hmouse-sh.el" or "hmouse-reg.el" for Smart Key bindings. | 4 ;; SUMMARY: Load "hmouse-sh.el" or "hmouse-reg.el" for Smart Key bindings. |
5 ;; USAGE: GNU Emacs Lisp Library | 5 ;; USAGE: GNU Emacs Lisp Library |
6 ;; KEYWORDS: hypermedia, mouse | 6 ;; KEYWORDS: hypermedia, mouse |
7 ;; | 7 ;; |
8 ;; AUTHOR: Bob Weiner | 8 ;; AUTHOR: Bob Weiner |
9 ;; ORG: InfoDock Associates | 9 ;; ORG: Motorola, Inc., PPG |
10 ;; | 10 ;; |
11 ;; ORIG-DATE: 30-May-94 at 00:11:57 | 11 ;; ORIG-DATE: 30-May-94 at 00:11:57 |
12 ;; LAST-MOD: 21-Feb-97 at 18:03:12 by Bob Weiner | 12 ;; LAST-MOD: 14-Sep-95 at 18:35:17 by Bob Weiner |
13 ;; | 13 ;; |
14 ;; This file is part of Hyperbole. | 14 ;; This file is part of Hyperbole. |
15 ;; Available for use and distribution under the same terms as GNU Emacs. | 15 ;; Available for use and distribution under the same terms as GNU Emacs. |
16 ;; | 16 ;; |
17 ;; Copyright (C) 1994-1995, 1997 Free Software Foundation, Inc. | 17 ;; Copyright (C) 1994-1995, Free Software Foundation, Inc. |
18 ;; Developed with support from Motorola Inc. | 18 ;; Developed with support from Motorola Inc. |
19 ;; | 19 ;; |
20 ;; DESCRIPTION: | 20 ;; DESCRIPTION: |
21 ;; | 21 ;; |
22 ;; Supports Epoch, Lucid Emacs, X, Sunview, NEXTSTEP, and Apollo DM | 22 ;; Supports Epoch, Lucid Emacs, X, Sunview, NEXTSTEP, and Apollo DM |
23 ;; window systems. | 23 ;; window systems. |
24 ;; | 24 ;; |
25 ;; `hmouse-shift-buttons' globally binds the Action and Assist Mouse Keys | 25 ;; 'hmouse-shift-buttons' globally binds the Action and Assist Mouse Keys |
26 ;; to either shifted or unshifted mouse buttons. | 26 ;; to either shifted or unshifted mouse buttons. |
27 ;; | 27 ;; |
28 ;; `hmouse-toggle-bindings' may be bound to a key. It switches between | 28 ;; 'hmouse-toggle-bindings' may be bound to a key. It switches between |
29 ;; the Hyperbole mouse bindings and previous mouse key bindings any time | 29 ;; the Hyperbole mouse bindings and previous mouse key bindings any time |
30 ;; after `hmouse-shift-buttons' has been called. | 30 ;; after 'hmouse-shift-buttons' has been called. |
31 ;; | 31 ;; |
32 ;; DESCRIP-END. | 32 ;; DESCRIP-END. |
33 | 33 |
34 ;;; ************************************************************************ | 34 ;;; ************************************************************************ |
35 ;;; Other required Elisp libraries | 35 ;;; Other required Elisp libraries |
41 | 41 |
42 ;;; ************************************************************************ | 42 ;;; ************************************************************************ |
43 ;;; Public variables | 43 ;;; Public variables |
44 ;;; ************************************************************************ | 44 ;;; ************************************************************************ |
45 | 45 |
46 (if (or hyperb:xemacs-p hyperb:emacs19-p) | 46 (eval (cdr (assoc hyperb:window-system |
47 ;; XEmacs and Emacs 19 pre-load their mouse libraries, so | 47 '( |
48 ;; we shouldn't have to require them here. | 48 ;; XEmacs and Emacs 19 pre-load their mouse libraries, so |
49 nil | 49 ;; we shouldn't have to require them here. |
50 (eval (cdr (assoc hyperb:window-system | 50 ;; |
51 '( | 51 ("xterm" . (require 'x-mouse)) ; X |
52 ("xterm" . (require 'x-mouse)) ; X | 52 ("epoch" . (require 'mouse)) ; UofI Epoch |
53 ("epoch" . (require 'mouse)) ; UofI Epoch | 53 ("next" . (load "eterm-fns" t)) ; NeXTstep |
54 ("next" . (load "eterm-fns" t)) ; NeXTstep | 54 ("sun" . (require 'sun-fns)) ; SunView |
55 ("sun" . (require 'sun-fns)) ; SunView | 55 ("apollo" . (require 'apollo)) ; Display Manager |
56 ("apollo" . (require 'apollo)) ; Display Manager | 56 )))) |
57 ))))) | |
58 | 57 |
59 ;;; ************************************************************************ | 58 ;;; ************************************************************************ |
60 ;;; Public functions | 59 ;;; Public functions |
61 ;;; ************************************************************************ | 60 ;;; ************************************************************************ |
62 | 61 |
63 (defun hmouse-set-bindings (key-binding-list) | 62 (defun hmouse-set-bindings (key-binding-list) |
64 "Sets mouse keys used as Smart Keys to bindings in KEY-BINDING-LIST. | 63 "Sets mouse keys used as Smart Keys to bindings in KEY-BINDING-LIST. |
65 KEY-BINDING-LIST is the value returned by 'hmouse-get-bindings' prior to | 64 KEY-BINDING-LIST is the value returned by 'hmouse-get-bindings' prior to |
66 Smart Key setup." | 65 Smart Key setup." |
67 (cond | 66 (cond |
68 ;; Do nothing when running in batch mode. | |
69 (noninteractive) | |
70 ;; | 67 ;; |
71 ;; GNU Emacs 19, Lucid Emacs, XEmacs or InfoDock | 68 ;; GNU Emacs 19, Lucid Emacs, XEmacs or InfoDock |
72 ((or hyperb:xemacs-p hyperb:emacs19-p (equal hyperb:window-system "lemacs")) | 69 ((or (if (not noninteractive) (or hyperb:xemacs-p hyperb:emacs19-p)) |
70 (equal hyperb:window-system "lemacs")) | |
73 (mapcar | 71 (mapcar |
74 (function | 72 (function |
75 (lambda (key-and-binding) | 73 (lambda (key-and-binding) |
76 (global-set-key (car key-and-binding) (cdr key-and-binding)))) | 74 (global-set-key (car key-and-binding) (cdr key-and-binding)))) |
77 key-binding-list)) | 75 key-binding-list)) |