source: trunk/j/src/org/armedbear/lisp/emacs.lisp @ 8695

Last change on this file since 8695 was 8695, checked in by piso, 17 years ago

Work in progress.

File size: 18.4 KB
Line 
1;;; emacs.lisp
2;;;
3;;; Copyright (C) 2005 Peter Graves
4;;; $Id: emacs.lisp,v 1.3 2005-03-03 19:39:12 piso Exp $
5;;;
6;;; This program is free software; you can redistribute it and/or
7;;; modify it under the terms of the GNU General Public License
8;;; as published by the Free Software Foundation; either version 2
9;;; of the License, or (at your option) any later version.
10;;;
11;;; This program is distributed in the hope that it will be useful,
12;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14;;; GNU General Public License for more details.
15;;;
16;;; You should have received a copy of the GNU General Public License
17;;; along with this program; if not, write to the Free Software
18;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19
20(in-package #:j)
21
22(export '(java-mode-map))
23
24(defpackage #:emacs
25  (:use #:cl #:ext #:j))
26
27(in-package #:emacs)
28
29(defun set-mark-command ()
30  (setf (buffer-mark (current-buffer)) (current-point))
31  (status "Mark set"))
32
33(defun define-keys (map mappings)
34  (dolist (mapping mappings)
35    (define-key map (first mapping) (second mapping))))
36
37(defparameter *global-map* (make-keymap))
38(defparameter *control-x-map* (make-keymap))
39(defparameter *help-map* (make-keymap))
40(defparameter *java-mode-map* (make-keymap))
41
42(define-key *global-map* "Ctrl X" *control-x-map*)
43(define-key *global-map* "Ctrl H" *help-map*)
44
45;; // File menu.
46;; mapKey(KeyEvent.VK_O, CTRL_MASK, "openFile");
47(define-key *control-x-map* "Ctrl F" "openFile")
48;; mapKey(KeyEvent.VK_O, CTRL_MASK | ALT_MASK, "openFileInOtherWindow");
49;; mapKey(KeyEvent.VK_O, CTRL_MASK | SHIFT_MASK, "openFileInOtherFrame");
50;; mapKey(KeyEvent.VK_N, CTRL_MASK, "newBuffer");
51;; mapKey(KeyEvent.VK_R, ALT_MASK, "recentFiles");
52;; mapKey(KeyEvent.VK_S, CTRL_MASK, "save");
53(define-key *control-x-map* "Ctrl S" "save")
54;; mapKey(KeyEvent.VK_S, CTRL_MASK | SHIFT_MASK, "saveAs");
55;; mapKey(KeyEvent.VK_S, CTRL_MASK | ALT_MASK, "saveCopy");
56;; mapKey(KeyEvent.VK_F2, 0, "saveAll");
57;; mapKey(KeyEvent.VK_F4, CTRL_MASK, "killBuffer");
58;; mapKey(KeyEvent.VK_W, CTRL_MASK, "killBuffer");
59(define-key *control-x-map* "k" "killBuffer")
60;; mapKey(KeyEvent.VK_P, ALT_MASK, "properties");
61;; mapKey(KeyEvent.VK_N, CTRL_MASK | SHIFT_MASK, "newFrame");
62;; mapKey(KeyEvent.VK_X, ALT_MASK, "executeCommand");
63(define-key *global-map* "Alt X" "executeCommand");
64;; mapKey(KeyEvent.VK_P, CTRL_MASK, "print");
65;; mapKey(KeyEvent.VK_Q, CTRL_MASK | SHIFT_MASK, "saveAllExit");
66(define-key *control-x-map* "Ctrl C" "saveAllExit")
67;; mapKey(KeyEvent.VK_Q, CTRL_MASK, "quit");
68
69;; // Edit menu.
70(define-key *global-map* "Ctrl Space" #'set-mark-command)
71;; mapKey(KeyEvent.VK_BACK_SPACE, ALT_MASK, "undo");
72;; mapKey(KeyEvent.VK_Z, CTRL_MASK, "undo");
73(define-key *control-x-map* "u" "undo")
74;; mapKey(KeyEvent.VK_Y, CTRL_MASK, "redo");
75;; mapKey(KeyEvent.VK_DELETE, SHIFT_MASK, "killRegion");
76;; mapKey(KeyEvent.VK_X, CTRL_MASK, "killRegion");
77(define-key *global-map* "Ctrl W" "killRegion")
78;; mapKey(KeyEvent.VK_X, CTRL_MASK | SHIFT_MASK, "killAppend");
79;; mapKey(KeyEvent.VK_C, CTRL_MASK, "copyRegion");
80(define-key *global-map* "Alt W" "copyRegion")
81;; mapKey(KeyEvent.VK_C, CTRL_MASK | SHIFT_MASK, "copyAppend");
82;; mapKey(KeyEvent.VK_V, CTRL_MASK, "paste");
83(define-key *global-map* "Ctrl Y" "paste")
84;; mapKey(KeyEvent.VK_V, CTRL_MASK | SHIFT_MASK, "cyclePaste");
85(define-key *global-map* "Alt Y" "cyclePaste")
86;; mapKey(KeyEvent.VK_T, ALT_MASK, "cycleTabWidth");
87
88;; // Goto menu.
89;; mapKey(KeyEvent.VK_J, CTRL_MASK, "jumpToLine");
90;; mapKey(KeyEvent.VK_J, CTRL_MASK | SHIFT_MASK, "jumpToColumn");
91;; mapKey(KeyEvent.VK_M, CTRL_MASK, "findMatchingChar");
92;; mapKey(KeyEvent.VK_M, CTRL_MASK | SHIFT_MASK, "selectSyntax");
93;; mapKey(KeyEvent.VK_UP, CTRL_MASK | ALT_MASK, "findFirstOccurrence");
94(define-key *global-map* "Ctrl Alt Up" "findFirstOccurrence")
95;; mapKey(KeyEvent.VK_KP_UP, CTRL_MASK | ALT_MASK, "findFirstOccurrence");
96(define-key *global-map* "Ctrl Alt NumPad Up" "findFirstOccurrence")
97;; mapKey(KeyEvent.VK_UP, ALT_MASK, "findPrevWord");
98(define-key *global-map* "Alt Up" "findPrevWord")
99;; mapKey(KeyEvent.VK_KP_UP, ALT_MASK, "findPrevWord");
100(define-key *global-map* "Alt NumPad Up" "findPrevWord")
101;; mapKey(KeyEvent.VK_DOWN, ALT_MASK, "findNextWord");
102(define-key *global-map* "Alt Down" "findNextWord")
103;; mapKey(KeyEvent.VK_KP_DOWN, ALT_MASK, "findNextWord");
104(define-key *global-map* "Alt NumPad Down" "findNextWord")
105;; mapKey(KeyEvent.VK_N, CTRL_MASK | ALT_MASK, "nextChange");
106;; mapKey(KeyEvent.VK_P, CTRL_MASK | ALT_MASK, "previousChange");
107;; mapKey(KeyEvent.VK_F5, 0, "pushPosition");
108(define-key *global-map* "F5" "pushPosition")
109;; mapKey(KeyEvent.VK_F5, SHIFT_MASK, "popPosition");
110(define-key *global-map* "Shift F5" "popPosition")
111
112;; // Search menu.
113;; if (Editor.preferences().getBooleanProperty(Property.USE_INCREMENTAL_FIND))
114;; mapKey(KeyEvent.VK_F, CTRL_MASK, "incrementalFind");
115(define-key *global-map* "Ctrl S" "incrementalFind")
116;; else
117;; mapKey(KeyEvent.VK_F, CTRL_MASK, "find");
118(define-key *global-map* "Alt F3" "find")
119
120;; Emacs uses Ctrl Alt L for reposition-window
121;; XEmacs uses Ctrl Alt L for switch-to-other-buffer
122(define-key *global-map* "Ctrl Alt L" "listOccurrencesOfPatternAtDot")
123
124;; mapKey(KeyEvent.VK_F3, 0, "findNext");
125(define-key *global-map* "F3" "findNext")
126;; mapKey(KeyEvent.VK_G, CTRL_MASK, "findNext");
127;; mapKey(KeyEvent.VK_F3, SHIFT_MASK, "findPrev");
128(define-key *global-map* "Shift F3" "findPrev")
129;; mapKey(KeyEvent.VK_H, CTRL_MASK, "findPrev");
130;; mapKey(KeyEvent.VK_F6, 0, "findInFiles");
131(define-key *global-map* "F6" "findInFiles")
132;; mapKey(KeyEvent.VK_F, CTRL_MASK | SHIFT_MASK, "findInFiles");
133;; mapKey(KeyEvent.VK_L, CTRL_MASK, "listOccurrences");
134;; mapKey(KeyEvent.VK_L, CTRL_MASK | SHIFT_MASK, "listFiles");
135;; mapKey(KeyEvent.VK_R, CTRL_MASK, "replace");
136(define-key *global-map* "Shift Alt 5" "replace")
137;; mapKey(KeyEvent.VK_R, CTRL_MASK | SHIFT_MASK, "replaceInFiles");
138
139;; mapKey(KeyEvent.VK_K, CTRL_MASK, "killLine");
140(define-key *global-map* "Ctrl K" "killLine")
141;; mapKey(KeyEvent.VK_DELETE, CTRL_MASK, "deleteWordRight");
142(define-key *global-map* "Ctrl Delete" "deleteWordRight")
143
144(define-keys *global-map*
145  '(("Home"                     "home")
146    ("Ctrl A"                   "home")
147    ("End"                      "end");
148    ("Ctrl E"                   "end");
149    ("Shift Home"               "selectHome")
150    ("Shift End"                "selectEnd")
151    ("Ctrl Home"                "bob")
152    ("Ctrl Shift Home"          "selectBob")
153    ("Ctrl End"                 "eob")
154    ("Ctrl Shift End"           "selectEob")
155    ("Ctrl P"                   "up")
156    ("Up"                       "up")
157    ("NumPad Up"                "up")
158    ("Ctrl N"                   "down")
159    ("Down"                     "down")
160    ("NumPad Down"              "down")
161    ("Shift Up"                 "selectUp")
162    ("Shift NumPad Up"          "selectUp")
163    ("Shift Down"               "selectDown")
164    ("Shift NumPad Down"        "selectDown")
165    ("Ctrl B"                   "left")
166    ("Left"                     "left")
167    ("NumPad Left"              "left")
168    ("Ctrl F"                   "right")
169    ("Right"                    "right")
170    ("NumPad Right"             "right")
171    ("Shift Left"               "selectLeft")
172    ("Shift NumPad Left"        "selectLeft")
173    ("Shift Right"              "selectRight")
174    ("Shift NumPad Right"       "selectRight")
175    ("Alt B"                    "wordLeft")
176    ("Ctrl Left"                "wordLeft")
177    ("Ctrl NumPad Left"         "wordLeft")
178    ("Ctrl Right"               "wordRight")
179    ("Ctrl NumPad Right"        "wordRight")
180    ("Ctrl Shift Left"          "selectWordLeft")
181    ("Ctrl Shift NumPad Left"   "selectWordLeft")
182    ("Ctrl Shift Right"         "selectWordRight")
183    ("Ctrl Shift NumPad Right"  "selectWordRight")
184    ("Alt V"                    "pageUp")
185    ("Page Up"                  "pageUp")
186    ("Ctrl V"                   "pageDown")
187    ("Page Down"                "pageDown")))
188
189;; Emacs uses Ctrl Up for backward-paragraph, which j doesn't have.
190(define-keys *global-map*
191  '(("Ctrl Up"          "windowUp")
192    ("Ctrl NumPad Up"   "windowUp")))
193;; Emacs uses Ctrl Down for forward-paragraph, which j doesn't have.
194(define-keys *global-map*
195  '(("Ctrl Down"        "windowDown")
196    ("Ctrl NumPad Down" "windowDown")))
197
198;; Emacs uses Alt Left for backward-word, which is also on Alt B and Ctrl Left.
199(define-keys *global-map*
200  '(("Alt Left" "prevBuffer")
201    ("Alt NumPad Left" "prevBuffer")))
202;; Emacs uses Alt Right for forward-word, which is also on Alt F and Ctrl Right.
203(define-keys *global-map*
204  '(("Alt Right" "nextBuffer")
205    ("Alt NumPad Right" "nextBuffer")))
206
207;; mapKey(KeyEvent.VK_PAGE_UP, ALT_MASK, "pageUpOtherWindow");
208;; mapKey(KeyEvent.VK_PAGE_UP, SHIFT_MASK, "selectPageUp");
209;; mapKey(KeyEvent.VK_PAGE_DOWN, ALT_MASK, "pageDownOtherWindow");
210;; mapKey(KeyEvent.VK_PAGE_DOWN, SHIFT_MASK, "selectPageDown");
211;; mapKey(KeyEvent.VK_PAGE_UP, CTRL_MASK, "top");
212;; mapKey(KeyEvent.VK_PAGE_DOWN, CTRL_MASK, "bottom");
213;; mapKey(KeyEvent.VK_DELETE, 0, "delete");
214(define-key *global-map* "Delete" "delete")
215(define-key *global-map* "Ctrl D" "delete")
216;; mapKey(KeyEvent.VK_BACK_SPACE, 0, "backspace");
217(define-key *global-map* "Backspace" "backspace")
218;; mapKey(KeyEvent.VK_BACK_SPACE, SHIFT_MASK, "backspace");
219(define-key *global-map* "Shift Backspace" "backspace")
220;; mapKey(KeyEvent.VK_BACK_SPACE, CTRL_MASK, "deleteWordLeft");
221(define-key *global-map* "Ctrl Backspace" "deleteWordLeft")
222;; mapKey(KeyEvent.VK_ENTER, 0, "newline");
223(define-key *global-map* "Enter" "newline")
224(define-key *global-map* "Ctrl J" "newlineAndIndent")
225
226;; mapKey(KeyEvent.VK_ESCAPE, 0, "escape");
227(define-key *global-map* "Ctrl G" "escape")
228
229;; mapKey(KeyEvent.VK_G, CTRL_MASK | SHIFT_MASK, "gotoFile");
230;; mapKey(KeyEvent.VK_B, CTRL_MASK | SHIFT_MASK, "browseFileAtDot");
231
232;; mapKey(KeyEvent.VK_D, CTRL_MASK, "dir");
233
234;; mapKey(KeyEvent.VK_F2, SHIFT_MASK, "stamp");
235
236;; mapKey(KeyEvent.VK_A, CTRL_MASK, "selectAll");
237
238;; mapKey(KeyEvent.VK_OPEN_BRACKET, ALT_MASK, "slideOut");
239;; mapKey(KeyEvent.VK_CLOSE_BRACKET, ALT_MASK, "slideIn");
240
241;; // Bookmarks MUST be mapped like this!
242;; mapKey(KeyEvent.VK_0, ALT_MASK, "dropBookmark");
243;; mapKey(KeyEvent.VK_1, ALT_MASK, "dropBookmark");
244;; mapKey(KeyEvent.VK_2, ALT_MASK, "dropBookmark");
245;; mapKey(KeyEvent.VK_3, ALT_MASK, "dropBookmark");
246;; mapKey(KeyEvent.VK_4, ALT_MASK, "dropBookmark");
247;; mapKey(KeyEvent.VK_5, ALT_MASK, "dropBookmark");
248;; mapKey(KeyEvent.VK_6, ALT_MASK, "dropBookmark");
249;; mapKey(KeyEvent.VK_7, ALT_MASK, "dropBookmark");
250;; mapKey(KeyEvent.VK_8, ALT_MASK, "dropBookmark");
251;; mapKey(KeyEvent.VK_9, ALT_MASK, "dropBookmark");
252;; mapKey(KeyEvent.VK_0, CTRL_MASK, "gotoBookmark");
253;; mapKey(KeyEvent.VK_1, CTRL_MASK, "gotoBookmark");
254;; mapKey(KeyEvent.VK_2, CTRL_MASK, "gotoBookmark");
255;; mapKey(KeyEvent.VK_3, CTRL_MASK, "gotoBookmark");
256;; mapKey(KeyEvent.VK_4, CTRL_MASK, "gotoBookmark");
257;; mapKey(KeyEvent.VK_5, CTRL_MASK, "gotoBookmark");
258;; mapKey(KeyEvent.VK_6, CTRL_MASK, "gotoBookmark");
259;; mapKey(KeyEvent.VK_7, CTRL_MASK, "gotoBookmark");
260;; mapKey(KeyEvent.VK_8, CTRL_MASK, "gotoBookmark");
261;; mapKey(KeyEvent.VK_9, CTRL_MASK, "gotoBookmark");
262
263;; // Temporary marker commands.
264;; mapKey(KeyEvent.VK_BACK_SLASH, ALT_MASK, "dropTemporaryMarker");
265;; mapKey(KeyEvent.VK_BACK_SLASH, CTRL_MASK, "gotoTemporaryMarker");
266;; mapKey(KeyEvent.VK_BACK_SLASH, CTRL_MASK | SHIFT_MASK, "selectToTemporaryMarker");
267
268;; mapKey(KeyEvent.VK_F11, 0, "commentRegion");
269(define-key *global-map* "F11" "commentRegion")
270;; mapKey(KeyEvent.VK_F11, SHIFT_MASK, "uncommentRegion");
271(define-key *global-map* "Shift F11" "uncommentRegion")
272
273;; // Duplicate mappings to support IBM 1.3 for Linux.
274;; mapKey(0xffc8, 0, "commentRegion");
275;; mapKey(0xffc8, SHIFT_MASK, "uncommentRegion");
276
277;; mapKey(KeyEvent.VK_F12, 0, "wrapParagraph");
278(define-key *global-map* "F12" "wrapParagraph")
279;; mapKey(KeyEvent.VK_F12, SHIFT_MASK, "unwrapParagraph");
280(define-key *global-map* "Shift F12" "unwrapParagraph")
281;; mapKey(KeyEvent.VK_F12, CTRL_MASK, "toggleWrap");
282(define-key *global-map* "Ctrl F12" "toggleWrap")
283
284;; // Duplicate mappings to support IBM 1.3 for Linux.
285;; mapKey(0xffc9, 0, "wrapParagraph"); // F12
286;; mapKey(0xffc9, SHIFT_MASK, "unwrapParagraph"); // Shift F12
287;; mapKey(0xffc9, CTRL_MASK, "toggleWrap"); // Ctrl F12
288
289;; mapKey(KeyEvent.VK_T, CTRL_MASK | ALT_MASK, "visibleTabs");
290
291;; // Help menu.
292;; mapKey(KeyEvent.VK_F1, 0, "help");
293;; mapKey(KeyEvent.VK_K, ALT_MASK, "describeKey");
294
295;; mapKey(KeyEvent.VK_SLASH, ALT_MASK, "expand");
296(define-key *global-map* "Alt /" "expand")
297
298;; // On Windows, Alt Space drops down the window menu.
299;; if (!Platform.isPlatformWindows())
300;; mapKey(KeyEvent.VK_SPACE, ALT_MASK, "expand");
301
302;; mapKey(KeyEvent.VK_N, ALT_MASK, "nextFrame");
303
304;; mapKey(KeyEvent.VK_W, ALT_MASK, "selectWord");
305
306;; mapKey(VK_MOUSE_1, 0, "mouseMoveDotToPoint");
307(define-key *global-map* "Mouse-1" "mouseMoveDotToPoint")
308;; mapKey(VK_MOUSE_1, SHIFT_MASK, "mouseSelect");
309;; mapKey(VK_MOUSE_1, CTRL_MASK | SHIFT_MASK, "mouseSelectColumn");
310;; mapKey(VK_DOUBLE_MOUSE_1, 0, "selectWord");
311(define-key *global-map* "Double Mouse-1" "selectWord")
312
313;; if (Platform.isPlatformUnix()) {
314;; mapKey(VK_MOUSE_2, 0, "pastePrimarySelection");
315;; mapKey(KeyEvent.VK_INSERT, SHIFT_MASK, "pastePrimarySelection");
316;; }
317
318;; mapKey(VK_MOUSE_3, 0, "mouseShowContextMenu");
319
320;; mapKey(KeyEvent.VK_F7, 0, "recordMacro");
321;; mapKey(KeyEvent.VK_F8, 0, "playbackMacro");
322
323;; mapKey(KeyEvent.VK_W, CTRL_MASK | SHIFT_MASK, "killFrame");
324
325;; // Sidebar.
326;; mapKey(KeyEvent.VK_EQUALS, ALT_MASK, "toggleSidebar");
327;; mapKey(KeyEvent.VK_B, ALT_MASK, "sidebarListBuffers");
328;; mapKey(KeyEvent.VK_T, CTRL_MASK | SHIFT_MASK, "sidebarListTags");
329
330;; mapKey(KeyEvent.VK_F10, 0, "splitWindow");
331(define-key *control-x-map* "2" "splitWindow")
332;; mapKey(KeyEvent.VK_F10, SHIFT_MASK, "unsplitWindow");
333(define-key *control-x-map*  "1" "unsplitwindow")
334;; mapKey(KeyEvent.VK_F10, CTRL_MASK | SHIFT_MASK, "killWindow");
335(define-key *control-x-map* "0" "killWindow")
336;; mapKey(KeyEvent.VK_O, ALT_MASK, "otherWindow");
337(define-key *control-x-map*  "o" "otherwindow")
338
339;; if (Editor.preferences().getBooleanProperty(Property.ENABLE_EXPERIMENTAL_FEATURES))
340;; mapKey(KeyEvent.VK_F9, ALT_MASK, "shell");
341
342;; // Map these globally so they're available in the compilation buffer too.
343;; mapKey(KeyEvent.VK_F4, 0, "nextError");
344(define-key *control-x-map* "`" "nextError")
345(define-key *global-map* "F4" "nextError")
346;; mapKey(KeyEvent.VK_F4, SHIFT_MASK, "previousError");
347(define-key *global-map* "Shift F4" "previousError")
348;; mapKey(KeyEvent.VK_M, CTRL_MASK | ALT_MASK, "showMessage");
349(define-key *global-map* "Ctrl Alt M" "showMessage")
350
351;; // Windows VM seems to need this mapping for the tab key to work properly.
352;; // There's also code in Dispatcher.dispatchKeyTyped to handle the tab key.
353;; mapKey(KeyEvent.VK_TAB, 0, "insertTab");
354
355;; if (Platform.isPlatformLinux()) {
356;; // These mappings work with Blackdown 1.2.2 (and 1.2 pre-release v2).
357;; mapKey(0x2d, CTRL_MASK, "toCenter"); // Ctrl -
358;; mapKey(0x5f, CTRL_MASK | SHIFT_MASK, "toTop"); // Ctrl Shift -
359
360;; // IBM 1.3, Sun 1.4.0 beta 2.
361;; mapKey(0x2d, CTRL_MASK | SHIFT_MASK, "toTop"); // Ctrl Shift -
362;; } else if (Platform.isPlatformWindows()) {
363;; mapKey(0x2d, CTRL_MASK, "toCenter"); // Ctrl -
364;; mapKey(0x2d, CTRL_MASK | SHIFT_MASK, "toTop"); // Ctrl Shift -
365;; }
366
367(define-key *global-map* "Alt ." "findTagAtDot")
368
369;; Help.
370(define-keys *help-map*
371  '(("a"                        "apropos")
372    ("b"                        "listBindings")
373    ("k"                        "describeKey")))
374
375;; Java mode.
376;; km.mapKey('{', "electricOpenBrace");
377(define-key *java-mode-map* "{" "electricOpenBrace")
378;; km.mapKey('}', "electricCloseBrace");
379(define-key *java-mode-map* "}" "electricCloseBrace")
380;; km.mapKey(KeyEvent.VK_TAB, CTRL_MASK, "insertTab");
381;; km.mapKey(KeyEvent.VK_TAB, 0, "tab");
382(define-key *java-mode-map* "Tab" "tab")
383;; km.mapKey(KeyEvent.VK_ENTER, 0, "newlineAndIndent");
384;; km.mapKey(';', "electricSemi");
385;;                km.mapKey(':', "electricColon");
386;;                km.mapKey('*', "electricStar");
387;;                km.mapKey(KeyEvent.VK_T, CTRL_MASK, "findTag");
388;;                km.mapKey(KeyEvent.VK_PERIOD, ALT_MASK, "findTagAtDot");
389;;                km.mapKey(KeyEvent.VK_COMMA, ALT_MASK, "listMatchingTagsAtDot");
390;;                km.mapKey(KeyEvent.VK_PERIOD, CTRL_MASK | ALT_MASK, "findTagAtDotOtherWindow");
391;;                km.mapKey(')', "closeParen");
392;; km.mapKey(KeyEvent.VK_I, ALT_MASK, "cycleIndentSize");
393
394;; km.mapKey(KeyEvent.VK_9, CTRL_MASK | SHIFT_MASK, "insertParentheses");
395;; km.mapKey(KeyEvent.VK_0, CTRL_MASK | SHIFT_MASK, "movePastCloseAndReindent");
396
397;; km.mapKey(KeyEvent.VK_OPEN_BRACKET, CTRL_MASK | SHIFT_MASK, "insertBraces");
398(define-key *java-mode-map* "Ctrl Shift [" "insertBraces")
399;; // Duplicate mapping for 1.4.
400;; km.mapKey(KeyEvent.VK_BRACELEFT, CTRL_MASK | SHIFT_MASK, "insertBraces");
401
402;; km.mapKey(KeyEvent.VK_F12, 0, "wrapComment");
403
404;; // Duplicate mapping to support IBM 1.3 for Linux.
405;; km.mapKey(0xffc9, 0, "wrapComment"); // F12
406
407;; km.mapKey(KeyEvent.VK_OPEN_BRACKET, CTRL_MASK, "fold");
408;; km.mapKey(KeyEvent.VK_CLOSE_BRACKET, CTRL_MASK, "unfold");
409
410;; km.mapKey(KeyEvent.VK_F9, 0, "compile");
411(define-key *java-mode-map* "F9" "compile")
412;; km.mapKey(KeyEvent.VK_F9, CTRL_MASK, "recompile");
413(define-key *java-mode-map* "Ctrl F9" "recompile")
414;; km.mapKey(KeyEvent.VK_F1, ALT_MASK, "jdkHelp");
415;; km.mapKey(KeyEvent.VK_F1, CTRL_MASK, "source");
416
417;; // This is the "normal" mapping.
418;; km.mapKey(KeyEvent.VK_COMMA,  CTRL_MASK | SHIFT_MASK, "htmlInsertTag");
419;; // The "normal" mapping doesn't work for Linux, but this does.
420;; km.mapKey(0x7c, CTRL_MASK | SHIFT_MASK, "htmlInsertTag");
421
422;; if (Editor.checkExperimental()) {
423;; km.mapKey(KeyEvent.VK_SEMICOLON, ALT_MASK, "JavaMode.insertComment");
424;; km.mapKey(KeyEvent.VK_ENTER, ALT_MASK, "JavaMode.newlineAndIndentForComment");
425;; }
426
427;; if (Platform.isPlatformLinux()) {
428;; // Blackdown 1.1.7v3, 1.2pre2, IBM 1.1.8.
429;; // Duplicate mappings needed for VK_9, VK_0 and VK_OPEN_BRACKET.
430;; km.mapKey(0x68, CTRL_MASK | SHIFT_MASK, "insertParentheses");
431;; km.mapKey(0x69, CTRL_MASK | SHIFT_MASK, "movePastCloseAndReindent");
432;; km.mapKey(0xbb, CTRL_MASK | SHIFT_MASK, "insertBraces");
433;; }
434
435
436(defun emacs ()
437  (use-global-map *global-map*)
438  ;; FIXME This is the right idea (so mappings like Alt F will be possible),
439  ;; but it doesn't quite work.
440  (set-global-property "useMenuMnemonics" "false")
441  (j::%execute-command "reloadKeyMaps"))
442
443(defun java-mode-map ()
444  *java-mode-map*)
445
446(provide 'emacs)
Note: See TracBrowser for help on using the repository browser.