Changeset 8690


Ignore:
Timestamp:
03/03/05 15:01:32 (16 years ago)
Author:
piso
Message:

Work in progress.

File:
1 edited

Legend:

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

    r8687 r8690  
    22;;;
    33;;; Copyright (C) 2005 Peter Graves
    4 ;;; $Id: emacs.lisp,v 1.1 2005-03-03 14:06:56 piso Exp $
     4;;; $Id: emacs.lisp,v 1.2 2005-03-03 15:01:32 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    5959(define-key *control-x-map* "k" "killBuffer")
    6060;; mapKey(KeyEvent.VK_P, ALT_MASK, "properties");
    61 ;; mapKey(KeyEvent.VK_RIGHT, ALT_MASK, "nextBuffer");
    62 (define-key *global-map* "Alt Right" "nextBuffer")
    63 ;; mapKey(KeyEvent.VK_KP_RIGHT, ALT_MASK, "nextBuffer");
    64 (define-key *global-map* "Alt NumPad Right" "nextBuffer")
    65 ;; mapKey(KeyEvent.VK_LEFT, ALT_MASK, "prevBuffer");
    66 (define-key *global-map* "Alt Left" "prevBuffer")
    67 ;; mapKey(KeyEvent.VK_KP_LEFT, ALT_MASK, "prevBuffer");
    68 (define-key *global-map* "Alt NumPad Left" "prevBuffer")
    6961;; mapKey(KeyEvent.VK_N, CTRL_MASK | SHIFT_MASK, "newFrame");
    7062;; mapKey(KeyEvent.VK_X, ALT_MASK, "executeCommand");
     
    159151    ("Ctrl End"                 "eob")
    160152    ("Ctrl Shift End"           "selectEob")
     153    ("Ctrl P"                   "up")
    161154    ("Up"                       "up")
    162155    ("NumPad Up"                "up")
     156    ("Ctrl N"                   "down")
    163157    ("Down"                     "down")
    164158    ("NumPad Down"              "down")
     
    167161    ("Shift Down"               "selectDown")
    168162    ("Shift NumPad Down"        "selectDown")
     163    ("Ctrl B"                   "left")
    169164    ("Left"                     "left")
    170165    ("NumPad Left"              "left")
     166    ("Ctrl F"                   "right")
    171167    ("Right"                    "right")
    172168    ("NumPad Right"             "right")
     
    174170    ("Shift NumPad Left"        "selectLeft")
    175171    ("Shift Right"              "selectRight")
    176     ("Shift NumPad Right"       "selectRight")))
    177 
    178 ;; NOTE Emacs uses Ctrl Up for backward-paragraph.
    179 ;; (define-key *global-map* "Ctrl Up" "windowUp")
    180 ;; (define-key *global-map* "Ctrl NumPad Up" "windowUp")
     172    ("Shift NumPad Right"       "selectRight")
     173    ("Alt B"                    "wordLeft")
     174    ("Ctrl Left"                "wordLeft")
     175    ("Ctrl NumPad Left"         "wordLeft")
     176    ("Ctrl Right"               "wordRight")
     177    ("Ctrl NumPad Right"        "wordRight")
     178    ("Ctrl Shift Left"          "selectWordLeft")
     179    ("Ctrl Shift NumPad Left"   "selectWordLeft")
     180    ("Ctrl Shift Right"         "selectWordRight")
     181    ("Ctrl Shift NumPad Right"  "selectWordRight")
     182    ("Alt V"                    "pageUp")
     183    ("Page Up"                  "pageUp")
     184    ("Ctrl V"                   "pageDown")
     185    ("Page Down"                "pageDown")))
     186
     187;; Emacs uses Ctrl Up for backward-paragraph, which j doesn't have.
    181188(define-keys *global-map*
    182189  '(("Ctrl Up"          "windowUp")
    183190    ("Ctrl NumPad Up"   "windowUp")))
    184 ;; NOTE Emacs uses Ctrl Down for forward-paragraph.
    185 ;; (define-key *global-map* "Ctrl Down" "windowDown")
    186 ;; (define-key *global-map* "Ctrl NumPad Up" "windowDown")
     191;; Emacs uses Ctrl Down for forward-paragraph, which j doesn't have.
    187192(define-keys *global-map*
    188193  '(("Ctrl Down"        "windowDown")
    189194    ("Ctrl NumPad Down" "windowDown")))
    190195
    191 ;; mapKey(KeyEvent.VK_PAGE_UP, 0, "pageUp");
    192 (define-key *global-map* "Page Up" "pageUp")
     196;; Emacs uses Alt Left for backward-word, which is also on Alt B and Ctrl Left.
     197(define-keys *global-map*
     198  '(("Alt Left" "prevBuffer")
     199    ("Alt NumPad Left" "prevBuffer")))
     200;; Emacs uses Alt Right for forward-word, which is also on Alt F and Ctrl Right.
     201(define-keys *global-map*
     202  '(("Alt Right" "nextBuffer")
     203    ("Alt NumPad Right" "nextBuffer")))
     204
    193205;; mapKey(KeyEvent.VK_PAGE_UP, ALT_MASK, "pageUpOtherWindow");
    194206;; mapKey(KeyEvent.VK_PAGE_UP, SHIFT_MASK, "selectPageUp");
    195 ;; mapKey(KeyEvent.VK_PAGE_DOWN, 0, "pageDown");
    196 (define-key *global-map* "Page Down" "pageDown")
    197207;; mapKey(KeyEvent.VK_PAGE_DOWN, ALT_MASK, "pageDownOtherWindow");
    198208;; mapKey(KeyEvent.VK_PAGE_DOWN, SHIFT_MASK, "selectPageDown");
    199209;; mapKey(KeyEvent.VK_PAGE_UP, CTRL_MASK, "top");
    200210;; mapKey(KeyEvent.VK_PAGE_DOWN, CTRL_MASK, "bottom");
    201 ;; mapKey(KeyEvent.VK_LEFT, CTRL_MASK, "wordLeft");
    202 (define-key *global-map* "Ctrl Left" "wordLeft")
    203 ;; mapKey(KeyEvent.VK_KP_LEFT, CTRL_MASK, "wordLeft");
    204 (define-key *global-map* "Ctrl NumPad Left" "wordLeft")
    205 ;; mapKey(KeyEvent.VK_RIGHT, CTRL_MASK, "wordRight");
    206 (define-key *global-map* "Ctrl Right" "wordRight")
    207 ;; mapKey(KeyEvent.VK_KP_RIGHT, CTRL_MASK, "wordRight");
    208 (define-key *global-map* "Ctrl NumPad Right" "wordRight")
    209 ;; mapKey(KeyEvent.VK_LEFT, CTRL_MASK | SHIFT_MASK, "selectWordLeft");
    210 (define-key *global-map* "Ctrl Shift Left" "selectWordLeft")
    211 ;; mapKey(KeyEvent.VK_KP_LEFT, CTRL_MASK | SHIFT_MASK, "selectWordLeft");
    212 (define-key *global-map* "Ctrl Shift NumPad Left" "selectWordLeft")
    213 ;; mapKey(KeyEvent.VK_RIGHT, CTRL_MASK | SHIFT_MASK, "selectWordRight");
    214 (define-key *global-map* "Ctrl Shift Right" "selectWordRight")
    215 ;; mapKey(KeyEvent.VK_KP_RIGHT, CTRL_MASK | SHIFT_MASK, "selectWordRight");
    216 (define-key *global-map* "Ctrl Shift NumPad Right" "selectWordRight")
    217211;; mapKey(KeyEvent.VK_DELETE, 0, "delete");
    218212(define-key *global-map* "Delete" "delete")
     
    440434(defun emacs ()
    441435  (use-global-map *global-map*)
     436  ;; FIXME This is the right idea (so mappings like Alt F will be possible),
     437  ;; but it doesn't quite work.
     438  (set-global-property "useMenuMnemonics" "false")
    442439  (j::%execute-command "reloadKeyMaps"))
    443440
Note: See TracChangeset for help on using the changeset viewer.