help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

keybindings for axiom-mode


From: Martin Rubey
Subject: keybindings for axiom-mode
Date: 22 Oct 2007 09:38:44 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

Robert Funnell <robert.funnell@mcgill.ca> writes:

> > Since I'm not so familiar with escape sequences, could you tell me what
> > keystrokes correspond to "C-[ up"?
> 
> C-[ is control-[ (my M-) and up is my up-arrow key.

OK.  At least in my terminal, M-up and C-up do not seem to send any useful
events.  So I bound ESC-up/down to have the same behaviour as M-up/down.
C-up/down is already the same as M-p/n, as it is taken from comint-mode.

Maybe you can help me make the following snippet sane:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar axiom-mode-map (copy-keymap comint-mode-map) 
  "local key map for Axiom terminal mode")
(define-key axiom-mode-map [(meta k)] 'axiom-copy-to-clipboard)
(define-key axiom-mode-map [(ctrl return)] 'axiom-yank)
(define-key axiom-mode-map [(meta up)] 'axiom-previous-input)
(define-key axiom-mode-map (kbd "ESC <up>") 'axiom-previous-input)
(define-key axiom-mode-map [(meta down)] 'axiom-next-input)
(define-key axiom-mode-map (kbd "ESC <down>") 'axiom-next-input)
(define-key axiom-mode-map [left] 'axiom-backward-char)
(define-key axiom-mode-map [right] 'axiom-forward-char)
(define-key axiom-mode-map [(shift up)] 'axiom-paint-previous-line)
(define-key axiom-mode-map [(shift down)] 'axiom-paint-next-line)
(define-key axiom-mode-map [(shift left)] 'axiom-paint-previous-char)
(define-key axiom-mode-map [(shift right)] 'axiom-paint-next-char)
;; doesn't work in terminal
;; (define-key axiom-mode-map [return] 'axiom-eval)
(define-key axiom-mode-map "\C-m" 'axiom-eval)
;; doesn't work in terminal
;;(define-key axiom-mode-map [(meta return)] 'axiom-eval-append)
(define-key axiom-mode-map "\M-\C-m" 'axiom-eval-append)
(define-key axiom-mode-map "\t" 'axiom-dynamic-complete)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; in the body of define-derived-mode, I add:

    (use-local-map axiom-mode-map)
    (substitute-key-definition 'comint-previous-input 
                               'axiom-scroll-previous-input axiom-mode-map)
    (substitute-key-definition 'comint-next-input 
                               'axiom-scroll-next-input axiom-mode-map)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

As you can probably see, I have no idea how this "should" work.  I'd be very
happy if you could help me out there.  Oh, comint binds C-c C-p/n to the
corresponding feature - and - oh, this of course calls the "wrong" function.
Maybe I shouldn't use copy-keymap.  Not sure.

> > I find C-u 7 M-k especially useful ...
> 
> Except that I've redefined C-u to get an argument string (emulating the old
> BBN Pen editor). You're using it to repeat, right?


Well, I didn't redefine C-u.  If I type C-u 7 M-k the function bound to M-k,
which is axiom-copy-to-clipboard, is called with the integer argument 7.  Thus,
it would copy the previous seven input-output combinations into the kill-ring.
I find this extremely useful if I want to communicate what I did in axiom...


Martin


reply via email to

[Prev in Thread] Current Thread [Next in Thread]