source: trunk/source/cocoa-ide/hemlock/src/bindings.lisp @ 8428

Last change on this file since 8428 was 8428, checked in by gz, 12 years ago

Merge of the 'event-ide' branch. Hemlock's thread model has been changed
so that Hemlock commands now run in the Cocoa event thread -- see the
Hemlock file view.lisp for an overview.

IDE compilation has also been reorganized. Hemlock is now more fully
integrated into the IDE and cannot be compiled separately, sorry.

The hemlock-ext package has been repurposed to contain all interfaces
to window-system specific functionality.

There are also many many assorted other changes, cleanups and fixes.

The Hemlock documentation (Hemlock Command Implementor's Manual) in
http://trac.clozure.com/openmcl/wiki now correctly reflects the
implementation, although it doesn't (yet) describe the integration
with Cocoa or the threading model.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 35.9 KB
Line 
1;; -*- Log: hemlock.log; Package: Hemlock -*-
2;;;
3;;; **********************************************************************
4;;; This code was written as part of the CMU Common Lisp project at
5;;; Carnegie Mellon University, and has been placed in the public domain.
6;;;
7#+CMU (ext:file-comment
8       "$Header$")
9;;;
10;;; **********************************************************************
11;;;
12;;; Some bindings:
13;;;
14
15(in-package :hemlock)
16
17
18
19;;;; Default key translations:
20
21;;; This page defines prefix characters that set specified modifier bits on
22;;; the next character typed.
23;;;
24(setf (key-translation #k"escape") '(:bits :meta))
25(setf (key-translation #k"control-z") '(:bits :control :meta))
26(setf (key-translation #k"control-Z") '(:bits :control :meta))
27(setf (key-translation #k"control-^") '(:bits :control))
28(setf (key-translation #k"control-c") '(:bits :hyper))
29(setf (key-translation #k"control-C") '(:bits :hyper))
30
31
32
33;;;; Most every binding.
34
35;;; Self insert letters:
36;;;
37(do-alpha-key-events (key-event :both)
38  (bind-key "Self Insert" key-event))
39
40(bind-key "Beginning of Line" #k"control-a")
41(bind-key "Select to Beginning of Line" #k"control-A")
42(bind-key "Delete Next Character" #k"control-d")
43(bind-key "Delete Next Character" #k"del")
44(bind-key "End of Line" #k"control-e")
45(bind-key "Select to End of Line" #k"control-E")
46(bind-key "Forward Character" #k"control-f")
47(bind-key "Forward Character" #k"rightarrow")
48(bind-key "Select Forward Character" #k"control-F")
49(bind-key "Select Forward Character" #k"shift-rightarrow")
50(bind-key "Backward Character" #k"control-b")
51(bind-key "Backward Character" #k"leftarrow")
52(bind-key "Select Backward Character" #k"control-B")
53(bind-key "Select Backward Character" #k"shift-leftarrow")
54(bind-key "Kill Line" #k"control-k")
55(bind-key "Refresh Screen" #k"control-l")
56(bind-key "Next Line" #k"control-n")
57(bind-key "Next Line" #k"downarrow")
58(bind-key "Select Next Line" #k"control-N")
59(bind-key "Select Next Line" #k"shift-downarrow")
60(bind-key "Previous Line" #k"control-p")
61(bind-key "Previous Line" #k"uparrow")
62(bind-key "Select Previous Line" #k"control-P")
63(bind-key "Select Previous Line" #k"shift-uparrow")
64(bind-key "Query Replace" #k"meta-%")
65(bind-key "Reverse Incremental Search" #k"control-r")
66(bind-key "Incremental Search" #k"control-s")
67(bind-key "Forward Search" #k"meta-s")
68(bind-key "Reverse Search" #k"meta-r")
69(bind-key "Transpose Characters" #k"control-t")
70(bind-key "Universal Argument" #k"control-u")
71(bind-key "Scroll Window Down" #k"control-v")
72(bind-key "Scroll Window Down" #k"pagedown")
73(bind-key "Scroll Window Up" #k"meta-v")
74(bind-key "Scroll Window Up" #k"pageup")
75;(bind-key "Scroll Next Window Down" #k"control-meta-v")
76;(bind-key "Scroll Next Window Up" #k"control-meta-V")
77
78(bind-key "Do Nothing" #k"leftdown")
79;(bind-key "Do Nothing" #k"leftup")
80
81(bind-key "Abort Command" #k"control-g")
82(bind-key "Abort Command" #k"control-G")
83(bind-key "Abort Command" #k"control-x control-g")
84(bind-key "Abort Command" #k"control-x control-G")
85
86
87(bind-key "Process File Options" #k"control-x m" :global)
88(bind-key "Ensure File Options Line" #k"control-meta-M" :global)
89(bind-key "Beginning of Buffer" #k"home")
90(bind-key "End of Buffer" #k"end")
91(bind-key "Undo" #k"control-_")
92(bind-key "Undo" #k"control-\/")
93(bind-key "Describe Key" #k"meta-?")
94(bind-key "What Cursor Position" #k"control-x =")
95
96
97#||
98(bind-key "Here to Top of Window" #k"leftdown")
99(bind-key "Do Nothing" #k"leftup")
100(bind-key "Top Line to Here" #k"rightdown")
101(bind-key "Do Nothing" #k"rightup")
102(bind-key "Point to Here" #k"middledown")
103(bind-key "Point to Here" #k"super-leftdown")
104(bind-key "Generic Pointer Up" #k"middleup")
105(bind-key "Generic Pointer Up" #k"super-leftup")
106(bind-key "Do Nothing" #k"super-rightup")
107(bind-key "Insert Kill Buffer" #k"super-rightdown")
108||#
109
110(bind-key "Insert File" #k"control-x control-r")
111(bind-key "Save File" #k"control-x control-s")
112(bind-key "Visit File" #k"control-x control-v")
113(bind-key "Write File" #k"control-x control-w")
114(bind-key "Find File" #k"control-x control-f")
115(bind-key "Backup File" #k"control-x meta-b")
116;(bind-key "Save All Files" #k"control-x control-m")
117;(bind-key "Save All Files" #k"control-x return")
118;(bind-key "Save All Files and Exit" #k"control-x meta-z")
119
120;(bind-key "List Buffers" #k"control-x control-b")
121(bind-key "Buffer Not Modified" #k"meta-~")
122;(bind-key "Check Buffer Modified" #k"control-x ~")
123;(bind-key "Select Buffer" #k"control-x b")
124;(bind-key "Select Previous Buffer" #k"control-meta-l")
125;(bind-key "Circulate Buffers" #k"control-meta-L")
126;(bind-key "Create Buffer" #k"control-x meta-b")
127;(bind-key "Kill Buffer" #k"control-x k")
128;(bind-key "Select Random Typeout Buffer" #k"hyper-t")
129
130;(bind-key "Next Window" #k"control-x n")
131;(bind-key "Next Window" #k"control-x o")
132;(bind-key "Previous Window" #k"control-x p")
133;(bind-key "Split Window" #k"control-x 2")
134;(bind-key "New Window" #k"control-x control-n")
135;(bind-key "Delete Window" #k"control-x d")
136;(bind-key "Delete Next Window" #k"control-x 1")
137;(bind-key "Line to Top of Window" #k"meta-!")
138;(bind-key "Line to Center of Window" #k"meta-#")
139;(bind-key "Top of Window" #k"meta-,")
140;(bind-key "Bottom of Window" #k"meta-.")
141
142(bind-key "Delete Previous Character" #k"delete")
143(bind-key "Delete Previous Character" #k"backspace")
144(bind-key "Kill Next Word" #k"meta-d")
145(bind-key "Kill Previous Word" #k"meta-delete")
146(bind-key "Kill Previous Word" #k"meta-backspace")
147(bind-key "Exchange Point and Mark" #k"control-x control-x")
148(bind-key "Mark Whole Buffer" #k"control-x h")
149(bind-key "Set/Pop Mark" #k"control-@")
150(bind-key "Set/Pop Mark" #k"control-space")
151(bind-key "Pop and Goto Mark" #k"meta-@")
152(bind-key "Pop Mark" #k"control-meta-space") ;#k"control-meta-@" = "Mark Form".
153(bind-key "Kill Region" #k"control-w")
154(bind-key "Save Region" #k"meta-w")
155(bind-key "Un-Kill" #k"control-y")
156(bind-key "Rotate Kill Ring" #k"meta-y")
157
158(bind-key "Forward Word" #k"meta-f")
159(bind-key "Select Forward Word" #k"meta-F")
160(bind-key "Backward Word" #k"meta-b")
161(bind-key "Select Backward Word" #k"meta-B")
162
163(bind-key "Forward Paragraph" #k"meta-]")
164(bind-key "Forward Sentence" #k"meta-e")
165(bind-key "Backward Paragraph" #k"meta-[")
166(bind-key "Backward Sentence" #k"meta-a")
167
168(bind-key "Mark Paragraph" #k"meta-h")
169
170(bind-key "Forward Kill Sentence" #k"meta-k")
171(bind-key "Backward Kill Sentence" #k"control-x delete")
172(bind-key "Backward Kill Sentence" #k"control-x backspace")
173
174(bind-key "Beginning of Buffer" #k"meta-\<")
175(bind-key "End of Buffer" #k"meta-\>")
176(bind-key "Mark to Beginning of Buffer" #k"control-\<")
177(bind-key "Mark to End of Buffer" #k"control-\>")
178
179(bind-key "Extended Command" #k"meta-x")
180
181(bind-key "Uppercase Word" #k"meta-u")
182(bind-key "Lowercase Word" #k"meta-l")
183(bind-key "Capitalize Word" #k"meta-c")
184
185;(bind-key "Previous Page" #k"control-x [")
186;(bind-key "Next Page" #k"control-x ]")
187;(bind-key "Mark Page" #k"control-x control-p")
188;(bind-key "Count Lines Page" #k"control-x l")
189
190(bind-key "Expand Dynamic Abbreviation" #k"meta-/") ;; Aquamacs and LW binding
191(bind-key "Expand Dynamic Abbreviation" #k"meta-`") ;; MCL binding
192
193(bind-key "Help" #k"control-h")
194
195;;;; Argument Digit and Negative Argument.
196
197(bind-key "Argument Digit" #k"meta-\-")
198(bind-key "Argument Digit" #k"meta-0")
199(bind-key "Argument Digit" #k"meta-1")
200(bind-key "Argument Digit" #k"meta-2")
201(bind-key "Argument Digit" #k"meta-3")
202(bind-key "Argument Digit" #k"meta-4")
203(bind-key "Argument Digit" #k"meta-5")
204(bind-key "Argument Digit" #k"meta-6")
205(bind-key "Argument Digit" #k"meta-7")
206(bind-key "Argument Digit" #k"meta-8")
207(bind-key "Argument Digit" #k"meta-9")
208(bind-key "Argument Digit" #k"control-\-")
209(bind-key "Argument Digit" #k"control-0")
210(bind-key "Argument Digit" #k"control-1")
211(bind-key "Argument Digit" #k"control-2")
212(bind-key "Argument Digit" #k"control-3")
213(bind-key "Argument Digit" #k"control-4")
214(bind-key "Argument Digit" #k"control-5")
215(bind-key "Argument Digit" #k"control-6")
216(bind-key "Argument Digit" #k"control-7")
217(bind-key "Argument Digit" #k"control-8")
218(bind-key "Argument Digit" #k"control-9")
219(bind-key "Argument Digit" #k"control-meta-\-")
220(bind-key "Argument Digit" #k"control-meta-0")
221(bind-key "Argument Digit" #k"control-meta-1")
222(bind-key "Argument Digit" #k"control-meta-2")
223(bind-key "Argument Digit" #k"control-meta-3")
224(bind-key "Argument Digit" #k"control-meta-4")
225(bind-key "Argument Digit" #k"control-meta-5")
226(bind-key "Argument Digit" #k"control-meta-6")
227(bind-key "Argument Digit" #k"control-meta-7")
228(bind-key "Argument Digit" #k"control-meta-8")
229(bind-key "Argument Digit" #k"control-meta-9")
230
231(bind-key "Digit" #k"\-")
232(bind-key "Digit" #k"0")
233(bind-key "Digit" #k"1")
234(bind-key "Digit" #k"2")
235(bind-key "Digit" #k"3")
236(bind-key "Digit" #k"4")
237(bind-key "Digit" #k"5")
238(bind-key "Digit" #k"6")
239(bind-key "Digit" #k"7")
240(bind-key "Digit" #k"8")
241(bind-key "Digit" #k"9")
242
243
244;;;; Self Insert and Quoted Insert.
245
246(bind-key "Quoted Insert" #k"control-q")
247
248(bind-key "Self Insert" #k"space")
249(bind-key "Self Insert" #k"!")
250(bind-key "Self Insert" #k"@")
251(bind-key "Self Insert" #k"#")
252(bind-key "Self Insert" #k"$")
253(bind-key "Self Insert" #k"%")
254(bind-key "Self Insert" #k"^")
255(bind-key "Self Insert" #k"&")
256(bind-key "Self Insert" #k"*")
257(bind-key "Self Insert" #k"(")
258(bind-key "Self Insert" #k")")
259(bind-key "Self Insert" #k"_")
260(bind-key "Self Insert" #k"+")
261(bind-key "Self Insert" #k"~")
262(bind-key "Self Insert" #k"[")
263(bind-key "Self Insert" #k"]")
264(bind-key "Self Insert" #k"\\")
265(bind-key "Self Insert" #k"|")
266(bind-key "Self Insert" #k":")
267(bind-key "Self Insert" #k";")
268(bind-key "Self Insert" #k"\"")
269(bind-key "Self Insert" #k"'")
270(bind-key "Self Insert" #k"=")
271(bind-key "Self Insert" #k"`")
272(bind-key "Self Insert" #k"\<")
273(bind-key "Self Insert" #k"\>")
274(bind-key "Self Insert" #k",")
275(bind-key "Self Insert" #k".")
276(bind-key "Self Insert" #k"?")
277(bind-key "Self Insert" #k"/")
278(bind-key "Self Insert" #k"{")
279(bind-key "Self Insert" #k"}")
280
281
282
283;;;; Echo Area.
284
285;;; Basic echo-area commands.
286;;;
287(bind-key "Help on Parse" #k"home" :mode "Echo Area")
288(bind-key "Help on Parse" #k"control-_" :mode "Echo Area")
289
290(bind-key "Complete Keyword" #k"escape" :mode "Echo Area")
291(bind-key "Complete Field" #k"space" :mode "Echo Area")
292(bind-key "Confirm Parse" #k"return" :mode "Echo Area")
293
294;;; Rebind some standard commands to behave better.
295;;;
296;;(bind-key "Kill Parse" #k"control-u" :mode "Echo Area")
297(bind-key "Insert Parse Default" #k"control-i" :mode "Echo Area")
298(bind-key "Insert Parse Default" #k"tab" :mode "Echo Area")
299(bind-key "Echo Area Delete Previous Character" #k"delete" :mode "Echo Area")
300(bind-key "Echo Area Delete Previous Character" #k"backspace" :mode "Echo Area")
301(bind-key "Echo Area Kill Previous Word" #k"meta-h" :mode "Echo Area")
302(bind-key "Echo Area Kill Previous Word" #k"meta-delete" :mode "Echo Area")
303(bind-key "Echo Area Kill Previous Word" #k"meta-backspace" :mode "Echo Area")
304(bind-key "Echo Area Kill Previous Word" #k"control-w" :mode "Echo Area")
305(bind-key "Beginning of Parse" #k"control-a" :mode "Echo Area")
306(bind-key "Beginning of Parse" #k"meta-\<" :mode "Echo Area")
307(bind-key "Echo Area Backward Character" #k"control-b" :mode "Echo Area")
308(bind-key "Echo Area Backward Word" #k"meta-b" :mode "Echo Area")
309(bind-key "Next Parse" #k"control-n" :mode "Echo Area")
310(bind-key "Previous Parse" #k"control-p" :mode "Echo Area")
311
312;;; Remove some dangerous standard bindings.
313;;;
314(bind-key "Illegal" #k"control-x" :mode "Echo Area")
315(bind-key "Illegal" #k"control-meta-c" :mode "Echo Area")
316(bind-key "Illegal" #k"control-meta-s" :mode "Echo Area")
317(bind-key "Illegal" #k"control-meta-l" :mode "Echo Area")
318(bind-key "Illegal" #k"meta-x" :mode "Echo Area")
319(bind-key "Illegal" #k"control-s" :mode "Echo Area")
320(bind-key "Illegal" #k"control-r" :mode "Echo Area")
321(bind-key "Illegal" #k"hyper-t" :mode "Echo Area")
322
323
324
325;;;; Listener and Editor Modes.
326(bind-key "Confirm Listener Input" #k"return" :mode "Listener")
327(bind-key "Previous Interactive Input" #k"meta-p" :mode "Listener")
328
329(bind-key "Search Previous Interactive Input" #k"meta-P" :mode "Listener")
330(bind-key "Next Interactive Input" #k"meta-n" :mode "Listener")
331(bind-key "Kill Interactive Input" #k"meta-i" :mode "Listener")
332;(bind-key "Abort Eval Input" #k"control-meta-i" :mode "Listener")
333(bind-key "Interactive Beginning of Line" #k"control-a" :mode "Listener")
334(bind-key "POP Or Delete Forward" #k"control-d" :mode "Listener")
335(bind-key "Reenter Interactive Input" #k"control-return" :mode "Listener")
336
337;;; Make the user use C-x C-w to save the file, and take care
338;;; not to associate the Listener document with any particular
339;;; file or type.
340(bind-key "Illegal" #k"control-x control-s" :mode "Listener")
341(bind-key "Save To File" #k"control-x control-w" :mode "Listener")
342
343(bind-key "Editor Evaluate Expression" #k"control-meta-escape")
344(bind-key "Editor Evaluate Expression" #k"meta-escape"  :mode "Editor")
345(bind-key "Editor Evaluate Defun" #k"control-x control-e" :mode "Editor")
346(bind-key "Editor Evaluate Region" #k"enter" :mode "Editor")
347(bind-key "Editor Evaluate Defun" #k"control-meta-x" :mode "Editor")
348(bind-key "Editor Compile Defun" #k"control-x control-c" :mode "Editor")
349(bind-key "Editor Compile Defun" #k"control-x control-C" :mode "Editor")
350
351(bind-key "Editor Macroexpand-1 Expression" #k"control-m" :mode "Editor")
352(bind-key "Editor Macroexpand Expression" #k"control-x control-m" :mode "Editor")
353(bind-key "Editor Describe Function Call" #k"control-meta-A" :mode "Editor")
354(bind-key "Editor Describe Symbol" #k"control-meta-S" :mode "Editor")
355
356
357;;;; Lisp (some).
358
359(bind-key "Indent Form" #k"control-meta-q")
360(bind-key "Fill Lisp Comment Paragraph" #k"meta-q" :mode "Lisp")
361(bind-key "Current Function Arglist" #k"control-x control-a" :mode "Lisp")
362(bind-key "Arglist On Space" #k"Space" :mode "Lisp")
363(bind-key "Defindent" #k"control-meta-#")
364(bind-key "Beginning of Defun" #k"control-meta-a")
365(bind-key "Select to Beginning of Defun" #k"control-meta-A")
366(bind-key "End of Defun" #k"control-meta-e")
367(bind-key "Select to End of Defun" #k"control-meta-E")
368(bind-key "Forward Form" #k"control-meta-f")
369(bind-key "Select Forward Form" #k"control-meta-F")
370(bind-key "Backward Form" #k"control-meta-b")
371(bind-key "Select Backward Form" #k"control-meta-B")
372(bind-key "Forward List" #k"control-meta-n")
373(bind-key "Select Forward List" #k"control-meta-N")
374(bind-key "Backward List" #k"control-meta-p")
375(bind-key "Select Backward List" #k"control-meta-P")
376(bind-key "Transpose Forms" #k"control-meta-t")
377(bind-key "Forward Kill Form" #k"control-meta-k")
378(bind-key "Backward Kill Form" #k"control-meta-backspace")
379(bind-key "Backward Kill Form" #k"control-meta-delete")
380(bind-key "Mark Form" #k"control-meta-@")
381(bind-key "Mark Defun" #k"control-meta-h")
382(bind-key "Insert ()" #k"meta-(")
383(bind-key "Move over )" #k"meta-)")
384(bind-key "Backward Up List" #k"control-meta-(")
385(bind-key "Backward Up List" #k"control-meta-u")
386(bind-key "Forward Up List" #k"control-meta-)")
387(bind-key "Down List" #k"control-meta-d")
388(bind-key "Extract List" #k"control-meta-l")
389;;(bind-key "Lisp Insert )" #k")" :mode "Lisp")
390(bind-key "Delete Previous Character Expanding Tabs" #k"backspace" :mode "Lisp")
391(bind-key "Delete Previous Character Expanding Tabs" #k"delete" :mode "Lisp")
392(bind-key "Goto Absolute Line" #k"meta-g")
393;;;(bind-key "Set Package Name" #k"control-x p" :mode "Lisp")
394
395#+listener-bindings
396(progn
397(bind-key "Evaluate Expression" #k"meta-escape")
398(bind-key "Evaluate Defun" #k"control-x control-e")
399(bind-key "Compile Defun" #k"control-x control-c")
400(bind-key "Compile Buffer File" #k"control-x c")
401
402(bind-key "Describe Function Call" #k"control-meta-A")
403(bind-key "Describe Symbol" #k"control-meta-S")
404)
405
406(bind-key "Goto Definition" #k"meta-.")
407
408#+debugger-bindings
409(progn
410(bind-key "Debug Up" #k"control-meta-hyper-u")
411(bind-key "Debug Down" #k"control-meta-hyper-d")
412(bind-key "Debug Top" #k"control-meta-hyper-t")
413(bind-key "Debug Bottom" #k"control-meta-hyper-b")
414(bind-key "Debug Frame" #k"control-meta-hyper-f")
415(bind-key "Debug Quit" #k"control-meta-hyper-q")
416(bind-key "Debug Go" #k"control-meta-hyper-g")
417(bind-key "Debug Abort" #k"control-meta-hyper-a")
418(bind-key "Debug Restart" #k"control-meta-hyper-r")
419(bind-key "Debug Help" #k"control-meta-hyper-h")
420(bind-key "Debug Error" #k"control-meta-hyper-e")
421(bind-key "Debug Backtrace" #k"control-meta-hyper-B")
422(bind-key "Debug Print" #k"control-meta-hyper-p")
423(bind-key "Debug Verbose Print" #k"control-meta-hyper-P")
424(bind-key "Debug List Locals" #k"control-meta-hyper-l")
425(bind-key "Debug Source" #k"control-meta-hyper-s")
426(bind-key "Debug Edit Source" #k"control-meta-hyper-S")
427(bind-key "Debug Flush Errors" #k"control-meta-hyper-F")
428)
429
430
431;;;; More Miscellaneous bindings.
432
433(bind-key "Open Line" #k"Control-o")
434(bind-key "New Line" #k"return")
435
436(bind-key "Transpose Words" #k"meta-t")
437(bind-key "Transpose Lines" #k"control-x control-t")
438(bind-key "Transpose Regions" #k"control-x t")
439
440(bind-key "Uppercase Region" #k"control-x control-u")
441(bind-key "Lowercase Region" #k"control-x control-l")
442
443(bind-key "Delete Indentation" #k"meta-^")
444(bind-key "Delete Indentation" #k"control-meta-^")
445(bind-key "Delete Horizontal Space" #k"meta-\\")
446(bind-key "Delete Blank Lines" #k"control-x control-o" :global)
447(bind-key "Just One Space" #k"meta-space")
448(bind-key "Back to Indentation" #k"meta-m")
449(bind-key "Back to Indentation" #k"control-meta-m")
450(bind-key "Indent Rigidly" #k"control-x tab")
451(bind-key "Indent Rigidly" #k"control-x control-i")
452
453(bind-key "Indent New Line" #k"linefeed")
454(bind-key "Indent" #k"tab")
455(bind-key "Indent" #k"control-i")
456(bind-key "Indent Region" #k"control-meta-\\")
457(bind-key "Quote Tab" #k"meta-tab")
458
459#||
460(bind-key "Directory" #k"control-x control-\d")
461(bind-key "Verbose Directory" #k"control-x control-D")
462||#
463
464(bind-key "Activate Region" #k"control-x control-@")
465(bind-key "Activate Region" #k"control-x control-space")
466
467(bind-key "Save Position" #k"control-x s")
468(bind-key "Jump to Saved Position" #k"control-x j")
469(bind-key "Put Register" #k"control-x x")
470(bind-key "Get Register" #k"control-x g")
471
472#+pascal-mode
473(progn
474(bind-key "Delete Previous Character Expanding Tabs" #k"backspace"
475          :mode "Pascal")
476(bind-key "Delete Previous Character Expanding Tabs" #k"delete" :mode "Pascal")
477(bind-key "Scribe Insert Bracket" #k")" :mode "Pascal")
478(bind-key "Scribe Insert Bracket" #k"]" :mode "Pascal")
479(bind-key "Scribe Insert Bracket" #k"}" :mode "Pascal")
480)
481
482
483;;;; Auto Fill Mode.
484
485(bind-key "Fill Paragraph" #k"meta-q")
486(bind-key "Fill Region" #k"meta-g")
487(bind-key "Set Fill Prefix" #k"control-x .")
488(bind-key "Set Fill Column" #k"control-x f")
489(bind-key "Auto Fill Return" #k"return" :mode "Fill")
490(bind-key "Auto Fill Space" #k"space" :mode "Fill")
491(bind-key "Auto Fill Linefeed" #k"linefeed" :mode "Fill")
492
493
494
495#|
496;;;; Keyboard macro bindings.
497
498(bind-key "Define Keyboard Macro" #k"control-x (")
499(bind-key "Define Keyboard Macro Key" #k"control-x meta-(")
500(bind-key "End Keyboard Macro" #k"control-x )")
501(bind-key "End Keyboard Macro" #k"control-x hyper-)")
502(bind-key "Last Keyboard Macro" #k"control-x e")
503(bind-key "Keyboard Macro Query" #k"control-x q")
504|#
505
506
507;;;; Spell bindings.
508#||
509(progn
510  (bind-key "Check Word Spelling" #k"meta-$")
511  (bind-key "Add Word to Spelling Dictionary" #k"control-x $")
512
513  (dolist (info (command-bindings (getstring "Self Insert" *command-names*)))
514    (let* ((key (car info))
515           (key-event (svref key 0))
516           (character (key-event-char key-event)))
517      (unless (or (alpha-char-p character) (eq key-event #k"'"))
518        (bind-key "Auto Check Word Spelling" key :mode "Spell"))))
519  (bind-key "Auto Check Word Spelling" #k"return" :mode "Spell")
520  (bind-key "Auto Check Word Spelling" #k"tab" :mode "Spell")
521  (bind-key "Auto Check Word Spelling" #k"linefeed" :mode "Spell")
522  (bind-key "Correct Last Misspelled Word" #k"meta-:")
523  (bind-key "Undo Last Spelling Correction" #k"control-x a")
524  )
525
526;;;; Overwrite Mode.
527||#
528
529#||
530(bind-key "Overwrite Delete Previous Character" #k"delete" :mode "Overwrite")
531(bind-key "Overwrite Delete Previous Character" #k"backspace" :mode "Overwrite")
532
533;;; Do up the printing characters ...
534(do ((i 33 (1+ i)))
535    ((= i 126))
536  (let ((key-event (hi:char-key-event (code-char i))))
537    (bind-key "Self Overwrite" key-event :mode "Overwrite")))
538
539(bind-key "Self Overwrite" #k"space" :mode "Overwrite")
540||#
541
542
543;;;; Comment bindings.
544
545(bind-key "Indent for Comment" #k"meta-;")
546(bind-key "Set Comment Column" #k"control-x ;")
547(bind-key "Kill Comment" #k"control-meta-;")
548(bind-key "Down Comment Line" #k"meta-n")
549(bind-key "Up Comment Line" #k"meta-p")
550(bind-key "Indent New Comment Line" #k"meta-j")
551(bind-key "Indent New Comment Line" #k"meta-linefeed")
552
553
554#||
555;;;; Word Abbrev Mode.
556
557(bind-key "Add Mode Word Abbrev" #k"control-x control-a")
558(bind-key "Add Global Word Abbrev" #k"control-x +")
559(bind-key "Inverse Add Mode Word Abbrev" #k"control-x control-h")
560(bind-key "Inverse Add Global Word Abbrev" #k"control-x \-")
561;; Removed in lieu of "Pop and Goto Mark".
562;;(bind-key "Abbrev Expand Only" #k"meta-space")
563(bind-key "Word Abbrev Prefix Mark" #k"meta-\"")
564(bind-key "Unexpand Last Word" #k"control-x u")
565
566(dolist (key (list #k"!" #k"~" #k"@" #k"#" #k";" #k"$" #k"%" #k"^" #k"&" #k"*"
567                   #k"\-" #k"_" #k"=" #k"+" #k"[" #k"]" #k"(" #k")" #k"/" #k"|"
568                   #k":" #k"'" #k"\"" #k"{" #k"}" #k"," #k"\<" #k"." #k"\>"
569                   #k"`" #k"\\" #k"?" #k"return" #k"newline" #k"tab" #k"space"))
570  (bind-key "Abbrev Expand Only" key :mode "Abbrev"))
571
572||#
573
574
575;;;; Scribe Mode.
576
577#+scribe-mode
578(progn
579(dolist (key (list #k"]" #k")" #k"}" #k"\>"))
580  (bind-key "Scribe Insert Bracket" key :mode "Scribe"))
581
582;;GB (bind-key "Scribe Buffer File" #k"control-x c" :mode "Scribe")
583(bind-key "Select Scribe Warnings" #k"control-meta-C" :mode "Scribe")
584
585(bind-key "Insert Scribe Directive" #k"hyper-i" :mode "Scribe")
586)
587
588
589;;;; Mailer commands.
590#+mail-mode
591(progn
592;;; Clear everything user might hit to avoid getting the internal error
593;;; message about modifying read-only buffers.
594;;;
595(do-alpha-key-events (key-event :both)
596  (bind-key "Illegal" key-event :mode "Headers")
597  (bind-key "Illegal" key-event :mode "Message"))
598
599;;; Global.
600;;;
601(bind-key "Incorporate and Read New Mail" #k"control-x i")
602(bind-key "Send Message" #k"control-x m")
603(bind-key "Message Headers" #k"control-x r")
604
605;;; Both Headers and Message modes.
606;;;
607;;; The bindings in these two blocks should be the same, one for "Message" mode
608;;; and one for "Headers" mode.
609;;;
610(bind-key "Next Message" #k"meta-n" :mode "Message")
611(bind-key "Previous Message" #k"meta-p" :mode "Message")
612(bind-key "Next Undeleted Message" #k"n" :mode "Message")
613(bind-key "Previous Undeleted Message" #k"p" :mode "Message")
614(bind-key "Send Message" #k"s" :mode "Message")
615(bind-key "Send Message" #k"m" :mode "Message")
616(bind-key "Forward Message" #k"f" :mode "Message")
617(bind-key "Headers Delete Message" #k"k" :mode "Message")
618(bind-key "Headers Undelete Message" #k"u" :mode "Message")
619(bind-key "Headers Refile Message" #k"o" :mode "Message")
620(bind-key "List Mail Buffers" #k"l" :mode "Message")
621(bind-key "Quit Headers" #k"q" :mode "Message")
622(bind-key "Incorporate and Read New Mail" #k"i" :mode "Message")
623(bind-key "Beginning of Buffer" #k"\<" :mode "Message")
624(bind-key "End of Buffer" #k"\>" :mode "Message")
625;;;
626(bind-key "Next Message" #k"meta-n" :mode "Headers")
627(bind-key "Previous Message" #k"meta-p" :mode "Headers")
628(bind-key "Next Undeleted Message" #k"n" :mode "Headers")
629(bind-key "Previous Undeleted Message" #k"p" :mode "Headers")
630(bind-key "Send Message" #k"s" :mode "Headers")
631(bind-key "Send Message" #k"m" :mode "Headers")
632(bind-key "Forward Message" #k"f" :mode "Headers")
633(bind-key "Headers Delete Message" #k"k" :mode "Headers")
634(bind-key "Headers Undelete Message" #k"u" :mode "Headers")
635(bind-key "Headers Refile Message" #k"o" :mode "Headers")
636(bind-key "List Mail Buffers" #k"l" :mode "Headers")
637(bind-key "Quit Headers" #k"q" :mode "Headers")
638(bind-key "Incorporate and Read New Mail" #k"i" :mode "Headers")
639(bind-key "Beginning of Buffer" #k"\<" :mode "Headers")
640(bind-key "End of Buffer" #k"\>" :mode "Headers")
641
642
643;;; Headers mode.
644;;;
645(bind-key "Delete Message and Down Line" #k"d" :mode "Headers")
646(bind-key "Pick Headers" #k"h" :mode "Headers")
647(bind-key "Show Message" #k"space" :mode "Headers")
648(bind-key "Show Message" #k"." :mode "Headers")
649(bind-key "Reply to Message" #k"r" :mode "Headers")
650(bind-key "Expunge Messages" #k"!" :mode "Headers")
651(bind-key "Headers Help" #k"?" :mode "Headers")
652
653
654;;; Message mode.
655;;;
656(bind-key "Delete Message and Show Next" #k"d" :mode "Message")
657(bind-key "Goto Headers Buffer" #k"^" :mode "Message")
658(bind-key "Scroll Message" #k"space" :mode "Message")
659(bind-key "Scroll Message" #k"control-v" :mode "Message")
660(bind-key "Scroll Window Up" #k"backspace" :mode "Message")
661(bind-key "Scroll Window Up" #k"delete" :mode "Message")
662(bind-key "Reply to Message in Other Window" #k"r" :mode "Message")
663(bind-key "Edit Message Buffer" #k"e" :mode "Message")
664(bind-key "Insert Message Region" #k"hyper-y" :mode "Message")
665(bind-key "Message Help" #k"?" :mode "Message")
666
667
668;;; Draft mode.
669;;;
670(bind-key "Goto Headers Buffer" #k"hyper-^" :mode "Draft")
671(bind-key "Goto Message Buffer" #k"hyper-m" :mode "Draft")
672(bind-key "Deliver Message" #k"hyper-s" :mode "Draft")
673(bind-key "Deliver Message" #k"hyper-c" :mode "Draft")
674(bind-key "Insert Message Buffer" #k"hyper-y" :mode "Draft")
675(bind-key "Delete Draft and Buffer" #k"hyper-q" :mode "Draft")
676(bind-key "List Mail Buffers" #k"hyper-l" :mode "Draft")
677(bind-key "Draft Help" #k"hyper-?" :mode "Draft")
678);#+mail-mode
679
680
681;;;; Netnews.
682
683#+netnews-mode
684(progn
685;;; Clear everything user might hit to avoid getting the internal error
686;;; message about modifying read-only buffers.
687;;;
688(do-alpha-key-events (key-event :both)
689  (bind-key "Illegal" key-event :mode "News-Headers")
690  (bind-key "Illegal" key-event :mode "News-Message"))
691
692
693;;; Global Netnews bindings
694;;;
695(bind-key "Netnews Post Message" #k"C-x P")
696
697
698;;; Both News-Headers and News-Message modes.
699;;;
700;;; The bindings in these two blocks should be the same, one for "News-Message"
701;;; mode and one for "News-Headers" mode.
702;;;
703(bind-key "List All Groups" #k"l" :mode "News-Headers")
704(bind-key "Netnews Append to File" #k"a" :mode "News-Headers")
705(bind-key "Netnews Forward Message" #k"f" :mode "News-Headers")
706(bind-key "Netnews Go to Next Group" #k"g" :mode "News-Headers")
707(bind-key "Netnews Next Article" #k"n" :mode "News-Headers")
708(bind-key "Netnews Previous Article" #k"p" :mode "News-Headers")
709(bind-key "Netnews Quit Starting Here" #k"." :mode "News-Headers")
710(bind-key "Netnews Group Punt Messages" #k"G" :mode "News-Headers")
711(bind-key "Netnews Show Whole Header" #k"w" :mode "News-Headers")
712(bind-key "Netnews Reply to Sender in Other Window" #k"r" :mode "News-Headers")
713(bind-key "Netnews Reply to Group in Other Window" #k"R" :mode "News-Headers")
714;;;
715(bind-key "List All Groups" #k"l" :mode "News-Message")
716(bind-key "Netnews Append to File" #k"a" :mode "News-Message")
717(bind-key "Netnews Forward Message" #k"f" :mode "News-Message")
718(bind-key "Netnews Go to Next Group" #k"g" :mode "News-Message")
719(bind-key "Netnews Next Article" #k"n" :mode "News-Message")
720(bind-key "Netnews Previous Article" #k"p" :mode "News-Message")
721(bind-key "Netnews Quit Starting Here" #k"." :mode "News-Message")
722(bind-key "Netnews Group Punt Messages" #k"G" :mode "News-Message")
723(bind-key "Netnews Show Whole Header" #k"w" :mode "News-Message")
724(bind-key "Netnews Reply to Sender in Other Window" #k"r" :mode "News-Message")
725(bind-key "Netnews Reply to Group in Other Window" #k"R" :mode "News-Message")
726
727
728;;; News-Headers.
729;;;
730(bind-key "Netnews Exit" #k"q" :mode "News-Headers")
731(bind-key "Netnews Headers File Message" #k"o" :mode "News-Headers")
732(bind-key "Netnews Headers Scroll Window Down" #k"c-v" :mode "News-Headers")
733(bind-key "Netnews Headers Scroll Window Up" #k"m-v" :mode "News-Headers")
734(bind-key "Netnews Next Line" #k"C-n" :mode "News-Headers")
735(bind-key "Netnews Next Line" #k"Downarrow" :mode "News-Headers")
736(bind-key "Netnews Previous Line" #k"C-p" :mode "News-Headers")
737(bind-key "Netnews Previous Line" #k"Uparrow" :mode "News-Headers")
738(bind-key "Netnews Select Message Buffer" #k"hyper-m" :mode "News-Headers")
739(bind-key "Netnews Show Article" #k"space" :mode "News-Headers")
740
741
742;;; News-Message.
743;;;
744(bind-key "Insert Message Region" #k"Hyper-y" :mode "News-Message")
745(bind-key "Netnews Message File Message" #k"o" :mode "News-Message")
746(bind-key "Netnews Message Keep Buffer" #k"k" :mode "News-Message")
747(bind-key "Netnews Message Quit" #k"q" :mode "News-Message")
748(bind-key "Netnews Message Scroll Down"  #k"space" :mode "News-Message")
749(bind-key "Netnews Goto Draft Buffer" #k"hyper-d" :mode "News-Message")
750(bind-key "Netnews Goto Headers Buffer" #k"^" :mode "News-Message")
751(bind-key "Netnews Goto Headers Buffer" #k"hyper-h" :mode "News-Message")
752(bind-key "Netnews Goto Post Buffer" #k"hyper-p" :mode "News-Message")
753(bind-key "Scroll Window Up" #k"backspace" :mode "News-Message")
754
755
756;;; Post.
757;;;
758(bind-key "Netnews Select Message Buffer" #k"hyper-m" :mode "Post")
759(bind-key "Netnews Deliver Post" #k"hyper-s" :mode "Post")
760(bind-key "Netnews Abort Post" #k"hyper-q" :mode "Post")
761(bind-key "Insert Message Buffer" #k"Hyper-y" :mode "Post")
762
763
764;;; News-Browse.
765
766(bind-key "Netnews Quit Browse" #k"q" :mode "News-Browse")
767(bind-key "Netnews Browse Add Group To File" #k"a" :mode "News-Browse")
768(bind-key "Netnews Browse Read Group" #k"space" :mode "News-Browse")
769(bind-key "Next Line" #k"n" :mode "News-Browse")
770(bind-key "Previous Line" #k"p" :mode "News-Browse")
771)
772
773;;;; Process (Shell).
774
775#+shell-mode
776(progn
777(bind-key "Shell" #k"control-meta-s")
778(bind-key "Confirm Process Input" #k"return" :mode "Process")
779(bind-key "Shell Complete Filename" #k"M-escape" :mode "Process")
780(bind-key "Interrupt Buffer Subprocess" #k"hyper-c" :mode "Process")
781(bind-key "Stop Buffer Subprocess" #k"hyper-z" :mode "Process")
782(bind-key "Quit Buffer Subprocess" #k"hyper-\\")
783(bind-key "Send EOF to Process" #k"hyper-d")
784
785(bind-key "Previous Interactive Input" #k"meta-p" :mode "Process")
786(bind-key "Search Previous Interactive Input" #k"meta-P" :mode "Process")
787(bind-key "Interactive Beginning of Line" #k"control-a" :mode "Process")
788(bind-key "Kill Interactive Input" #k"meta-i" :mode "Process")
789(bind-key "Next Interactive Input" #k"meta-n" :mode "Process")
790(bind-key "Reenter Interactive Input" #k"control-return" :mode "Process")
791)
792
793;;;; Bufed.
794
795#||
796(bind-key "Bufed" #k"control-x control-meta-b")
797(bind-key "Bufed Delete" #k"d" :mode "Bufed")
798(bind-key "Bufed Delete" #k"control-d" :mode "Bufed")
799(bind-key "Bufed Undelete" #k"u" :mode "Bufed")
800(bind-key "Bufed Expunge" #k"!" :mode "Bufed")
801(bind-key "Bufed Quit" #k"q" :mode "Bufed")
802(bind-key "Bufed Goto" #k"space" :mode "Bufed")
803(bind-key "Bufed Goto and Quit" #k"super-leftdown" :mode "Bufed")
804(bind-key "Bufed Save File" #k"s" :mode "Bufed")
805(bind-key "Next Line" #k"n" :mode "Bufed")
806(bind-key "Previous Line" #k"p" :mode "Bufed")
807
808
809(bind-key "Bufed Help" #k"?" :mode "Bufed")
810|#
811
812
813;;;; Dired.
814#||
815(progn
816(bind-key "Dired" #k"control-x control-meta-d")
817
818(bind-key "Dired Delete File and Down Line" #k"d" :mode "Dired")
819(bind-key "Dired Delete File with Pattern" #k"D" :mode "Dired")
820(bind-key "Dired Delete File" #k"control-d" :mode "Dired")
821(bind-key "Dired Delete File" #k"k" :mode "Dired")
822
823(bind-key "Dired Undelete File and Down Line" #k"u" :mode "Dired")
824(bind-key "Dired Undelete File with Pattern" #k"U" :mode "Dired")
825(bind-key "Dired Undelete File" #k"control-u" :mode "Dired")
826
827(bind-key "Dired Expunge Files" #k"!" :mode "Dired")
828(bind-key "Dired Update Buffer" #k"hyper-u" :mode "Dired")
829(bind-key "Dired View File" #k"space" :mode "Dired")
830(bind-key "Dired Edit File" #k"e" :mode "Dired")
831(bind-key "Dired Up Directory" #k"^" :mode "Dired")
832(bind-key "Dired Quit" #k"q" :mode "Dired")
833(bind-key "Dired Help" #k"?" :mode "Dired")
834
835(bind-key "Dired Copy File" #k"c" :mode "Dired")
836(bind-key "Dired Copy with Wildcard" #k"C" :mode "Dired")
837(bind-key "Dired Rename File" #k"r" :mode "Dired")
838(bind-key "Dired Rename with Wildcard" #k"R" :mode "Dired")
839
840(bind-key "Next Line" #k"n" :mode "Dired")
841(bind-key "Previous Line" #k"p" :mode "Dired")
842)
843||#
844
845;;;; View Mode.
846#||
847(progn
848(bind-key "View Scroll Down" #k"space" :mode "View")
849(bind-key "Scroll Window Up" #k"b" :mode "View")
850(bind-key "Scroll Window Up" #k"backspace" :mode "View")
851(bind-key "Scroll Window Up" #k"delete" :mode "View")
852(bind-key "View Return" #k"^" :mode "View")
853(bind-key "View Quit" #k"q" :mode "View")
854(bind-key "View Edit File" #k"e" :mode "View")
855(bind-key "View Help" #k"?" :mode "View")
856(bind-key "Beginning of Buffer" #k"\<" :mode "View")
857(bind-key "End of Buffer" #k"\>" :mode "View")
858)
859||#
860
861;;;; Lisp Library.
862
863#||
864(bind-key "Describe Pointer Library Entry" #k"leftdown" :mode "Lisp-Lib")
865(bind-key "Load Pointer Library Entry" #k"rightdown" :mode "Lisp-Lib")
866(bind-key "Describe Library Entry" #k"space" :mode "Lisp-Lib")
867(bind-key "Load Library Entry" #k"l" :mode "Lisp-Lib")
868(bind-key "Exit Lisp Library" #k"q" :mode "Lisp-Lib")
869(bind-key "Lisp Library Help" #k"?" :mode "Lisp-Lib")
870||#
871
872
873;;;; Completion mode.
874
875(dolist (c (command-bindings (getstring "Self Insert" *command-names*)))
876  (bind-key "Completion Self Insert" (car c) :mode "Completion"))
877
878(bind-key "Completion Self Insert" #k"space" :mode "Completion")
879(bind-key "Completion Self Insert" #k"tab" :mode "Completion")
880(bind-key "Completion Self Insert" #k"return" :mode "Completion")
881(bind-key "Completion Self Insert" #k"linefeed" :mode "Completion")
882
883(bind-key "Completion Complete Word" #k"end" :mode "Completion")
884(bind-key "Completion Rotate Completions" #k"meta-end" :mode "Completion")
885
886;;;; Caps-Lock mode.
887
888(do-alpha-key-events (key-event :lower)
889  (bind-key "Self Insert Caps Lock" key-event :mode "CAPS-LOCK"))
890
891
892;;;; I-Search mode.
893;;;;
894;;;; Anything that's not explicitly bound here will exit i-search.
895
896(dotimes (n hi::hemlock-char-code-limit)
897  (when (standard-char-p (code-char n))
898    (let ((key (make-key-event n)))
899      (bind-key "I-Search Self Insert" key :mode "I-Search"))))
900
901(bind-key "I-Search Repeat Forward" #k"control-s" :mode "I-Search")
902(bind-key "I-Search Repeat Backward" #k"control-r" :mode "I-Search")
903(bind-key "I-Search Backup" #k"backspace" :mode "I-Search")
904(bind-key "I-Search Backup" #k"delete" :mode "I-Search")
905(bind-key "I-Search Abort" #k"control-g" :mode "I-Search")
906(bind-key "I-Search Abort" #k"control-G" :mode "I-Search")
907(bind-key "I-Search Exit or Search" #k"escape" :mode "I-Search")
908(bind-key "I-Search Yank Word" #k"control-w" :mode "I-Search")
909(bind-key "Quoted Insert" #k"control-q" :mode "I-Search")
910
911
912;;;; Query/Replace mode.
913;;;;
914;;;; Anything that's not explicitly bound here will exit i-search.
915
916(bind-key "Query/Replace This" #k"y" :mode "Query/Replace")
917(bind-key "Query/Replace This" #k"space" :mode "Query/Replace")
918(bind-key "Query/Replace Skip" #k"n" :mode "Query/Replace")
919(bind-key "Query/Replace Skip" #k"backspace" :mode "Query/Replace")
920(bind-key "Query/Replace Skip" #k"delete" :mode "Query/Replace")
921(bind-key "Query/Replace All" #k"!" :mode "Query/Replace")
922(bind-key "Query/Replace Last" #k"." :mode "Query/Replace")
923(bind-key "Query/Replace Exit" #k"q" :mode "Query/Replace")
924(bind-key "Query/Replace Exit" #k"escape" :mode "Query/Replace")
925(bind-key "Query/Replace Abort" #k"control-g" :mode "Query/Replace")
926(bind-key "Query/Replace Abort" #k"control-G" :mode "Query/Replace")
927(bind-key "Query/Replace Help" #k"h" :mode "Query/Replace")
928(bind-key "Query/Replace Help" #k"?" :mode "Query/Replace")
929(bind-key "Query/Replace Help" #k"home" :mode "Query/Replace")
930(bind-key "Query/Replace Help" #k"control-_" :mode "Query/Replace")
931
932;;;; Logical characters.
933 
934(setf (logical-key-event-p #k"control-g" :abort) t)
935(setf (logical-key-event-p #k"y" :yes) t)
936(setf (logical-key-event-p #k"space" :yes) t)
937(setf (logical-key-event-p #k"n" :no) t)
938(setf (logical-key-event-p #k"backspace" :no) t)
939(setf (logical-key-event-p #k"delete" :no) t)
940(setf (logical-key-event-p #k"home" :help) t)
941(setf (logical-key-event-p #k"h" :help) t)
942(setf (logical-key-event-p #k"?" :help) t)
943(setf (logical-key-event-p #k"control-_" :help) t)
944(setf (logical-key-event-p #k"return" :confirm) t)
945(setf (logical-key-event-p #k"control-q" :quote) t)
946(setf (logical-key-event-p #k"k" :keep) t)
947(setf (logical-key-event-p #k"y" :y) t)
948(setf (logical-key-event-p #k"Y" :y) t)
949(setf (logical-key-event-p #k"n" :n) t)
950(setf (logical-key-event-p #k"N" :n) t)
951
Note: See TracBrowser for help on using the repository browser.