diff options
| author | Stefan Monnier | 2001-07-17 18:37:47 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2001-07-17 18:37:47 +0000 |
| commit | acd9f40c0dddd49ceea38e8a4cbe588cc4c5393f (patch) | |
| tree | ffbe2c9f337181799b538a087f279f43cc5b7f60 | |
| parent | 232e274c6ef3a0d74be18cb1cacfa0073088fb07 (diff) | |
| download | emacs-acd9f40c0dddd49ceea38e8a4cbe588cc4c5393f.tar.gz emacs-acd9f40c0dddd49ceea38e8a4cbe588cc4c5393f.zip | |
(ignore-key, sun-esc-bracket, meta-flag): Remove.
(sun-raw-prefix): Replace t3, t4, t6, and t7 with f3, f4, f6 and f7.
Complete bindings for F<1..12> keys.
(global-map): Remove `undo' binding (already in the default).
Replace `t<n>' bindings with `f<n>' bindings.
| -rw-r--r-- | lisp/term/sun.el | 177 |
1 files changed, 87 insertions, 90 deletions
diff --git a/lisp/term/sun.el b/lisp/term/sun.el index 30b75e0afe3..b79311cf68e 100644 --- a/lisp/term/sun.el +++ b/lisp/term/sun.el | |||
| @@ -29,11 +29,6 @@ | |||
| 29 | 29 | ||
| 30 | ;;; Code: | 30 | ;;; Code: |
| 31 | 31 | ||
| 32 | (defun ignore-key () | ||
| 33 | "interactive version of ignore" | ||
| 34 | (interactive) | ||
| 35 | (ignore)) | ||
| 36 | |||
| 37 | (defun scroll-down-in-place (n) | 32 | (defun scroll-down-in-place (n) |
| 38 | (interactive "p") | 33 | (interactive "p") |
| 39 | (previous-line n) | 34 | (previous-line n) |
| @@ -56,6 +51,7 @@ | |||
| 56 | (interactive) | 51 | (interactive) |
| 57 | (if (zerop (minibuffer-depth)) | 52 | (if (zerop (minibuffer-depth)) |
| 58 | (repeat-complex-command 1) | 53 | (repeat-complex-command 1) |
| 54 | ;; FIXME: this function does not seem to exist. -stef'01 | ||
| 59 | (previous-complex-command 1))) | 55 | (previous-complex-command 1))) |
| 60 | 56 | ||
| 61 | (defun rerun-prev-command () | 57 | (defun rerun-prev-command () |
| @@ -88,16 +84,13 @@ | |||
| 88 | (interactive) | 84 | (interactive) |
| 89 | (re-search-backward (grep-arg))) | 85 | (re-search-backward (grep-arg))) |
| 90 | 86 | ||
| 91 | ;;; | 87 | ;; |
| 92 | ;;; handle sun's extra function keys | 88 | ;; handle sun's extra function keys |
| 93 | ;;; this version for those who run with standard .ttyswrc and no emacstool | 89 | ;; this version for those who run with standard .ttyswrc and no emacstool |
| 94 | ;;; | 90 | ;; |
| 95 | ;;; sunview picks up expose and open on the way UP, | 91 | ;; sunview picks up expose and open on the way UP, |
| 96 | ;;; so we ignore them on the way down | 92 | ;; so we ignore them on the way down |
| 97 | ;;; | 93 | ;; |
| 98 | |||
| 99 | (defvar sun-esc-bracket nil | ||
| 100 | "*If non-nil, rebind ESC [ as prefix for Sun function keys.") | ||
| 101 | 94 | ||
| 102 | (defvar sun-raw-prefix (make-sparse-keymap)) | 95 | (defvar sun-raw-prefix (make-sparse-keymap)) |
| 103 | (define-key function-key-map "\e[" sun-raw-prefix) | 96 | (define-key function-key-map "\e[" sun-raw-prefix) |
| @@ -112,16 +105,24 @@ | |||
| 112 | (define-key sun-raw-prefix "193z" [redo]) | 105 | (define-key sun-raw-prefix "193z" [redo]) |
| 113 | (define-key sun-raw-prefix "194z" [props]) | 106 | (define-key sun-raw-prefix "194z" [props]) |
| 114 | (define-key sun-raw-prefix "195z" [undo]) | 107 | (define-key sun-raw-prefix "195z" [undo]) |
| 115 | ; (define-key sun-raw-prefix "196z" 'ignore-key) ; Expose-down | 108 | ;; (define-key sun-raw-prefix "196z" 'ignore) ; Expose-down |
| 116 | ; (define-key sun-raw-prefix "197z" [put]) | 109 | ;; (define-key sun-raw-prefix "197z" [put]) |
| 117 | ; (define-key sun-raw-prefix "198z" 'ignore-key) ; Open-down | 110 | ;; (define-key sun-raw-prefix "198z" 'ignore) ; Open-down |
| 118 | ; (define-key sun-raw-prefix "199z" [get]) | 111 | ;; (define-key sun-raw-prefix "199z" [get]) |
| 119 | (define-key sun-raw-prefix "200z" [find]) | 112 | (define-key sun-raw-prefix "200z" [find]) |
| 120 | ; (define-key sun-raw-prefix "201z" 'kill-region-and-unmark) ; Delete | 113 | ;; (define-key sun-raw-prefix "201z" 'kill-region-and-unmark) ; Delete |
| 121 | (define-key sun-raw-prefix "226z" [t3]) | 114 | (define-key sun-raw-prefix "224z" [f1]) |
| 122 | (define-key sun-raw-prefix "227z" [t4]) | 115 | (define-key sun-raw-prefix "225z" [f2]) |
| 123 | (define-key sun-raw-prefix "229z" [t6]) | 116 | (define-key sun-raw-prefix "226z" [f3]) |
| 124 | (define-key sun-raw-prefix "230z" [t7]) | 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]) | ||
| 125 | (define-key sun-raw-prefix "A" [up]) ; R8 | 126 | (define-key sun-raw-prefix "A" [up]) ; R8 |
| 126 | (define-key sun-raw-prefix "B" [down]) ; R14 | 127 | (define-key sun-raw-prefix "B" [down]) ; R14 |
| 127 | (define-key sun-raw-prefix "C" [right]) ; R12 | 128 | (define-key sun-raw-prefix "C" [right]) ; R12 |
| @@ -134,59 +135,55 @@ | |||
| 134 | (global-set-key [r11] 'recenter) | 135 | (global-set-key [r11] 'recenter) |
| 135 | (global-set-key [r13] 'end-of-buffer) | 136 | (global-set-key [r13] 'end-of-buffer) |
| 136 | (global-set-key [r15] 'scroll-up) | 137 | (global-set-key [r15] 'scroll-up) |
| 137 | (global-set-key [redo] 'redraw-display) | 138 | (global-set-key [redo] 'redraw-display) ;FIXME: collides with default. |
| 138 | (global-set-key [props] 'list-buffers) | 139 | (global-set-key [props] 'list-buffers) |
| 139 | (global-set-key [undo] 'undo) | ||
| 140 | (global-set-key [put] 'sun-select-region) | 140 | (global-set-key [put] 'sun-select-region) |
| 141 | (global-set-key [get] 'sun-yank-selection) | 141 | (global-set-key [get] 'sun-yank-selection) |
| 142 | (global-set-key [find] 'exchange-point-and-mark) | 142 | (global-set-key [find] 'exchange-point-and-mark) |
| 143 | (global-set-key [t3] 'scroll-down-in-place) | 143 | (global-set-key [f3] 'scroll-down-in-place) |
| 144 | (global-set-key [t4] 'scroll-up-in-place) | 144 | (global-set-key [f4] 'scroll-up-in-place) |
| 145 | (global-set-key [t6] 'shrink-window) | 145 | (global-set-key [f6] 'shrink-window) |
| 146 | (global-set-key [t7] 'enlarge-window) | 146 | (global-set-key [f7] 'enlarge-window) |
| 147 | 147 | ||
| 148 | 148 | ||
| 149 | (if sun-esc-bracket (global-unset-key "\e[")) | 149 | ;; Since .emacs gets loaded before this file, a hook is supplied |
| 150 | 150 | ;; for you to put your own bindings in. | |
| 151 | ;;; Since .emacs gets loaded before this file, a hook is supplied | ||
| 152 | ;;; for you to put your own bindings in. | ||
| 153 | 151 | ||
| 154 | (defvar sun-raw-prefix-hooks nil | 152 | (defvar sun-raw-prefix-hooks nil |
| 155 | "List of forms to evaluate after setting sun-raw-prefix.") | 153 | "List of forms to evaluate after setting sun-raw-prefix.") |
| 156 | 154 | ||
| 157 | (let ((hooks sun-raw-prefix-hooks)) | 155 | (when sun-raw-prefix-hooks |
| 158 | (while hooks | 156 | (message "sun-raw-prefix-hooks is obsolete! Use term-setup-hook instead!") |
| 159 | (eval (car hooks)) | 157 | (let ((hooks sun-raw-prefix-hooks)) |
| 160 | (setq hooks (cdr hooks)) | 158 | (while hooks |
| 161 | )) | 159 | (eval (car hooks)) |
| 160 | (setq hooks (cdr hooks))))) | ||
| 162 | 161 | ||
| 163 | 162 | ||
| 164 | ;;; This section adds definitions for the emacstool users | 163 | ;;; This section adds definitions for the emacstool users |
| 165 | ;;; emacstool event filter converts function keys to C-x*{c}{lrt} | 164 | ;; emacstool event filter converts function keys to C-x*{c}{lrt} |
| 166 | ;;; | 165 | ;; |
| 167 | ;;; for example the Open key (L7) would be encoded as "\C-x*gl" | 166 | ;; for example the Open key (L7) would be encoded as "\C-x*gl" |
| 168 | ;;; the control, meta, and shift keys modify the character {lrt} | 167 | ;; the control, meta, and shift keys modify the character {lrt} |
| 169 | ;;; note that (unshifted) C-l is ",", C-r is "2", and C-t is "4" | 168 | ;; note that (unshifted) C-l is ",", C-r is "2", and C-t is "4" |
| 170 | ;;; | 169 | ;; |
| 171 | ;;; {c} is [a-j] for LEFT, [a-i] for TOP, [a-o] for RIGHT. | 170 | ;; {c} is [a-j] for LEFT, [a-i] for TOP, [a-o] for RIGHT. |
| 172 | ;;; A higher level insists on encoding {h,j,l,n}{r} (the arrow keys) | 171 | ;; A higher level insists on encoding {h,j,l,n}{r} (the arrow keys) |
| 173 | ;;; as ANSI escape sequences. Use the shell command | 172 | ;; as ANSI escape sequences. Use the shell command |
| 174 | ;;; % setkeys noarrows | 173 | ;; % setkeys noarrows |
| 175 | ;;; if you want these to come through for emacstool. | 174 | ;; if you want these to come through for emacstool. |
| 176 | ;;; | 175 | ;; |
| 177 | ;;; If you are not using EmacsTool, | 176 | ;; If you are not using EmacsTool, |
| 178 | ;;; you can also use this by creating a .ttyswrc file to do the conversion. | 177 | ;; you can also use this by creating a .ttyswrc file to do the conversion. |
| 179 | ;;; but it won't include the CONTROL, META, or SHIFT keys! | 178 | ;; but it won't include the CONTROL, META, or SHIFT keys! |
| 180 | ;;; | 179 | ;; |
| 181 | ;;; Important to define SHIFTed sequence before matching unshifted sequence. | 180 | ;; Important to define SHIFTed sequence before matching unshifted sequence. |
| 182 | ;;; (talk about bletcherous old uppercase terminal conventions!*$#@&%*&#$%) | 181 | ;; (talk about bletcherous old uppercase terminal conventions!*$#@&%*&#$%) |
| 183 | ;;; this is worse than C-S/C-Q flow control anyday! | 182 | ;; this is worse than C-S/C-Q flow control anyday! |
| 184 | ;;; Do *YOU* run in capslock mode? | 183 | ;; Do *YOU* run in capslock mode? |
| 185 | ;;; | 184 | ;; |
| 186 | 185 | ||
| 187 | ;;; Note: al, el and gl are trapped by EmacsTool, so they never make it here. | 186 | ;; Note: al, el and gl are trapped by EmacsTool, so they never make it here. |
| 188 | |||
| 189 | (defvar meta-flag t) | ||
| 190 | 187 | ||
| 191 | (defvar suntool-map (make-sparse-keymap) | 188 | (defvar suntool-map (make-sparse-keymap) |
| 192 | "*Keymap for Emacstool bindings.") | 189 | "*Keymap for Emacstool bindings.") |
| @@ -203,10 +200,10 @@ | |||
| 203 | (define-key suntool-map "bl" 'redraw-display) ; Again | 200 | (define-key suntool-map "bl" 'redraw-display) ; Again |
| 204 | (define-key suntool-map "cl" 'list-buffers) ; Props | 201 | (define-key suntool-map "cl" 'list-buffers) ; Props |
| 205 | (define-key suntool-map "dl" 'undo) ; Undo | 202 | (define-key suntool-map "dl" 'undo) ; Undo |
| 206 | (define-key suntool-map "el" 'ignore-key) ; Expose-Open | 203 | (define-key suntool-map "el" 'ignore) ; Expose-Open |
| 207 | (define-key suntool-map "fl" 'sun-select-region) ; Put | 204 | (define-key suntool-map "fl" 'sun-select-region) ; Put |
| 208 | (define-key suntool-map "f," 'copy-region-as-kill) ; C-Put | 205 | (define-key suntool-map "f," 'copy-region-as-kill) ; C-Put |
| 209 | (define-key suntool-map "gl" 'ignore-key) ; Open-Open | 206 | (define-key suntool-map "gl" 'ignore) ; Open-Open |
| 210 | (define-key suntool-map "hl" 'sun-yank-selection) ; Get | 207 | (define-key suntool-map "hl" 'sun-yank-selection) ; Get |
| 211 | (define-key suntool-map "h," 'yank) ; C-Get | 208 | (define-key suntool-map "h," 'yank) ; C-Get |
| 212 | (define-key suntool-map "il" 'research-forward) ; Find | 209 | (define-key suntool-map "il" 'research-forward) ; Find |
| @@ -214,41 +211,42 @@ | |||
| 214 | (define-key suntool-map "i\M-l" 'research-backward) ; M-Find | 211 | (define-key suntool-map "i\M-l" 'research-backward) ; M-Find |
| 215 | (define-key suntool-map "i\M-," 're-search-backward) ; C-M-Find | 212 | (define-key suntool-map "i\M-," 're-search-backward) ; C-M-Find |
| 216 | 213 | ||
| 217 | (define-key suntool-map "jL" 'yank) ; DELETE | 214 | (define-key suntool-map "jL" 'yank) ; DELETE |
| 218 | (define-key suntool-map "jl" 'kill-region-and-unmark) ; Delete | 215 | (define-key suntool-map "jl" 'kill-region-and-unmark) ; Delete |
| 219 | (define-key suntool-map "j\M-l" 'exchange-point-and-mark); M-Delete | 216 | (define-key suntool-map "j\M-l" 'exchange-point-and-mark); M-Delete |
| 220 | (define-key suntool-map "j," | 217 | (define-key suntool-map "j," |
| 221 | '(lambda () (interactive) (pop-mark 1))) ; C-Delete | 218 | (lambda () (interactive) (pop-mark))) ; C-Delete |
| 222 | 219 | ||
| 223 | (define-key suntool-map "fT" 'shrink-window-horizontally) ; T6 | 220 | (define-key suntool-map "fT" 'shrink-window-horizontally) ; T6 |
| 224 | (define-key suntool-map "gT" 'enlarge-window-horizontally) ; T7 | 221 | (define-key suntool-map "gT" 'enlarge-window-horizontally) ; T7 |
| 225 | (define-key suntool-map "ft" 'shrink-window) ; t6 | 222 | (define-key suntool-map "ft" 'shrink-window) ; t6 |
| 226 | (define-key suntool-map "gt" 'enlarge-window) ; t7 | 223 | (define-key suntool-map "gt" 'enlarge-window) ; t7 |
| 227 | (define-key suntool-map "cT" '(lambda(n) (interactive "p") (scroll-down n))) | 224 | (define-key suntool-map "cT" (lambda (n) (interactive "p") (scroll-down n))) |
| 228 | (define-key suntool-map "dT" '(lambda(n) (interactive "p") (scroll-up n))) | 225 | (define-key suntool-map "dT" (lambda (n) (interactive "p") (scroll-up n))) |
| 229 | (define-key suntool-map "ct" 'scroll-down-in-place) ; t3 | 226 | (define-key suntool-map "ct" 'scroll-down-in-place) ; t3 |
| 230 | (define-key suntool-map "dt" 'scroll-up-in-place) ; t4 | 227 | (define-key suntool-map "dt" 'scroll-up-in-place) ; t4 |
| 231 | (define-key ctl-x-map "*" suntool-map) | 228 | (define-key ctl-x-map "*" suntool-map) |
| 232 | 229 | ||
| 233 | ;;; Since .emacs gets loaded before this file, a hook is supplied | 230 | ;; Since .emacs gets loaded before this file, a hook is supplied |
| 234 | ;;; for you to put your own bindings in. | 231 | ;; for you to put your own bindings in. |
| 235 | 232 | ||
| 236 | (defvar suntool-map-hooks nil | 233 | (defvar suntool-map-hooks nil |
| 237 | "List of forms to evaluate after setting suntool-map.") | 234 | "List of forms to evaluate after setting suntool-map.") |
| 238 | 235 | ||
| 239 | (let ((hooks suntool-map-hooks)) | 236 | (when suntool-map-hooks |
| 240 | (while hooks | 237 | (message "suntool-map-hooks is obsolete! Use term-setup-hook instead!") |
| 241 | (eval (car hooks)) | 238 | (let ((hooks suntool-map-hooks)) |
| 242 | (setq hooks (cdr hooks)) | 239 | (while hooks |
| 243 | )) | 240 | (eval (car hooks)) |
| 244 | 241 | (setq hooks (cdr hooks))))) | |
| 245 | ;;; | 242 | |
| 246 | ;;; If running under emacstool, arrange to call suspend-emacstool | 243 | ;; |
| 247 | ;;; instead of suspend-emacs. | 244 | ;; If running under emacstool, arrange to call suspend-emacstool |
| 248 | ;;; | 245 | ;; instead of suspend-emacs. |
| 249 | ;;; First mouse blip is a clue that we are in emacstool. | 246 | ;; |
| 250 | ;;; | 247 | ;; First mouse blip is a clue that we are in emacstool. |
| 251 | ;;; C-x C-@ is the mouse command prefix. | 248 | ;; |
| 249 | ;; C-x C-@ is the mouse command prefix. | ||
| 252 | 250 | ||
| 253 | (autoload 'sun-mouse-handler "sun-mouse" | 251 | (autoload 'sun-mouse-handler "sun-mouse" |
| 254 | "Sun Emacstool handler for mouse blips (not loaded)." t) | 252 | "Sun Emacstool handler for mouse blips (not loaded)." t) |
| @@ -259,6 +257,7 @@ | |||
| 259 | (require 'sun-fns) | 257 | (require 'sun-fns) |
| 260 | (define-key ctl-x-map "\C-@" 'sun-mouse-handler) | 258 | (define-key ctl-x-map "\C-@" 'sun-mouse-handler) |
| 261 | 259 | ||
| 260 | ;; FIXME: this function does not seem to exist either. -stef'01 | ||
| 262 | (if (< (sun-window-init) 0) | 261 | (if (< (sun-window-init) 0) |
| 263 | (message "Not a Sun Window") | 262 | (message "Not a Sun Window") |
| 264 | (progn | 263 | (progn |
| @@ -266,15 +265,13 @@ | |||
| 266 | (substitute-key-definition 'suspend-emacs 'suspend-emacstool esc-map) | 265 | (substitute-key-definition 'suspend-emacs 'suspend-emacstool esc-map) |
| 267 | (substitute-key-definition 'suspend-emacs 'suspend-emacstool ctl-x-map)) | 266 | (substitute-key-definition 'suspend-emacs 'suspend-emacstool ctl-x-map)) |
| 268 | (send-string-to-terminal | 267 | (send-string-to-terminal |
| 269 | (concat "\033]lEmacstool - GNU Emacs " emacs-version "\033\\")) | 268 | (concat "\033]lEmacstool - GNU Emacs " emacs-version "\033\\")))) |
| 270 | )) | ||
| 271 | 269 | ||
| 272 | (defun sun-mouse-once () | 270 | (defun sun-mouse-once () |
| 273 | "Converts to emacstool and sun-mouse-handler on first mouse hit." | 271 | "Converts to emacstool and sun-mouse-handler on first mouse hit." |
| 274 | (interactive) | 272 | (interactive) |
| 275 | (emacstool-init) | 273 | (emacstool-init) |
| 276 | (sun-mouse-handler) ; Now, execute this mouse blip. | 274 | (sun-mouse-handler)) ; Now, execute this mouse blip. |
| 277 | ) | ||
| 278 | (define-key ctl-x-map "\C-@" 'sun-mouse-once) | 275 | (define-key ctl-x-map "\C-@" 'sun-mouse-once) |
| 279 | 276 | ||
| 280 | ;;; sun.el ends here | 277 | ;;; sun.el ends here |