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

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

Work in progress.

File size: 18.1 KB
Line 
1;;; emacs.lisp
2;;;
3;;; Copyright (C) 2005 Peter Graves
4;;; $Id: emacs.lisp,v 1.4 2005-03-03 19:50:06 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(define-key *global-map* "F3" "findNext")
125(define-key *global-map* "Shift F3" "findPrev")
126(define-key *global-map* "F6" "findInFiles")
127(define-key *global-map* "Ctrl Shift F" "findInFiles")
128(define-key *global-map* "Ctrl F3" "listOccurrences")
129(define-key *global-map* "Ctrl Shift L" "listFiles")
130(define-key *global-map* "Shift Alt 5" "replace") ; M-%
131(define-key *global-map* "Ctrl Shift R" "replaceInFiles")
132
133;; mapKey(KeyEvent.VK_K, CTRL_MASK, "killLine");
134(define-key *global-map* "Ctrl K" "killLine")
135;; mapKey(KeyEvent.VK_DELETE, CTRL_MASK, "deleteWordRight");
136(define-key *global-map* "Ctrl Delete" "deleteWordRight")
137
138(define-keys *global-map*
139  '(("Home"                     "home")
140    ("Ctrl A"                   "home")
141    ("End"                      "end");
142    ("Ctrl E"                   "end");
143    ("Shift Home"               "selectHome")
144    ("Shift End"                "selectEnd")
145    ("Ctrl Home"                "bob")
146    ("Ctrl Shift Home"          "selectBob")
147    ("Ctrl End"                 "eob")
148    ("Ctrl Shift End"           "selectEob")
149    ("Ctrl P"                   "up")
150    ("Up"                       "up")
151    ("NumPad Up"                "up")
152    ("Ctrl N"                   "down")
153    ("Down"                     "down")
154    ("NumPad Down"              "down")
155    ("Shift Up"                 "selectUp")
156    ("Shift NumPad Up"          "selectUp")
157    ("Shift Down"               "selectDown")
158    ("Shift NumPad Down"        "selectDown")
159    ("Ctrl B"                   "left")
160    ("Left"                     "left")
161    ("NumPad Left"              "left")
162    ("Ctrl F"                   "right")
163    ("Right"                    "right")
164    ("NumPad Right"             "right")
165    ("Shift Left"               "selectLeft")
166    ("Shift NumPad Left"        "selectLeft")
167    ("Shift Right"              "selectRight")
168    ("Shift NumPad Right"       "selectRight")
169    ("Alt B"                    "wordLeft")
170    ("Ctrl Left"                "wordLeft")
171    ("Ctrl NumPad Left"         "wordLeft")
172    ("Ctrl Right"               "wordRight")
173    ("Ctrl NumPad Right"        "wordRight")
174    ("Ctrl Shift Left"          "selectWordLeft")
175    ("Ctrl Shift NumPad Left"   "selectWordLeft")
176    ("Ctrl Shift Right"         "selectWordRight")
177    ("Ctrl Shift NumPad Right"  "selectWordRight")
178    ("Alt V"                    "pageUp")
179    ("Page Up"                  "pageUp")
180    ("Ctrl V"                   "pageDown")
181    ("Page Down"                "pageDown")))
182
183;; Emacs uses Ctrl Up for backward-paragraph, which j doesn't have.
184(define-keys *global-map*
185  '(("Ctrl Up"          "windowUp")
186    ("Ctrl NumPad Up"   "windowUp")))
187;; Emacs uses Ctrl Down for forward-paragraph, which j doesn't have.
188(define-keys *global-map*
189  '(("Ctrl Down"        "windowDown")
190    ("Ctrl NumPad Down" "windowDown")))
191
192;; Emacs uses Alt Left for backward-word, which is also on Alt B and Ctrl Left.
193(define-keys *global-map*
194  '(("Alt Left" "prevBuffer")
195    ("Alt NumPad Left" "prevBuffer")))
196;; Emacs uses Alt Right for forward-word, which is also on Alt F and Ctrl Right.
197(define-keys *global-map*
198  '(("Alt Right" "nextBuffer")
199    ("Alt NumPad Right" "nextBuffer")))
200
201;; mapKey(KeyEvent.VK_PAGE_UP, ALT_MASK, "pageUpOtherWindow");
202;; mapKey(KeyEvent.VK_PAGE_UP, SHIFT_MASK, "selectPageUp");
203;; mapKey(KeyEvent.VK_PAGE_DOWN, ALT_MASK, "pageDownOtherWindow");
204;; mapKey(KeyEvent.VK_PAGE_DOWN, SHIFT_MASK, "selectPageDown");
205;; mapKey(KeyEvent.VK_PAGE_UP, CTRL_MASK, "top");
206;; mapKey(KeyEvent.VK_PAGE_DOWN, CTRL_MASK, "bottom");
207;; mapKey(KeyEvent.VK_DELETE, 0, "delete");
208(define-key *global-map* "Delete" "delete")
209(define-key *global-map* "Ctrl D" "delete")
210;; mapKey(KeyEvent.VK_BACK_SPACE, 0, "backspace");
211(define-key *global-map* "Backspace" "backspace")
212;; mapKey(KeyEvent.VK_BACK_SPACE, SHIFT_MASK, "backspace");
213(define-key *global-map* "Shift Backspace" "backspace")
214;; mapKey(KeyEvent.VK_BACK_SPACE, CTRL_MASK, "deleteWordLeft");
215(define-key *global-map* "Ctrl Backspace" "deleteWordLeft")
216;; mapKey(KeyEvent.VK_ENTER, 0, "newline");
217(define-key *global-map* "Enter" "newline")
218(define-key *global-map* "Ctrl J" "newlineAndIndent")
219
220;; mapKey(KeyEvent.VK_ESCAPE, 0, "escape");
221(define-key *global-map* "Ctrl G" "escape")
222
223;; mapKey(KeyEvent.VK_G, CTRL_MASK | SHIFT_MASK, "gotoFile");
224;; mapKey(KeyEvent.VK_B, CTRL_MASK | SHIFT_MASK, "browseFileAtDot");
225
226;; mapKey(KeyEvent.VK_D, CTRL_MASK, "dir");
227
228;; mapKey(KeyEvent.VK_F2, SHIFT_MASK, "stamp");
229
230;; mapKey(KeyEvent.VK_A, CTRL_MASK, "selectAll");
231
232;; mapKey(KeyEvent.VK_OPEN_BRACKET, ALT_MASK, "slideOut");
233;; mapKey(KeyEvent.VK_CLOSE_BRACKET, ALT_MASK, "slideIn");
234
235;; // Bookmarks MUST be mapped like this!
236;; mapKey(KeyEvent.VK_0, ALT_MASK, "dropBookmark");
237;; mapKey(KeyEvent.VK_1, ALT_MASK, "dropBookmark");
238;; mapKey(KeyEvent.VK_2, ALT_MASK, "dropBookmark");
239;; mapKey(KeyEvent.VK_3, ALT_MASK, "dropBookmark");
240;; mapKey(KeyEvent.VK_4, ALT_MASK, "dropBookmark");
241;; mapKey(KeyEvent.VK_5, ALT_MASK, "dropBookmark");
242;; mapKey(KeyEvent.VK_6, ALT_MASK, "dropBookmark");
243;; mapKey(KeyEvent.VK_7, ALT_MASK, "dropBookmark");
244;; mapKey(KeyEvent.VK_8, ALT_MASK, "dropBookmark");
245;; mapKey(KeyEvent.VK_9, ALT_MASK, "dropBookmark");
246;; mapKey(KeyEvent.VK_0, CTRL_MASK, "gotoBookmark");
247;; mapKey(KeyEvent.VK_1, CTRL_MASK, "gotoBookmark");
248;; mapKey(KeyEvent.VK_2, CTRL_MASK, "gotoBookmark");
249;; mapKey(KeyEvent.VK_3, CTRL_MASK, "gotoBookmark");
250;; mapKey(KeyEvent.VK_4, CTRL_MASK, "gotoBookmark");
251;; mapKey(KeyEvent.VK_5, CTRL_MASK, "gotoBookmark");
252;; mapKey(KeyEvent.VK_6, CTRL_MASK, "gotoBookmark");
253;; mapKey(KeyEvent.VK_7, CTRL_MASK, "gotoBookmark");
254;; mapKey(KeyEvent.VK_8, CTRL_MASK, "gotoBookmark");
255;; mapKey(KeyEvent.VK_9, CTRL_MASK, "gotoBookmark");
256
257;; // Temporary marker commands.
258;; mapKey(KeyEvent.VK_BACK_SLASH, ALT_MASK, "dropTemporaryMarker");
259;; mapKey(KeyEvent.VK_BACK_SLASH, CTRL_MASK, "gotoTemporaryMarker");
260;; mapKey(KeyEvent.VK_BACK_SLASH, CTRL_MASK | SHIFT_MASK, "selectToTemporaryMarker");
261
262;; mapKey(KeyEvent.VK_F11, 0, "commentRegion");
263(define-key *global-map* "F11" "commentRegion")
264;; mapKey(KeyEvent.VK_F11, SHIFT_MASK, "uncommentRegion");
265(define-key *global-map* "Shift F11" "uncommentRegion")
266
267;; // Duplicate mappings to support IBM 1.3 for Linux.
268;; mapKey(0xffc8, 0, "commentRegion");
269;; mapKey(0xffc8, SHIFT_MASK, "uncommentRegion");
270
271;; mapKey(KeyEvent.VK_F12, 0, "wrapParagraph");
272(define-key *global-map* "F12" "wrapParagraph")
273;; mapKey(KeyEvent.VK_F12, SHIFT_MASK, "unwrapParagraph");
274(define-key *global-map* "Shift F12" "unwrapParagraph")
275;; mapKey(KeyEvent.VK_F12, CTRL_MASK, "toggleWrap");
276(define-key *global-map* "Ctrl F12" "toggleWrap")
277
278;; // Duplicate mappings to support IBM 1.3 for Linux.
279;; mapKey(0xffc9, 0, "wrapParagraph"); // F12
280;; mapKey(0xffc9, SHIFT_MASK, "unwrapParagraph"); // Shift F12
281;; mapKey(0xffc9, CTRL_MASK, "toggleWrap"); // Ctrl F12
282
283;; mapKey(KeyEvent.VK_T, CTRL_MASK | ALT_MASK, "visibleTabs");
284
285;; // Help menu.
286;; mapKey(KeyEvent.VK_F1, 0, "help");
287;; mapKey(KeyEvent.VK_K, ALT_MASK, "describeKey");
288
289;; mapKey(KeyEvent.VK_SLASH, ALT_MASK, "expand");
290(define-key *global-map* "Alt /" "expand")
291
292;; // On Windows, Alt Space drops down the window menu.
293;; if (!Platform.isPlatformWindows())
294;; mapKey(KeyEvent.VK_SPACE, ALT_MASK, "expand");
295
296;; mapKey(KeyEvent.VK_N, ALT_MASK, "nextFrame");
297
298;; mapKey(KeyEvent.VK_W, ALT_MASK, "selectWord");
299
300;; mapKey(VK_MOUSE_1, 0, "mouseMoveDotToPoint");
301(define-key *global-map* "Mouse-1" "mouseMoveDotToPoint")
302;; mapKey(VK_MOUSE_1, SHIFT_MASK, "mouseSelect");
303;; mapKey(VK_MOUSE_1, CTRL_MASK | SHIFT_MASK, "mouseSelectColumn");
304;; mapKey(VK_DOUBLE_MOUSE_1, 0, "selectWord");
305(define-key *global-map* "Double Mouse-1" "selectWord")
306
307;; if (Platform.isPlatformUnix()) {
308;; mapKey(VK_MOUSE_2, 0, "pastePrimarySelection");
309;; mapKey(KeyEvent.VK_INSERT, SHIFT_MASK, "pastePrimarySelection");
310;; }
311
312;; mapKey(VK_MOUSE_3, 0, "mouseShowContextMenu");
313
314;; mapKey(KeyEvent.VK_F7, 0, "recordMacro");
315;; mapKey(KeyEvent.VK_F8, 0, "playbackMacro");
316
317;; mapKey(KeyEvent.VK_W, CTRL_MASK | SHIFT_MASK, "killFrame");
318
319;; // Sidebar.
320;; mapKey(KeyEvent.VK_EQUALS, ALT_MASK, "toggleSidebar");
321;; mapKey(KeyEvent.VK_B, ALT_MASK, "sidebarListBuffers");
322;; mapKey(KeyEvent.VK_T, CTRL_MASK | SHIFT_MASK, "sidebarListTags");
323
324;; mapKey(KeyEvent.VK_F10, 0, "splitWindow");
325(define-key *control-x-map* "2" "splitWindow")
326;; mapKey(KeyEvent.VK_F10, SHIFT_MASK, "unsplitWindow");
327(define-key *control-x-map*  "1" "unsplitwindow")
328;; mapKey(KeyEvent.VK_F10, CTRL_MASK | SHIFT_MASK, "killWindow");
329(define-key *control-x-map* "0" "killWindow")
330;; mapKey(KeyEvent.VK_O, ALT_MASK, "otherWindow");
331(define-key *control-x-map*  "o" "otherwindow")
332
333;; if (Editor.preferences().getBooleanProperty(Property.ENABLE_EXPERIMENTAL_FEATURES))
334;; mapKey(KeyEvent.VK_F9, ALT_MASK, "shell");
335
336;; // Map these globally so they're available in the compilation buffer too.
337;; mapKey(KeyEvent.VK_F4, 0, "nextError");
338(define-key *control-x-map* "`" "nextError")
339(define-key *global-map* "F4" "nextError")
340;; mapKey(KeyEvent.VK_F4, SHIFT_MASK, "previousError");
341(define-key *global-map* "Shift F4" "previousError")
342;; mapKey(KeyEvent.VK_M, CTRL_MASK | ALT_MASK, "showMessage");
343(define-key *global-map* "Ctrl Alt M" "showMessage")
344
345;; // Windows VM seems to need this mapping for the tab key to work properly.
346;; // There's also code in Dispatcher.dispatchKeyTyped to handle the tab key.
347;; mapKey(KeyEvent.VK_TAB, 0, "insertTab");
348
349;; if (Platform.isPlatformLinux()) {
350;; // These mappings work with Blackdown 1.2.2 (and 1.2 pre-release v2).
351;; mapKey(0x2d, CTRL_MASK, "toCenter"); // Ctrl -
352;; mapKey(0x5f, CTRL_MASK | SHIFT_MASK, "toTop"); // Ctrl Shift -
353
354;; // IBM 1.3, Sun 1.4.0 beta 2.
355;; mapKey(0x2d, CTRL_MASK | SHIFT_MASK, "toTop"); // Ctrl Shift -
356;; } else if (Platform.isPlatformWindows()) {
357;; mapKey(0x2d, CTRL_MASK, "toCenter"); // Ctrl -
358;; mapKey(0x2d, CTRL_MASK | SHIFT_MASK, "toTop"); // Ctrl Shift -
359;; }
360
361(define-key *global-map* "Alt ." "findTagAtDot")
362
363;; Help.
364(define-keys *help-map*
365  '(("a"                        "apropos")
366    ("b"                        "listBindings")
367    ("k"                        "describeKey")))
368
369;; Java mode.
370;; km.mapKey('{', "electricOpenBrace");
371(define-key *java-mode-map* "{" "electricOpenBrace")
372;; km.mapKey('}', "electricCloseBrace");
373(define-key *java-mode-map* "}" "electricCloseBrace")
374;; km.mapKey(KeyEvent.VK_TAB, CTRL_MASK, "insertTab");
375;; km.mapKey(KeyEvent.VK_TAB, 0, "tab");
376(define-key *java-mode-map* "Tab" "tab")
377;; km.mapKey(KeyEvent.VK_ENTER, 0, "newlineAndIndent");
378;; km.mapKey(';', "electricSemi");
379;;                km.mapKey(':', "electricColon");
380;;                km.mapKey('*', "electricStar");
381;;                km.mapKey(KeyEvent.VK_T, CTRL_MASK, "findTag");
382;;                km.mapKey(KeyEvent.VK_PERIOD, ALT_MASK, "findTagAtDot");
383;;                km.mapKey(KeyEvent.VK_COMMA, ALT_MASK, "listMatchingTagsAtDot");
384;;                km.mapKey(KeyEvent.VK_PERIOD, CTRL_MASK | ALT_MASK, "findTagAtDotOtherWindow");
385;;                km.mapKey(')', "closeParen");
386;; km.mapKey(KeyEvent.VK_I, ALT_MASK, "cycleIndentSize");
387
388;; km.mapKey(KeyEvent.VK_9, CTRL_MASK | SHIFT_MASK, "insertParentheses");
389;; km.mapKey(KeyEvent.VK_0, CTRL_MASK | SHIFT_MASK, "movePastCloseAndReindent");
390
391;; km.mapKey(KeyEvent.VK_OPEN_BRACKET, CTRL_MASK | SHIFT_MASK, "insertBraces");
392(define-key *java-mode-map* "Ctrl Shift [" "insertBraces")
393;; // Duplicate mapping for 1.4.
394;; km.mapKey(KeyEvent.VK_BRACELEFT, CTRL_MASK | SHIFT_MASK, "insertBraces");
395
396;; km.mapKey(KeyEvent.VK_F12, 0, "wrapComment");
397
398;; // Duplicate mapping to support IBM 1.3 for Linux.
399;; km.mapKey(0xffc9, 0, "wrapComment"); // F12
400
401;; km.mapKey(KeyEvent.VK_OPEN_BRACKET, CTRL_MASK, "fold");
402;; km.mapKey(KeyEvent.VK_CLOSE_BRACKET, CTRL_MASK, "unfold");
403
404;; km.mapKey(KeyEvent.VK_F9, 0, "compile");
405(define-key *java-mode-map* "F9" "compile")
406;; km.mapKey(KeyEvent.VK_F9, CTRL_MASK, "recompile");
407(define-key *java-mode-map* "Ctrl F9" "recompile")
408;; km.mapKey(KeyEvent.VK_F1, ALT_MASK, "jdkHelp");
409;; km.mapKey(KeyEvent.VK_F1, CTRL_MASK, "source");
410
411;; // This is the "normal" mapping.
412;; km.mapKey(KeyEvent.VK_COMMA,  CTRL_MASK | SHIFT_MASK, "htmlInsertTag");
413;; // The "normal" mapping doesn't work for Linux, but this does.
414;; km.mapKey(0x7c, CTRL_MASK | SHIFT_MASK, "htmlInsertTag");
415
416;; if (Editor.checkExperimental()) {
417;; km.mapKey(KeyEvent.VK_SEMICOLON, ALT_MASK, "JavaMode.insertComment");
418;; km.mapKey(KeyEvent.VK_ENTER, ALT_MASK, "JavaMode.newlineAndIndentForComment");
419;; }
420
421;; if (Platform.isPlatformLinux()) {
422;; // Blackdown 1.1.7v3, 1.2pre2, IBM 1.1.8.
423;; // Duplicate mappings needed for VK_9, VK_0 and VK_OPEN_BRACKET.
424;; km.mapKey(0x68, CTRL_MASK | SHIFT_MASK, "insertParentheses");
425;; km.mapKey(0x69, CTRL_MASK | SHIFT_MASK, "movePastCloseAndReindent");
426;; km.mapKey(0xbb, CTRL_MASK | SHIFT_MASK, "insertBraces");
427;; }
428
429
430(defun emacs ()
431  (use-global-map *global-map*)
432  ;; FIXME This is the right idea (so mappings like Alt F will be possible),
433  ;; but it doesn't quite work.
434  (set-global-property "useMenuMnemonics" "false")
435  (j::%execute-command "reloadKeyMaps"))
436
437(defun java-mode-map ()
438  *java-mode-map*)
439
440(provide 'emacs)
Note: See TracBrowser for help on using the repository browser.