Mercurial > emacs
annotate lisp/term/sun.el @ 61857:7b4e7e55f61b
(python-mode): Use new name eldoc-documentation-function.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 26 Apr 2005 11:01:52 +0000 |
parents | 695cf19ef79e |
children | eaa9acd9122c 8e357d90cc9f 375f2633d815 |
rev | line source |
---|---|
17517 | 1 ;;; sun.el --- keybinding for standard default sunterm keys |
2140
c049f2ca31f6
Added headers, removed function-key bindings.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
498
diff
changeset
|
2 |
14170 | 3 ;; Copyright (C) 1987 Free Software Foundation, Inc. |
4 | |
2140
c049f2ca31f6
Added headers, removed function-key bindings.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
498
diff
changeset
|
5 ;; Author: Jeff Peck <peck@sun.com> |
c049f2ca31f6
Added headers, removed function-key bindings.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
498
diff
changeset
|
6 ;; Keywords: terminals |
c049f2ca31f6
Added headers, removed function-key bindings.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
498
diff
changeset
|
7 |
14170 | 8 ;; This file is part of GNU Emacs. |
9 | |
10 ;; GNU Emacs 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) | |
13 ;; any later version. | |
466 | 14 |
14170 | 15 ;; GNU Emacs 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. | |
19 | |
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. | |
466 | 24 |
2140
c049f2ca31f6
Added headers, removed function-key bindings.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
498
diff
changeset
|
25 ;;; Commentary: |
466 | 26 |
27 ;; 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 | |
2140
c049f2ca31f6
Added headers, removed function-key bindings.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
498
diff
changeset
|
30 ;;; Code: |
466 | 31 |
32 (defun scroll-down-in-place (n) | |
33 (interactive "p") | |
34 (previous-line n) | |
35 (scroll-down n)) | |
36 | |
37 (defun scroll-up-in-place (n) | |
38 (interactive "p") | |
39 (next-line n) | |
40 (scroll-up n)) | |
41 | |
42 (defun kill-region-and-unmark (beg end) | |
43 "Like kill-region, but pops the mark [which equals point, anyway.]" | |
44 (interactive "r") | |
45 (kill-region beg end) | |
46 (setq this-command 'kill-region-and-unmark) | |
47 (set-mark-command t)) | |
48 | |
49 (defun select-previous-complex-command () | |
50 "Select Previous-complex-command" | |
51 (interactive) | |
52 (if (zerop (minibuffer-depth)) | |
53 (repeat-complex-command 1) | |
38475
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
54 ;; FIXME: this function does not seem to exist. -stef'01 |
466 | 55 (previous-complex-command 1))) |
56 | |
57 (defun rerun-prev-command () | |
58 "Repeat Previous-complex-command." | |
59 (interactive) | |
60 (eval (nth 0 command-history))) | |
61 | |
62 (defvar grep-arg nil "Default arg for RE-search") | |
63 (defun grep-arg () | |
64 (if (memq last-command '(research-forward research-backward)) grep-arg | |
65 (let* ((command (car command-history)) | |
66 (command-name (symbol-name (car command))) | |
67 (search-arg (car (cdr command))) | |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
38475
diff
changeset
|
68 (search-command |
466 | 69 (and command-name (string-match "search" command-name))) |
70 ) | |
71 (if (and search-command (stringp search-arg)) (setq grep-arg search-arg) | |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
38475
diff
changeset
|
72 (setq search-command this-command |
466 | 73 grep-arg (read-string "REsearch: " grep-arg) |
74 this-command search-command) | |
75 grep-arg)))) | |
76 | |
77 (defun research-forward () | |
78 "Repeat RE search forward." | |
79 (interactive) | |
80 (re-search-forward (grep-arg))) | |
81 | |
82 (defun research-backward () | |
83 "Repeat RE search backward." | |
84 (interactive) | |
85 (re-search-backward (grep-arg))) | |
86 | |
38475
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
87 ;; |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
88 ;; handle sun's extra function keys |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
89 ;; this version for those who run with standard .ttyswrc and no emacstool |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
90 ;; |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
38475
diff
changeset
|
91 ;; sunview picks up expose and open on the way UP, |
38475
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
92 ;; so we ignore them on the way down |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
93 ;; |
466 | 94 |
5029
c02c789d39d7
(sun-raw-prefix): Make this just a variable, not a function name.
Richard M. Stallman <rms@gnu.org>
parents:
3287
diff
changeset
|
95 (defvar sun-raw-prefix (make-sparse-keymap)) |
c02c789d39d7
(sun-raw-prefix): Make this just a variable, not a function name.
Richard M. Stallman <rms@gnu.org>
parents:
3287
diff
changeset
|
96 (define-key function-key-map "\e[" sun-raw-prefix) |
466 | 97 |
498 | 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]) | |
2140
c049f2ca31f6
Added headers, removed function-key bindings.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
498
diff
changeset
|
105 (define-key sun-raw-prefix "193z" [redo]) |
498 | 106 (define-key sun-raw-prefix "194z" [props]) |
107 (define-key sun-raw-prefix "195z" [undo]) | |
38475
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
108 ;; (define-key sun-raw-prefix "196z" 'ignore) ; Expose-down |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
109 ;; (define-key sun-raw-prefix "197z" [put]) |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
110 ;; (define-key sun-raw-prefix "198z" 'ignore) ; Open-down |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
111 ;; (define-key sun-raw-prefix "199z" [get]) |
498 | 112 (define-key sun-raw-prefix "200z" [find]) |
38475
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
113 ;; (define-key sun-raw-prefix "201z" 'kill-region-and-unmark) ; Delete |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
114 (define-key sun-raw-prefix "224z" [f1]) |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
115 (define-key sun-raw-prefix "225z" [f2]) |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
116 (define-key sun-raw-prefix "226z" [f3]) |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
117 (define-key sun-raw-prefix "227z" [f4]) |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
118 (define-key sun-raw-prefix "228z" [f5]) |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
119 (define-key sun-raw-prefix "229z" [f6]) |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
120 (define-key sun-raw-prefix "230z" [f7]) |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
121 (define-key sun-raw-prefix "231z" [f8]) |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
122 (define-key sun-raw-prefix "232z" [f9]) |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
123 (define-key sun-raw-prefix "233z" [f10]) |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
124 (define-key sun-raw-prefix "234z" [f11]) |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
125 (define-key sun-raw-prefix "235z" [f12]) |
498 | 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 | |
466 | 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) | |
38475
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
138 (global-set-key [redo] 'redraw-display) ;FIXME: collides with default. |
466 | 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) | |
38475
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
143 (global-set-key [f3] 'scroll-down-in-place) |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
144 (global-set-key [f4] 'scroll-up-in-place) |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
145 (global-set-key [f6] 'shrink-window) |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
146 (global-set-key [f7] 'enlarge-window) |
466 | 147 |
148 | |
38475
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
149 ;; Since .emacs gets loaded before this file, a hook is supplied |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
150 ;; for you to put your own bindings in. |
466 | 151 |
498 | 152 (defvar sun-raw-prefix-hooks nil |
153 "List of forms to evaluate after setting sun-raw-prefix.") | |
466 | 154 |
38475
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
155 (when sun-raw-prefix-hooks |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
156 (message "sun-raw-prefix-hooks is obsolete! Use term-setup-hook instead!") |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
157 (let ((hooks sun-raw-prefix-hooks)) |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
158 (while hooks |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
159 (eval (car hooks)) |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
160 (setq hooks (cdr hooks))))) |
466 | 161 |
162 | |
2140
c049f2ca31f6
Added headers, removed function-key bindings.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
498
diff
changeset
|
163 ;;; This section adds definitions for the emacstool users |
38475
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
164 ;; emacstool event filter converts function keys to C-x*{c}{lrt} |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
165 ;; |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
166 ;; for example the Open key (L7) would be encoded as "\C-x*gl" |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
167 ;; the control, meta, and shift keys modify the character {lrt} |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
168 ;; note that (unshifted) C-l is ",", C-r is "2", and C-t is "4" |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
169 ;; |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
170 ;; {c} is [a-j] for LEFT, [a-i] for TOP, [a-o] for RIGHT. |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
171 ;; A higher level insists on encoding {h,j,l,n}{r} (the arrow keys) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
38475
diff
changeset
|
172 ;; as ANSI escape sequences. Use the shell command |
38475
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
173 ;; % setkeys noarrows |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
174 ;; if you want these to come through for emacstool. |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
175 ;; |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
38475
diff
changeset
|
176 ;; If you are not using EmacsTool, |
38475
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
177 ;; you can also use this by creating a .ttyswrc file to do the conversion. |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
178 ;; but it won't include the CONTROL, META, or SHIFT keys! |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
179 ;; |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
180 ;; Important to define SHIFTed sequence before matching unshifted sequence. |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
181 ;; (talk about bletcherous old uppercase terminal conventions!*$#@&%*&#$%) |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
182 ;; this is worse than C-S/C-Q flow control anyday! |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
183 ;; Do *YOU* run in capslock mode? |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
184 ;; |
466 | 185 |
38475
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
186 ;; Note: al, el and gl are trapped by EmacsTool, so they never make it here. |
466 | 187 |
188 (defvar suntool-map (make-sparse-keymap) | |
189 "*Keymap for Emacstool bindings.") | |
190 | |
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 | |
38475
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
203 (define-key suntool-map "el" 'ignore) ; Expose-Open |
466 | 204 (define-key suntool-map "fl" 'sun-select-region) ; Put |
205 (define-key suntool-map "f," 'copy-region-as-kill) ; C-Put | |
38475
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
206 (define-key suntool-map "gl" 'ignore) ; Open-Open |
466 | 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 | |
38475
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
214 (define-key suntool-map "jL" 'yank) ; DELETE |
466 | 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 | |
38475
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
217 (define-key suntool-map "j," |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
218 (lambda () (interactive) (pop-mark))) ; C-Delete |
466 | 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 | |
38475
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
224 (define-key suntool-map "cT" (lambda (n) (interactive "p") (scroll-down n))) |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
225 (define-key suntool-map "dT" (lambda (n) (interactive "p") (scroll-up n))) |
466 | 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 | |
38475
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
230 ;; Since .emacs gets loaded before this file, a hook is supplied |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
231 ;; for you to put your own bindings in. |
466 | 232 |
233 (defvar suntool-map-hooks nil | |
234 "List of forms to evaluate after setting suntool-map.") | |
235 | |
38475
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
236 (when suntool-map-hooks |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
237 (message "suntool-map-hooks is obsolete! Use term-setup-hook instead!") |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
238 (let ((hooks suntool-map-hooks)) |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
239 (while hooks |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
240 (eval (car hooks)) |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
241 (setq hooks (cdr hooks))))) |
466 | 242 |
38475
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
243 ;; |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
244 ;; If running under emacstool, arrange to call suspend-emacstool |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
245 ;; instead of suspend-emacs. |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
246 ;; |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
247 ;; First mouse blip is a clue that we are in emacstool. |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
248 ;; |
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
249 ;; C-x C-@ is the mouse command prefix. |
466 | 250 |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
38475
diff
changeset
|
251 (autoload 'sun-mouse-handler "sun-mouse" |
466 | 252 "Sun Emacstool handler for mouse blips (not loaded)." t) |
253 | |
254 (defun emacstool-init () | |
255 "Set up Emacstool window, if you know you are in an emacstool." | |
256 ;; Make sure sun-mouse and sun-fns are loaded. | |
257 (require 'sun-fns) | |
258 (define-key ctl-x-map "\C-@" 'sun-mouse-handler) | |
259 | |
38475
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
260 ;; FIXME: this function does not seem to exist either. -stef'01 |
466 | 261 (if (< (sun-window-init) 0) |
262 (message "Not a Sun Window") | |
263 (progn | |
264 (substitute-key-definition 'suspend-emacs 'suspend-emacstool global-map) | |
265 (substitute-key-definition 'suspend-emacs 'suspend-emacstool esc-map) | |
266 (substitute-key-definition 'suspend-emacs 'suspend-emacstool ctl-x-map)) | |
267 (send-string-to-terminal | |
38475
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
268 (concat "\033]lEmacstool - GNU Emacs " emacs-version "\033\\")))) |
466 | 269 |
270 (defun sun-mouse-once () | |
271 "Converts to emacstool and sun-mouse-handler on first mouse hit." | |
272 (interactive) | |
273 (emacstool-init) | |
38475
916f157c7118
(ignore-key, sun-esc-bracket, meta-flag): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
17517
diff
changeset
|
274 (sun-mouse-handler)) ; Now, execute this mouse blip. |
466 | 275 (define-key ctl-x-map "\C-@" 'sun-mouse-once) |
2140
c049f2ca31f6
Added headers, removed function-key bindings.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
498
diff
changeset
|
276 |
52401 | 277 ;;; arch-tag: db761d47-fd7d-42b4-aae1-04fa116b6ba6 |
2140
c049f2ca31f6
Added headers, removed function-key bindings.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
498
diff
changeset
|
278 ;;; sun.el ends here |