Mercurial > hg > xemacs-beta
comparison lisp/term/sun.el @ 444:576fb035e263 r21-2-37
Import from CVS: tag r21-2-37
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:36:19 +0200 |
parents | 3ecd8885ac67 |
children |
comparison
equal
deleted
inserted
replaced
443:a8296e22da4e | 444:576fb035e263 |
---|---|
41 (defun scroll-up-in-place (n) | 41 (defun scroll-up-in-place (n) |
42 (interactive "p") | 42 (interactive "p") |
43 (next-line n) | 43 (next-line n) |
44 (scroll-up n)) | 44 (scroll-up n)) |
45 | 45 |
46 (defun kill-region-and-unmark (beg end) | 46 (defun kill-region-and-unmark (start end) |
47 "Like kill-region, but pops the mark [which equals point, anyway.]" | 47 "Like kill-region, but pops the mark [which equals point, anyway.]" |
48 (interactive "r") | 48 (interactive "r") |
49 (kill-region beg end) | 49 (kill-region start end) |
50 (setq this-command 'kill-region-and-unmark) | 50 (setq this-command 'kill-region-and-unmark) |
51 (set-mark-command t)) | 51 (set-mark-command t)) |
52 | 52 |
53 (defun select-previous-complex-command () | 53 (defun select-previous-complex-command () |
54 "Select Previous-complex-command" | 54 "Select Previous-complex-command" |
66 (defun grep-arg () | 66 (defun grep-arg () |
67 (if (memq last-command '(research-forward research-backward)) grep-arg | 67 (if (memq last-command '(research-forward research-backward)) grep-arg |
68 (let* ((command (car command-history)) | 68 (let* ((command (car command-history)) |
69 (command-name (symbol-name (car command))) | 69 (command-name (symbol-name (car command))) |
70 (search-arg (car (cdr command))) | 70 (search-arg (car (cdr command))) |
71 (search-command | 71 (search-command |
72 (and command-name (string-match "search" command-name))) | 72 (and command-name (string-match "search" command-name))) |
73 ) | 73 ) |
74 (if (and search-command (stringp search-arg)) (setq grep-arg search-arg) | 74 (if (and search-command (stringp search-arg)) (setq grep-arg search-arg) |
75 (setq search-command this-command | 75 (setq search-command this-command |
76 grep-arg (read-string "REsearch: " grep-arg) | 76 grep-arg (read-string "REsearch: " grep-arg) |
77 this-command search-command) | 77 this-command search-command) |
78 grep-arg)))) | 78 grep-arg)))) |
79 | 79 |
80 (defun research-forward () | 80 (defun research-forward () |
89 | 89 |
90 ;;; | 90 ;;; |
91 ;;; handle sun's extra function keys | 91 ;;; handle sun's extra function keys |
92 ;;; this version for those who run with standard .ttyswrc and no emacstool | 92 ;;; this version for those who run with standard .ttyswrc and no emacstool |
93 ;;; | 93 ;;; |
94 ;;; sunview picks up expose and open on the way UP, | 94 ;;; sunview picks up expose and open on the way UP, |
95 ;;; so we ignore them on the way down | 95 ;;; so we ignore them on the way down |
96 ;;; | 96 ;;; |
97 | 97 |
98 (defvar sun-esc-bracket nil | 98 (defvar sun-esc-bracket nil |
99 "*If non-nil, rebind ESC [ as prefix for Sun function keys.") | 99 "*If non-nil, rebind ESC [ as prefix for Sun function keys.") |
167 ;;; the control, meta, and shift keys modify the character {lrt} | 167 ;;; the control, meta, and shift keys modify the character {lrt} |
168 ;;; 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" |
169 ;;; | 169 ;;; |
170 ;;; {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. |
171 ;;; 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) |
172 ;;; as ANSI escape sequences. Use the shell command | 172 ;;; as ANSI escape sequences. Use the shell command |
173 ;;; % setkeys noarrows | 173 ;;; % setkeys noarrows |
174 ;;; if you want these to come through for emacstool. | 174 ;;; if you want these to come through for emacstool. |
175 ;;; | 175 ;;; |
176 ;;; If you are not using EmacsTool, | 176 ;;; If you are not using EmacsTool, |
177 ;;; 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. |
178 ;;; but it won't include the CONTROL, META, or SHIFT keys! | 178 ;;; but it won't include the CONTROL, META, or SHIFT keys! |
179 ;;; | 179 ;;; |
180 ;;; Important to define SHIFTed sequence before matching unshifted sequence. | 180 ;;; Important to define SHIFTed sequence before matching unshifted sequence. |
181 ;;; (talk about bletcherous old uppercase terminal conventions!*$#@&%*&#$%) | 181 ;;; (talk about bletcherous old uppercase terminal conventions!*$#@&%*&#$%) |
211 (define-key suntool-map "il" 'research-forward) ; Find | 211 (define-key suntool-map "il" 'research-forward) ; Find |
212 (define-key suntool-map "i," 're-search-forward) ; C-Find | 212 (define-key suntool-map "i," 're-search-forward) ; C-Find |
213 (define-key suntool-map "i\M-l" 'research-backward) ; M-Find | 213 (define-key suntool-map "i\M-l" 'research-backward) ; M-Find |
214 (define-key suntool-map "i\M-," 're-search-backward) ; C-M-Find | 214 (define-key suntool-map "i\M-," 're-search-backward) ; C-M-Find |
215 | 215 |
216 (define-key suntool-map "jL" 'yank) ; DELETE | 216 (define-key suntool-map "jL" 'yank) ; DELETE |
217 (define-key suntool-map "jl" 'kill-region-and-unmark) ; Delete | 217 (define-key suntool-map "jl" 'kill-region-and-unmark) ; Delete |
218 (define-key suntool-map "j\M-l" 'exchange-point-and-mark); M-Delete | 218 (define-key suntool-map "j\M-l" 'exchange-point-and-mark); M-Delete |
219 (define-key suntool-map "j," | 219 (define-key suntool-map "j," |
220 #'(lambda () (interactive) (pop-mark 1))) ; C-Delete | 220 #'(lambda () (interactive) (pop-mark 1))) ; C-Delete |
221 | 221 |
222 (define-key suntool-map "fT" 'shrink-window-horizontally) ; T6 | 222 (define-key suntool-map "fT" 'shrink-window-horizontally) ; T6 |
223 (define-key suntool-map "gT" 'enlarge-window-horizontally) ; T7 | 223 (define-key suntool-map "gT" 'enlarge-window-horizontally) ; T7 |
224 (define-key suntool-map "ft" 'shrink-window) ; t6 | 224 (define-key suntool-map "ft" 'shrink-window) ; t6 |
247 ;;; | 247 ;;; |
248 ;;; First mouse blip is a clue that we are in emacstool. | 248 ;;; First mouse blip is a clue that we are in emacstool. |
249 ;;; | 249 ;;; |
250 ;;; C-x C-@ is the mouse command prefix. | 250 ;;; C-x C-@ is the mouse command prefix. |
251 | 251 |
252 (autoload 'sun-mouse-handler "sun-mouse" | 252 (autoload 'sun-mouse-handler "sun-mouse" |
253 "Sun Emacstool handler for mouse blips (not loaded)." t) | 253 "Sun Emacstool handler for mouse blips (not loaded)." t) |
254 | 254 |
255 (defun emacstool-init () | 255 (defun emacstool-init () |
256 "Set up Emacstool window, if you know you are in an emacstool." | 256 "Set up Emacstool window, if you know you are in an emacstool." |
257 ;; Make sure sun-mouse and sun-fns are loaded. | 257 ;; Make sure sun-mouse and sun-fns are loaded. |