17517
|
1 ;;; sun.el --- keybinding for standard default sunterm keys
|
2140
|
2
|
64701
|
3 ;; Copyright (C) 1987, 2001, 2002, 2003, 2004,
|
79718
|
4 ;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
14170
|
5
|
2140
|
6 ;; Author: Jeff Peck <peck@sun.com>
|
|
7 ;; Keywords: terminals
|
|
8
|
14170
|
9 ;; This file is part of GNU Emacs.
|
|
10
|
|
11 ;; GNU Emacs is free software; you can redistribute it and/or modify
|
|
12 ;; it under the terms of the GNU General Public License as published by
|
78226
|
13 ;; the Free Software Foundation; either version 3, or (at your option)
|
14170
|
14 ;; any later version.
|
466
|
15
|
14170
|
16 ;; GNU Emacs is distributed in the hope that it will be useful,
|
|
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19 ;; GNU General Public License for more details.
|
|
20
|
|
21 ;; You should have received a copy of the GNU General Public License
|
|
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
|
64084
|
23 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
24 ;; Boston, MA 02110-1301, USA.
|
466
|
25
|
2140
|
26 ;;; Commentary:
|
466
|
27
|
|
28 ;; The function key sequences for the console have been converted for
|
|
29 ;; use with function-key-map, but the *tool stuff hasn't been touched.
|
|
30
|
2140
|
31 ;;; Code:
|
466
|
32
|
|
33 (defun scroll-down-in-place (n)
|
|
34 (interactive "p")
|
84795
6aed7b3522e4
* term/w32-win.el (w32-drag-n-drop): Use mapc instead of mapcar.
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
35 (forward-line (- n))
|
466
|
36 (scroll-down n))
|
|
37
|
|
38 (defun scroll-up-in-place (n)
|
|
39 (interactive "p")
|
84795
6aed7b3522e4
* term/w32-win.el (w32-drag-n-drop): Use mapc instead of mapcar.
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
40 (forward-line n)
|
466
|
41 (scroll-up n))
|
|
42
|
|
43 (defun kill-region-and-unmark (beg end)
|
|
44 "Like kill-region, but pops the mark [which equals point, anyway.]"
|
|
45 (interactive "r")
|
|
46 (kill-region beg end)
|
|
47 (setq this-command 'kill-region-and-unmark)
|
|
48 (set-mark-command t))
|
|
49
|
|
50 (defun rerun-prev-command ()
|
|
51 "Repeat Previous-complex-command."
|
|
52 (interactive)
|
|
53 (eval (nth 0 command-history)))
|
|
54
|
|
55 (defvar grep-arg nil "Default arg for RE-search")
|
|
56 (defun grep-arg ()
|
|
57 (if (memq last-command '(research-forward research-backward)) grep-arg
|
|
58 (let* ((command (car command-history))
|
|
59 (command-name (symbol-name (car command)))
|
|
60 (search-arg (car (cdr command)))
|
49599
|
61 (search-command
|
466
|
62 (and command-name (string-match "search" command-name)))
|
|
63 )
|
|
64 (if (and search-command (stringp search-arg)) (setq grep-arg search-arg)
|
49599
|
65 (setq search-command this-command
|
466
|
66 grep-arg (read-string "REsearch: " grep-arg)
|
|
67 this-command search-command)
|
|
68 grep-arg))))
|
|
69
|
|
70 (defun research-forward ()
|
|
71 "Repeat RE search forward."
|
|
72 (interactive)
|
|
73 (re-search-forward (grep-arg)))
|
|
74
|
|
75 (defun research-backward ()
|
|
76 "Repeat RE search backward."
|
|
77 (interactive)
|
|
78 (re-search-backward (grep-arg)))
|
|
79
|
38475
|
80 ;;
|
|
81 ;; handle sun's extra function keys
|
|
82 ;; this version for those who run with standard .ttyswrc and no emacstool
|
|
83 ;;
|
49599
|
84 ;; sunview picks up expose and open on the way UP,
|
38475
|
85 ;; so we ignore them on the way down
|
|
86 ;;
|
466
|
87
|
85548
|
88 (defvar sun-raw-prefix
|
|
89 (let ((map (make-sparse-keymap)))
|
|
90 (define-key map "210z" [r3])
|
|
91 (define-key map "213z" [r6])
|
|
92 (define-key map "214z" [r7])
|
|
93 (define-key map "216z" [r9])
|
|
94 (define-key map "218z" [r11])
|
|
95 (define-key map "220z" [r13])
|
|
96 (define-key map "222z" [r15])
|
|
97 (define-key map "193z" [redo])
|
|
98 (define-key map "194z" [props])
|
|
99 (define-key map "195z" [undo])
|
|
100 ;; (define-key map "196z" 'ignore) ; Expose-down
|
|
101 ;; (define-key map "197z" [put])
|
|
102 ;; (define-key map "198z" 'ignore) ; Open-down
|
|
103 ;; (define-key map "199z" [get])
|
|
104 (define-key map "200z" [find])
|
|
105 ;; (define-key map "201z" 'kill-region-and-unmark) ; Delete
|
|
106 (define-key map "224z" [f1])
|
|
107 (define-key map "225z" [f2])
|
|
108 (define-key map "226z" [f3])
|
|
109 (define-key map "227z" [f4])
|
|
110 (define-key map "228z" [f5])
|
|
111 (define-key map "229z" [f6])
|
|
112 (define-key map "230z" [f7])
|
|
113 (define-key map "231z" [f8])
|
|
114 (define-key map "232z" [f9])
|
|
115 (define-key map "233z" [f10])
|
|
116 (define-key map "234z" [f11])
|
|
117 (define-key map "235z" [f12])
|
|
118 (define-key map "A" [up]) ; R8
|
|
119 (define-key map "B" [down]) ; R14
|
|
120 (define-key map "C" [right]) ; R12
|
|
121 (define-key map "D" [left]) ; R10
|
|
122 map))
|
466
|
123
|
38475
|
124 ;; Since .emacs gets loaded before this file, a hook is supplied
|
|
125 ;; for you to put your own bindings in.
|
466
|
126
|
498
|
127 (defvar sun-raw-prefix-hooks nil
|
|
128 "List of forms to evaluate after setting sun-raw-prefix.")
|
466
|
129
|
|
130
|
|
131
|
64651
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
132 (defun terminal-init-sun ()
|
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
133 "Terminal initialization function for sun."
|
85548
|
134 (define-key input-decode-map "\e[" sun-raw-prefix)
|
64651
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
135
|
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
136 (global-set-key [r3] 'backward-page)
|
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
137 (global-set-key [r6] 'forward-page)
|
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
138 (global-set-key [r7] 'beginning-of-buffer)
|
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
139 (global-set-key [r9] 'scroll-down)
|
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
140 (global-set-key [r11] 'recenter)
|
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
141 (global-set-key [r13] 'end-of-buffer)
|
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
142 (global-set-key [r15] 'scroll-up)
|
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
143 (global-set-key [redo] 'redraw-display) ;FIXME: collides with default.
|
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
144 (global-set-key [props] 'list-buffers)
|
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
145 (global-set-key [put] 'sun-select-region)
|
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
146 (global-set-key [get] 'sun-yank-selection)
|
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
147 (global-set-key [find] 'exchange-point-and-mark)
|
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
148 (global-set-key [f3] 'scroll-down-in-place)
|
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
149 (global-set-key [f4] 'scroll-up-in-place)
|
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
150 (global-set-key [f6] 'shrink-window)
|
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
151 (global-set-key [f7] 'enlarge-window)
|
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
152
|
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
153 (when sun-raw-prefix-hooks
|
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
154 (message "sun-raw-prefix-hooks is obsolete! Use term-setup-hook instead!")
|
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
155 (let ((hooks sun-raw-prefix-hooks))
|
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
156 (while hooks
|
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
157 (eval (car hooks))
|
84728
|
158 (setq hooks (cdr hooks))))))
|
64651
af1c58687bdd
* term/apollo.el (terminal-init-apollo): New function containing
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
159
|
85548
|
160 ;; arch-tag: db761d47-fd7d-42b4-aae1-04fa116b6ba6
|
2140
|
161 ;;; sun.el ends here
|