Changeset 8733


Ignore:
Timestamp:
03/06/05 21:28:19 (16 years ago)
Author:
piso
Message:

Work in progress.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/emacs.lisp

    r8730 r8733  
    22;;;
    33;;; Copyright (C) 2005 Peter Graves
    4 ;;; $Id: emacs.lisp,v 1.9 2005-03-06 19:40:52 piso Exp $
     4;;; $Id: emacs.lisp,v 1.10 2005-03-06 21:28:19 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    4646
    4747;; // File menu.
    48 ;; mapKey(KeyEvent.VK_O, CTRL_MASK, "openFile");
    4948(define-key *control-x-map* "Ctrl F" "openFile")
    5049;; mapKey(KeyEvent.VK_O, CTRL_MASK | ALT_MASK, "openFileInOtherWindow");
     
    5251;; mapKey(KeyEvent.VK_N, CTRL_MASK, "newBuffer");
    5352;; mapKey(KeyEvent.VK_R, ALT_MASK, "recentFiles");
    54 ;; mapKey(KeyEvent.VK_S, CTRL_MASK, "save");
    5553(define-key *control-x-map* "Ctrl S" "save")
    5654;; mapKey(KeyEvent.VK_S, CTRL_MASK | SHIFT_MASK, "saveAs");
    5755;; mapKey(KeyEvent.VK_S, CTRL_MASK | ALT_MASK, "saveCopy");
    5856;; mapKey(KeyEvent.VK_F2, 0, "saveAll");
    59 ;; mapKey(KeyEvent.VK_F4, CTRL_MASK, "killBuffer");
    60 ;; mapKey(KeyEvent.VK_W, CTRL_MASK, "killBuffer");
     57
     58;; j's killBuffer is really kill-this-buffer
    6159(define-key *control-x-map* "k" "killBuffer")
     60
    6261;; mapKey(KeyEvent.VK_P, ALT_MASK, "properties");
    6362;; mapKey(KeyEvent.VK_N, CTRL_MASK | SHIFT_MASK, "newFrame");
    64 ;; mapKey(KeyEvent.VK_X, ALT_MASK, "executeCommand");
    6563(define-key *global-map* "Alt X" "executeCommand")
    6664(define-key *esc-map* #\x "executecommand")
     
    6866;; mapKey(KeyEvent.VK_Q, CTRL_MASK | SHIFT_MASK, "saveAllExit");
    6967(define-key *control-x-map* "Ctrl C" "saveAllExit")
    70 ;; mapKey(KeyEvent.VK_Q, CTRL_MASK, "quit");
     68
     69(define-key *global-map* "Ctrl Space" #'set-mark-command)
     70(define-key *global-map* "Ctrl Shift 2" #'set-mark-command) ; C-@
    7171
    7272;; // Edit menu.
    73 (define-key *global-map* "Ctrl Space" #'set-mark-command)
    74 ;; mapKey(KeyEvent.VK_BACK_SPACE, ALT_MASK, "undo");
    75 ;; mapKey(KeyEvent.VK_Z, CTRL_MASK, "undo");
     73(define-keys *global-map*
     74  `(("Ctrl /"                   "undo")
     75    ("Ctrl Shift 0x2d"          "undo") ; C-_
     76    ("Shift Alt 0x2d"           "redo") ; M-_
     77    ("Ctrl W"                   "killRegion")
     78    ("Shift Delete"             "killRegion")
     79    ("Alt W"                    "copyRegion")
     80    ("Ctrl NumPad Insert"       "copyRegion")
     81    ("Ctrl Y"                   "paste")
     82    ("Shift NumPad Insert"      "paste")
     83    ("Alt Y"                    "cyclePaste")))
     84
    7685(define-key *control-x-map* "u" "undo")
    77 ;; mapKey(KeyEvent.VK_Y, CTRL_MASK, "redo");
    78 ;; mapKey(KeyEvent.VK_DELETE, SHIFT_MASK, "killRegion");
    79 ;; mapKey(KeyEvent.VK_X, CTRL_MASK, "killRegion");
    80 (define-key *global-map* "Ctrl W" "killRegion")
     86(define-key *esc-map* #\y "cyclePaste")
    8187;; mapKey(KeyEvent.VK_X, CTRL_MASK | SHIFT_MASK, "killAppend");
    82 ;; mapKey(KeyEvent.VK_C, CTRL_MASK, "copyRegion");
    83 (define-key *global-map* "Alt W" "copyRegion")
    8488;; mapKey(KeyEvent.VK_C, CTRL_MASK | SHIFT_MASK, "copyAppend");
    85 ;; mapKey(KeyEvent.VK_V, CTRL_MASK, "paste");
    86 (define-key *global-map* "Ctrl Y" "paste")
    87 ;; mapKey(KeyEvent.VK_V, CTRL_MASK | SHIFT_MASK, "cyclePaste");
    88 (define-key *global-map* "Alt Y" "cyclePaste")
    89 (define-key *esc-map* #\y "cyclePaste")
    9089;; mapKey(KeyEvent.VK_T, ALT_MASK, "cycleTabWidth");
    9190
     
    9594;; mapKey(KeyEvent.VK_M, CTRL_MASK, "findMatchingChar");
    9695;; mapKey(KeyEvent.VK_M, CTRL_MASK | SHIFT_MASK, "selectSyntax");
    97 ;; mapKey(KeyEvent.VK_UP, CTRL_MASK | ALT_MASK, "findFirstOccurrence");
    98 (define-key *global-map* "Ctrl Alt Up" "findFirstOccurrence")
    99 ;; mapKey(KeyEvent.VK_KP_UP, CTRL_MASK | ALT_MASK, "findFirstOccurrence");
    100 (define-key *global-map* "Ctrl Alt NumPad Up" "findFirstOccurrence")
    101 ;; mapKey(KeyEvent.VK_UP, ALT_MASK, "findPrevWord");
    102 (define-key *global-map* "Alt Up" "findPrevWord")
    103 ;; mapKey(KeyEvent.VK_KP_UP, ALT_MASK, "findPrevWord");
    104 (define-key *global-map* "Alt NumPad Up" "findPrevWord")
    105 ;; mapKey(KeyEvent.VK_DOWN, ALT_MASK, "findNextWord");
    106 (define-key *global-map* "Alt Down" "findNextWord")
    107 ;; mapKey(KeyEvent.VK_KP_DOWN, ALT_MASK, "findNextWord");
    108 (define-key *global-map* "Alt NumPad Down" "findNextWord")
     96
     97(define-keys *global-map*
     98  '(("Ctrl Alt Up"              "findFirstOccurrence")
     99    ("Ctrl Alt NumPad Up"       "findFirstOccurrence")
     100    ("Alt Up"                   "findPrevWord")
     101    ("Alt NumPad Up"            "findPrevWord")
     102    ("Alt Down"                 "findNextWord")
     103    ("Alt NumPad Down"          "findNextWord")))
     104
    109105;; mapKey(KeyEvent.VK_N, CTRL_MASK | ALT_MASK, "nextChange");
    110106;; mapKey(KeyEvent.VK_P, CTRL_MASK | ALT_MASK, "previousChange");
    111 ;; mapKey(KeyEvent.VK_F5, 0, "pushPosition");
    112107(define-key *global-map* "F5" "pushPosition")
    113 ;; mapKey(KeyEvent.VK_F5, SHIFT_MASK, "popPosition");
    114108(define-key *global-map* "Shift F5" "popPosition")
    115109
    116110;; // Search menu.
    117 ;; if (Editor.preferences().getBooleanProperty(Property.USE_INCREMENTAL_FIND))
    118 ;; mapKey(KeyEvent.VK_F, CTRL_MASK, "incrementalFind");
    119 (define-key *global-map* "Ctrl S" "incrementalFind")
    120 ;; else
    121 ;; mapKey(KeyEvent.VK_F, CTRL_MASK, "find");
    122 (define-key *global-map* "Alt F3" "find")
     111(define-keys *global-map*
     112  '(("Ctrl S"                   "incrementalFind")
     113    ("Alt F3"                   "find")
     114    ("F3"                       "findNext")
     115    ("Shift F3"                 "findPrev")
     116    ("F6"                       "findInFiles")
     117    ("Ctrl Shift F"             "findInFiles")
     118    ("Ctrl F3"                  "listOccurrences")
     119    ("Ctrl Shift L"             "listFiles")
     120    ("Shift Alt 5"              "replace") ; M-%
     121    ("Ctrl Shift R"             "replaceInFiles")))
    123122
    124123;; Emacs uses Ctrl Alt L for reposition-window
    125124;; XEmacs uses Ctrl Alt L for switch-to-other-buffer
    126125(define-key *global-map* "Ctrl Alt L" "listOccurrencesOfPatternAtDot")
    127 
    128 (define-key *global-map* "F3" "findNext")
    129 (define-key *global-map* "Shift F3" "findPrev")
    130 (define-key *global-map* "F6" "findInFiles")
    131 (define-key *global-map* "Ctrl Shift F" "findInFiles")
    132 (define-key *global-map* "Ctrl F3" "listOccurrences")
    133 (define-key *global-map* "Ctrl Shift L" "listFiles")
    134 (define-key *global-map* "Shift Alt 5" "replace") ; M-%
    135 (define-key *global-map* "Ctrl Shift R" "replaceInFiles")
    136126
    137127;; mapKey(KeyEvent.VK_K, CTRL_MASK, "killLine");
     
    186176
    187177(define-keys *esc-map*
    188   '((#\< "bob")
    189     (#\> "eob")
    190     (#\. "findTagAtDot")
    191     (#\% "replace")
     178  '((#\<                        "bob")
     179    (#\>                        "eob")
     180    (#\.                        "findTagAtDot")
     181    (#\%                        "replace")
    192182    ))
    193183
    194184;; Emacs uses Ctrl Up for backward-paragraph, which j doesn't have.
    195185(define-keys *global-map*
    196   '(("Ctrl Up"          "windowUp")
    197     ("Ctrl NumPad Up"   "windowUp")))
     186  '(("Ctrl Up"                  "windowUp")
     187    ("Ctrl NumPad Up"           "windowUp")))
    198188;; Emacs uses Ctrl Down for forward-paragraph, which j doesn't have.
    199189(define-keys *global-map*
    200   '(("Ctrl Down"        "windowDown")
    201     ("Ctrl NumPad Down" "windowDown")))
     190  '(("Ctrl Down"                "windowDown")
     191    ("Ctrl NumPad Down"         "windowDown")))
    202192
    203193;; Emacs uses Alt Left for backward-word, which is also on Alt B and Ctrl Left.
    204194(define-keys *global-map*
    205   '(("Alt Left" "prevBuffer")
    206     ("Alt NumPad Left" "prevBuffer")))
     195  '(("Alt Left"                 "prevBuffer")
     196    ("Alt NumPad Left"          "prevBuffer")))
    207197;; Emacs uses Alt Right for forward-word, which is also on Alt F and Ctrl Right.
    208198(define-keys *global-map*
    209   '(("Alt Right" "nextBuffer")
    210     ("Alt NumPad Right" "nextBuffer")))
     199  '(("Alt Right"                "nextBuffer")
     200    ("Alt NumPad Right"         "nextBuffer")))
    211201
    212202;; mapKey(KeyEvent.VK_PAGE_UP, ALT_MASK, "pageUpOtherWindow");
     
    217207;; mapKey(KeyEvent.VK_PAGE_DOWN, CTRL_MASK, "bottom");
    218208;; mapKey(KeyEvent.VK_DELETE, 0, "delete");
    219 (define-key *global-map* "Delete" "delete")
    220 (define-key *global-map* "Ctrl D" "delete")
    221 ;; mapKey(KeyEvent.VK_BACK_SPACE, 0, "backspace");
    222 (define-key *global-map* "Backspace" "backspace")
    223 ;; mapKey(KeyEvent.VK_BACK_SPACE, SHIFT_MASK, "backspace");
    224 (define-key *global-map* "Shift Backspace" "backspace")
    225 ;; mapKey(KeyEvent.VK_BACK_SPACE, CTRL_MASK, "deleteWordLeft");
    226 (define-key *global-map* "Ctrl Backspace" "deleteWordLeft")
    227 ;; mapKey(KeyEvent.VK_ENTER, 0, "newline");
    228 (define-key *global-map* "Enter" "newline")
    229 (define-key *global-map* "Ctrl M" "newline")
    230 (define-key *global-map* "Ctrl J" "newlineAndIndent")
    231 
    232 ;; mapKey(KeyEvent.VK_ESCAPE, 0, "escape");
     209(define-keys *global-map*
     210  '(("Delete"                   "delete")
     211    ("Ctrl D"                   "delete")
     212    ("Backspace"                "backspace")
     213    ("Shift Backspace"          "backspace")
     214    ("Ctrl Backspace"           "deleteWordLeft")
     215    ("Enter"                    "newline")
     216    ("Ctrl M"                   "newline")
     217    ("Ctrl J"                   "newlineAndIndent")))
     218
     219;; keyboard-quit
    233220(define-key *global-map* "Ctrl G" "escape")
    234221
     
    330317;; mapKey(KeyEvent.VK_T, CTRL_MASK | SHIFT_MASK, "sidebarListTags");
    331318
    332 ;; mapKey(KeyEvent.VK_F10, 0, "splitWindow");
    333 (define-key *control-x-map* "2" "splitWindow")
    334 ;; mapKey(KeyEvent.VK_F10, SHIFT_MASK, "unsplitWindow");
    335 (define-key *control-x-map*  "1" "unsplitwindow")
    336 ;; mapKey(KeyEvent.VK_F10, CTRL_MASK | SHIFT_MASK, "killWindow");
    337 (define-key *control-x-map* "0" "killWindow")
    338 ;; mapKey(KeyEvent.VK_O, ALT_MASK, "otherWindow");
    339 (define-key *control-x-map*  "o" "otherwindow")
     319(define-keys *control-x-map*
     320  '(("2"                        "splitWindow")
     321    ("1"                        "unsplitwindow")
     322    ("0"                        "killWindow")
     323    ("o"                        "otherwindow")))
    340324
    341325;; if (Editor.preferences().getBooleanProperty(Property.ENABLE_EXPERIMENTAL_FEATURES))
Note: See TracChangeset for help on using the changeset viewer.