comparison lisp/hyperbole/hmouse-key.el @ 24:4103f0995bd7 r19-15b95

Import from CVS: tag r19-15b95
author cvs
date Mon, 13 Aug 2007 08:51:03 +0200
parents 376386a54a3c
children 131b0175ea99
comparison
equal deleted inserted replaced
23:0edd3412f124 24:4103f0995bd7
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: Motorola, Inc., PPG 9 ;; ORG: InfoDock Associates
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: 14-Sep-95 at 18:35:17 by Bob Weiner 12 ;; LAST-MOD: 21-Feb-97 at 18:03:12 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, Free Software Foundation, Inc. 17 ;; Copyright (C) 1994-1995, 1997 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 (eval (cdr (assoc hyperb:window-system 46 (if (or hyperb:xemacs-p hyperb:emacs19-p)
47 '( 47 ;; XEmacs and Emacs 19 pre-load their mouse libraries, so
48 ;; XEmacs and Emacs 19 pre-load their mouse libraries, so 48 ;; we shouldn't have to require them here.
49 ;; we shouldn't have to require them here. 49 nil
50 ;; 50 (eval (cdr (assoc hyperb:window-system
51 ("xterm" . (require 'x-mouse)) ; X 51 '(
52 ("epoch" . (require 'mouse)) ; UofI Epoch 52 ("xterm" . (require 'x-mouse)) ; X
53 ("next" . (load "eterm-fns" t)) ; NeXTstep 53 ("epoch" . (require 'mouse)) ; UofI Epoch
54 ("sun" . (require 'sun-fns)) ; SunView 54 ("next" . (load "eterm-fns" t)) ; NeXTstep
55 ("apollo" . (require 'apollo)) ; Display Manager 55 ("sun" . (require 'sun-fns)) ; SunView
56 )))) 56 ("apollo" . (require 'apollo)) ; Display Manager
57 )))))
57 58
58 ;;; ************************************************************************ 59 ;;; ************************************************************************
59 ;;; Public functions 60 ;;; Public functions
60 ;;; ************************************************************************ 61 ;;; ************************************************************************
61 62
62 (defun hmouse-set-bindings (key-binding-list) 63 (defun hmouse-set-bindings (key-binding-list)
63 "Sets mouse keys used as Smart Keys to bindings in KEY-BINDING-LIST. 64 "Sets mouse keys used as Smart Keys to bindings in KEY-BINDING-LIST.
64 KEY-BINDING-LIST is the value returned by 'hmouse-get-bindings' prior to 65 KEY-BINDING-LIST is the value returned by 'hmouse-get-bindings' prior to
65 Smart Key setup." 66 Smart Key setup."
66 (cond 67 (cond
68 ;; Do nothing when running in batch mode.
69 (noninteractive)
67 ;; 70 ;;
68 ;; GNU Emacs 19, Lucid Emacs, XEmacs or InfoDock 71 ;; GNU Emacs 19, Lucid Emacs, XEmacs or InfoDock
69 ((or (if (not noninteractive) (or hyperb:xemacs-p hyperb:emacs19-p)) 72 ((or hyperb:xemacs-p hyperb:emacs19-p (equal hyperb:window-system "lemacs"))
70 (equal hyperb:window-system "lemacs"))
71 (mapcar 73 (mapcar
72 (function 74 (function
73 (lambda (key-and-binding) 75 (lambda (key-and-binding)
74 (global-set-key (car key-and-binding) (cdr key-and-binding)))) 76 (global-set-key (car key-and-binding) (cdr key-and-binding))))
75 key-binding-list)) 77 key-binding-list))