comparison lisp/term/sun.el @ 88155:d7ddb3e565de

sync with trunk
author Henrik Enberg <henrik.enberg@telia.com>
date Mon, 16 Jan 2006 00:03:54 +0000
parents 5ade352e8d1c
children
comparison
equal deleted inserted replaced
88154:8ce476d3ba36 88155:d7ddb3e565de
1 ;;; sun.el --- keybinding for standard default sunterm keys 1 ;;; sun.el --- keybinding for standard default sunterm keys
2 2
3 ;; Copyright (C) 1987 Free Software Foundation, Inc. 3 ;; Copyright (C) 1987, 2001, 2002, 2003, 2004,
4 ;; 2005 Free Software Foundation, Inc.
4 5
5 ;; Author: Jeff Peck <peck@sun.com> 6 ;; Author: Jeff Peck <peck@sun.com>
6 ;; Keywords: terminals 7 ;; Keywords: terminals
7 8
8 ;; This file is part of GNU Emacs. 9 ;; This file is part of GNU Emacs.
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details. 19 ;; GNU General Public License for more details.
19 20
20 ;; You should have received a copy of the GNU General Public License 21 ;; 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 ;; along with GNU Emacs; see the file COPYING. If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 23 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 ;; Boston, MA 02111-1307, USA. 24 ;; Boston, MA 02110-1301, USA.
24 25
25 ;;; Commentary: 26 ;;; Commentary:
26 27
27 ;; The function key sequences for the console have been converted for 28 ;; The function key sequences for the console have been converted for
28 ;; use with function-key-map, but the *tool stuff hasn't been touched. 29 ;; use with function-key-map, but the *tool stuff hasn't been touched.
91 ;; sunview picks up expose and open on the way UP, 92 ;; sunview picks up expose and open on the way UP,
92 ;; so we ignore them on the way down 93 ;; so we ignore them on the way down
93 ;; 94 ;;
94 95
95 (defvar sun-raw-prefix (make-sparse-keymap)) 96 (defvar sun-raw-prefix (make-sparse-keymap))
96 (define-key function-key-map "\e[" sun-raw-prefix)
97
98 (define-key sun-raw-prefix "210z" [r3])
99 (define-key sun-raw-prefix "213z" [r6])
100 (define-key sun-raw-prefix "214z" [r7])
101 (define-key sun-raw-prefix "216z" [r9])
102 (define-key sun-raw-prefix "218z" [r11])
103 (define-key sun-raw-prefix "220z" [r13])
104 (define-key sun-raw-prefix "222z" [r15])
105 (define-key sun-raw-prefix "193z" [redo])
106 (define-key sun-raw-prefix "194z" [props])
107 (define-key sun-raw-prefix "195z" [undo])
108 ;; (define-key sun-raw-prefix "196z" 'ignore) ; Expose-down
109 ;; (define-key sun-raw-prefix "197z" [put])
110 ;; (define-key sun-raw-prefix "198z" 'ignore) ; Open-down
111 ;; (define-key sun-raw-prefix "199z" [get])
112 (define-key sun-raw-prefix "200z" [find])
113 ;; (define-key sun-raw-prefix "201z" 'kill-region-and-unmark) ; Delete
114 (define-key sun-raw-prefix "224z" [f1])
115 (define-key sun-raw-prefix "225z" [f2])
116 (define-key sun-raw-prefix "226z" [f3])
117 (define-key sun-raw-prefix "227z" [f4])
118 (define-key sun-raw-prefix "228z" [f5])
119 (define-key sun-raw-prefix "229z" [f6])
120 (define-key sun-raw-prefix "230z" [f7])
121 (define-key sun-raw-prefix "231z" [f8])
122 (define-key sun-raw-prefix "232z" [f9])
123 (define-key sun-raw-prefix "233z" [f10])
124 (define-key sun-raw-prefix "234z" [f11])
125 (define-key sun-raw-prefix "235z" [f12])
126 (define-key sun-raw-prefix "A" [up]) ; R8
127 (define-key sun-raw-prefix "B" [down]) ; R14
128 (define-key sun-raw-prefix "C" [right]) ; R12
129 (define-key sun-raw-prefix "D" [left]) ; R10
130
131 (global-set-key [r3] 'backward-page)
132 (global-set-key [r6] 'forward-page)
133 (global-set-key [r7] 'beginning-of-buffer)
134 (global-set-key [r9] 'scroll-down)
135 (global-set-key [r11] 'recenter)
136 (global-set-key [r13] 'end-of-buffer)
137 (global-set-key [r15] 'scroll-up)
138 (global-set-key [redo] 'redraw-display) ;FIXME: collides with default.
139 (global-set-key [props] 'list-buffers)
140 (global-set-key [put] 'sun-select-region)
141 (global-set-key [get] 'sun-yank-selection)
142 (global-set-key [find] 'exchange-point-and-mark)
143 (global-set-key [f3] 'scroll-down-in-place)
144 (global-set-key [f4] 'scroll-up-in-place)
145 (global-set-key [f6] 'shrink-window)
146 (global-set-key [f7] 'enlarge-window)
147
148 97
149 ;; Since .emacs gets loaded before this file, a hook is supplied 98 ;; Since .emacs gets loaded before this file, a hook is supplied
150 ;; for you to put your own bindings in. 99 ;; for you to put your own bindings in.
151 100
152 (defvar sun-raw-prefix-hooks nil 101 (defvar sun-raw-prefix-hooks nil
153 "List of forms to evaluate after setting sun-raw-prefix.") 102 "List of forms to evaluate after setting sun-raw-prefix.")
154
155 (when sun-raw-prefix-hooks
156 (message "sun-raw-prefix-hooks is obsolete! Use term-setup-hook instead!")
157 (let ((hooks sun-raw-prefix-hooks))
158 (while hooks
159 (eval (car hooks))
160 (setq hooks (cdr hooks)))))
161 103
162 104
163 ;;; This section adds definitions for the emacstool users 105 ;;; This section adds definitions for the emacstool users
164 ;; emacstool event filter converts function keys to C-x*{c}{lrt} 106 ;; emacstool event filter converts function keys to C-x*{c}{lrt}
165 ;; 107 ;;
186 ;; Note: al, el and gl are trapped by EmacsTool, so they never make it here. 128 ;; Note: al, el and gl are trapped by EmacsTool, so they never make it here.
187 129
188 (defvar suntool-map (make-sparse-keymap) 130 (defvar suntool-map (make-sparse-keymap)
189 "*Keymap for Emacstool bindings.") 131 "*Keymap for Emacstool bindings.")
190 132
191 (define-key suntool-map "gr" 'beginning-of-buffer) ; r7
192 (define-key suntool-map "iR" 'backward-page) ; R9
193 (define-key suntool-map "ir" 'scroll-down) ; r9
194 (define-key suntool-map "kr" 'recenter) ; r11
195 (define-key suntool-map "mr" 'end-of-buffer) ; r13
196 (define-key suntool-map "oR" 'forward-page) ; R15
197 (define-key suntool-map "or" 'scroll-up) ; r15
198 (define-key suntool-map "b\M-L" 'rerun-prev-command) ; M-AGAIN
199 (define-key suntool-map "b\M-l" 'prev-complex-command) ; M-Again
200 (define-key suntool-map "bl" 'redraw-display) ; Again
201 (define-key suntool-map "cl" 'list-buffers) ; Props
202 (define-key suntool-map "dl" 'undo) ; Undo
203 (define-key suntool-map "el" 'ignore) ; Expose-Open
204 (define-key suntool-map "fl" 'sun-select-region) ; Put
205 (define-key suntool-map "f," 'copy-region-as-kill) ; C-Put
206 (define-key suntool-map "gl" 'ignore) ; Open-Open
207 (define-key suntool-map "hl" 'sun-yank-selection) ; Get
208 (define-key suntool-map "h," 'yank) ; C-Get
209 (define-key suntool-map "il" 'research-forward) ; Find
210 (define-key suntool-map "i," 're-search-forward) ; C-Find
211 (define-key suntool-map "i\M-l" 'research-backward) ; M-Find
212 (define-key suntool-map "i\M-," 're-search-backward) ; C-M-Find
213
214 (define-key suntool-map "jL" 'yank) ; DELETE
215 (define-key suntool-map "jl" 'kill-region-and-unmark) ; Delete
216 (define-key suntool-map "j\M-l" 'exchange-point-and-mark); M-Delete
217 (define-key suntool-map "j,"
218 (lambda () (interactive) (pop-mark))) ; C-Delete
219
220 (define-key suntool-map "fT" 'shrink-window-horizontally) ; T6
221 (define-key suntool-map "gT" 'enlarge-window-horizontally) ; T7
222 (define-key suntool-map "ft" 'shrink-window) ; t6
223 (define-key suntool-map "gt" 'enlarge-window) ; t7
224 (define-key suntool-map "cT" (lambda (n) (interactive "p") (scroll-down n)))
225 (define-key suntool-map "dT" (lambda (n) (interactive "p") (scroll-up n)))
226 (define-key suntool-map "ct" 'scroll-down-in-place) ; t3
227 (define-key suntool-map "dt" 'scroll-up-in-place) ; t4
228 (define-key ctl-x-map "*" suntool-map)
229 133
230 ;; Since .emacs gets loaded before this file, a hook is supplied 134 ;; Since .emacs gets loaded before this file, a hook is supplied
231 ;; for you to put your own bindings in. 135 ;; for you to put your own bindings in.
232 136
233 (defvar suntool-map-hooks nil 137 (defvar suntool-map-hooks nil
234 "List of forms to evaluate after setting suntool-map.") 138 "List of forms to evaluate after setting suntool-map.")
235 139
236 (when suntool-map-hooks
237 (message "suntool-map-hooks is obsolete! Use term-setup-hook instead!")
238 (let ((hooks suntool-map-hooks))
239 (while hooks
240 (eval (car hooks))
241 (setq hooks (cdr hooks)))))
242
243 ;; 140 ;;
244 ;; If running under emacstool, arrange to call suspend-emacstool 141 ;; If running under emacstool, arrange to call suspend-emacstool
245 ;; instead of suspend-emacs. 142 ;; instead of suspend-emacs.
246 ;; 143 ;;
247 ;; First mouse blip is a clue that we are in emacstool. 144 ;; First mouse blip is a clue that we are in emacstool.
248 ;; 145 ;;
249 ;; C-x C-@ is the mouse command prefix. 146 ;; C-x C-@ is the mouse command prefix.
250 147
251 (autoload 'sun-mouse-handler "sun-mouse" 148 (autoload 'sun-mouse-handler "sun-mouse"
252 "Sun Emacstool handler for mouse blips (not loaded)." t) 149 "Sun Emacstool handler for mouse blips (not loaded)." t)
150
151 (defun terminal-init-sun ()
152 "Terminal initialization function for sun."
153 (define-key function-key-map "\e[" sun-raw-prefix)
154
155 (define-key sun-raw-prefix "210z" [r3])
156 (define-key sun-raw-prefix "213z" [r6])
157 (define-key sun-raw-prefix "214z" [r7])
158 (define-key sun-raw-prefix "216z" [r9])
159 (define-key sun-raw-prefix "218z" [r11])
160 (define-key sun-raw-prefix "220z" [r13])
161 (define-key sun-raw-prefix "222z" [r15])
162 (define-key sun-raw-prefix "193z" [redo])
163 (define-key sun-raw-prefix "194z" [props])
164 (define-key sun-raw-prefix "195z" [undo])
165 ;; (define-key sun-raw-prefix "196z" 'ignore) ; Expose-down
166 ;; (define-key sun-raw-prefix "197z" [put])
167 ;; (define-key sun-raw-prefix "198z" 'ignore) ; Open-down
168 ;; (define-key sun-raw-prefix "199z" [get])
169 (define-key sun-raw-prefix "200z" [find])
170 ;; (define-key sun-raw-prefix "201z" 'kill-region-and-unmark) ; Delete
171 (define-key sun-raw-prefix "224z" [f1])
172 (define-key sun-raw-prefix "225z" [f2])
173 (define-key sun-raw-prefix "226z" [f3])
174 (define-key sun-raw-prefix "227z" [f4])
175 (define-key sun-raw-prefix "228z" [f5])
176 (define-key sun-raw-prefix "229z" [f6])
177 (define-key sun-raw-prefix "230z" [f7])
178 (define-key sun-raw-prefix "231z" [f8])
179 (define-key sun-raw-prefix "232z" [f9])
180 (define-key sun-raw-prefix "233z" [f10])
181 (define-key sun-raw-prefix "234z" [f11])
182 (define-key sun-raw-prefix "235z" [f12])
183 (define-key sun-raw-prefix "A" [up]) ; R8
184 (define-key sun-raw-prefix "B" [down]) ; R14
185 (define-key sun-raw-prefix "C" [right]) ; R12
186 (define-key sun-raw-prefix "D" [left]) ; R10
187
188 (global-set-key [r3] 'backward-page)
189 (global-set-key [r6] 'forward-page)
190 (global-set-key [r7] 'beginning-of-buffer)
191 (global-set-key [r9] 'scroll-down)
192 (global-set-key [r11] 'recenter)
193 (global-set-key [r13] 'end-of-buffer)
194 (global-set-key [r15] 'scroll-up)
195 (global-set-key [redo] 'redraw-display) ;FIXME: collides with default.
196 (global-set-key [props] 'list-buffers)
197 (global-set-key [put] 'sun-select-region)
198 (global-set-key [get] 'sun-yank-selection)
199 (global-set-key [find] 'exchange-point-and-mark)
200 (global-set-key [f3] 'scroll-down-in-place)
201 (global-set-key [f4] 'scroll-up-in-place)
202 (global-set-key [f6] 'shrink-window)
203 (global-set-key [f7] 'enlarge-window)
204
205 (when sun-raw-prefix-hooks
206 (message "sun-raw-prefix-hooks is obsolete! Use term-setup-hook instead!")
207 (let ((hooks sun-raw-prefix-hooks))
208 (while hooks
209 (eval (car hooks))
210 (setq hooks (cdr hooks)))))
211
212 (define-key suntool-map "gr" 'beginning-of-buffer) ; r7
213 (define-key suntool-map "iR" 'backward-page) ; R9
214 (define-key suntool-map "ir" 'scroll-down) ; r9
215 (define-key suntool-map "kr" 'recenter) ; r11
216 (define-key suntool-map "mr" 'end-of-buffer) ; r13
217 (define-key suntool-map "oR" 'forward-page) ; R15
218 (define-key suntool-map "or" 'scroll-up) ; r15
219 (define-key suntool-map "b\M-L" 'rerun-prev-command) ; M-AGAIN
220 (define-key suntool-map "b\M-l" 'prev-complex-command) ; M-Again
221 (define-key suntool-map "bl" 'redraw-display) ; Again
222 (define-key suntool-map "cl" 'list-buffers) ; Props
223 (define-key suntool-map "dl" 'undo) ; Undo
224 (define-key suntool-map "el" 'ignore) ; Expose-Open
225 (define-key suntool-map "fl" 'sun-select-region) ; Put
226 (define-key suntool-map "f," 'copy-region-as-kill) ; C-Put
227 (define-key suntool-map "gl" 'ignore) ; Open-Open
228 (define-key suntool-map "hl" 'sun-yank-selection) ; Get
229 (define-key suntool-map "h," 'yank) ; C-Get
230 (define-key suntool-map "il" 'research-forward) ; Find
231 (define-key suntool-map "i," 're-search-forward) ; C-Find
232 (define-key suntool-map "i\M-l" 'research-backward) ; M-Find
233 (define-key suntool-map "i\M-," 're-search-backward) ; C-M-Find
234
235 (define-key suntool-map "jL" 'yank) ; DELETE
236 (define-key suntool-map "jl" 'kill-region-and-unmark) ; Delete
237 (define-key suntool-map "j\M-l" 'exchange-point-and-mark) ; M-Delete
238 (define-key suntool-map "j,"
239 (lambda () (interactive) (pop-mark))) ; C-Delete
240
241 (define-key suntool-map "fT" 'shrink-window-horizontally) ; T6
242 (define-key suntool-map "gT" 'enlarge-window-horizontally) ; T7
243 (define-key suntool-map "ft" 'shrink-window) ; t6
244 (define-key suntool-map "gt" 'enlarge-window) ; t7
245 (define-key suntool-map "cT" (lambda (n) (interactive "p") (scroll-down n)))
246 (define-key suntool-map "dT" (lambda (n) (interactive "p") (scroll-up n)))
247 (define-key suntool-map "ct" 'scroll-down-in-place) ; t3
248 (define-key suntool-map "dt" 'scroll-up-in-place) ; t4
249 (define-key ctl-x-map "*" suntool-map)
250
251 (when suntool-map-hooks
252 (message "suntool-map-hooks is obsolete! Use term-setup-hook instead!")
253 (let ((hooks suntool-map-hooks))
254 (while hooks
255 (eval (car hooks))
256 (setq hooks (cdr hooks)))))
257
258 (define-key ctl-x-map "\C-@" 'sun-mouse-once))
253 259
254 (defun emacstool-init () 260 (defun emacstool-init ()
255 "Set up Emacstool window, if you know you are in an emacstool." 261 "Set up Emacstool window, if you know you are in an emacstool."
256 ;; Make sure sun-mouse and sun-fns are loaded. 262 ;; Make sure sun-mouse and sun-fns are loaded.
257 (require 'sun-fns) 263 (require 'sun-fns)
270 (defun sun-mouse-once () 276 (defun sun-mouse-once ()
271 "Converts to emacstool and sun-mouse-handler on first mouse hit." 277 "Converts to emacstool and sun-mouse-handler on first mouse hit."
272 (interactive) 278 (interactive)
273 (emacstool-init) 279 (emacstool-init)
274 (sun-mouse-handler)) ; Now, execute this mouse blip. 280 (sun-mouse-handler)) ; Now, execute this mouse blip.
275 (define-key ctl-x-map "\C-@" 'sun-mouse-once) 281
276 282 ;;; arch-tag: db761d47-fd7d-42b4-aae1-04fa116b6ba6
277 ;;; sun.el ends here 283 ;;; sun.el ends here