diff options
author | Karoly Lorentey <lorentey@elte.hu> | 2005-05-14 01:56:59 +0000 |
---|---|---|
committer | Karoly Lorentey <lorentey@elte.hu> | 2005-05-14 01:56:59 +0000 |
commit | 358d59793579372c29707bd6866bee76b5deb943 (patch) | |
tree | ff8ac820e457e9ea3ac18e4af9089c6602c0ce42 /lisp/term/rxvt.el | |
parent | 8f441aaf29addc201811f88fe272f30ea4e757af (diff) | |
download | emacs-358d59793579372c29707bd6866bee76b5deb943.tar.gz |
Speed up `emacsclient -t' on xterms. (by suggestion of Dan Nicolaescu)
* lisp/term/xterm.el: Speed up load time by protecting
`substitute-key-definition' and `define-key' calls against multiple
execution.
* lisp/term/rxvt.el: Ditto.
* lisp/term/lk201.el: Ditto.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-345
Diffstat (limited to 'lisp/term/rxvt.el')
-rw-r--r-- | lisp/term/rxvt.el | 146 |
1 files changed, 72 insertions, 74 deletions
diff --git a/lisp/term/rxvt.el b/lisp/term/rxvt.el index 7b53f098e82..180e0b40946 100644 --- a/lisp/term/rxvt.el +++ b/lisp/term/rxvt.el @@ -28,80 +28,78 @@ (require 'server) -(defvar rxvt-function-map (make-sparse-keymap) - "Function key rxvt-function-mapoverrides for rxvt.") - -;; Set up function-key-map entries that termcap and terminfo don't know. -;; XXX We need to find a way to have these define-keys be display-local. -- Lorentey -(define-key rxvt-function-map "\e[A" [up]) -(define-key rxvt-function-map "\e[B" [down]) -(define-key rxvt-function-map "\e[C" [right]) -(define-key rxvt-function-map "\e[D" [left]) -(define-key rxvt-function-map "\e[7~" [home]) -(define-key rxvt-function-map "\e[2~" [insert]) -(define-key rxvt-function-map "\e[3~" [delete]) -(define-key rxvt-function-map "\e[4~" [select]) -(define-key rxvt-function-map "\e[5~" [prior]) -(define-key rxvt-function-map "\e[6~" [next]) -(define-key rxvt-function-map "\e[11~" [f1]) -(define-key rxvt-function-map "\e[12~" [f2]) -(define-key rxvt-function-map "\e[13~" [f3]) -(define-key rxvt-function-map "\e[14~" [f4]) -(define-key rxvt-function-map "\e[15~" [f5]) -(define-key rxvt-function-map "\e[17~" [f6]) -(define-key rxvt-function-map "\e[18~" [f7]) -(define-key rxvt-function-map "\e[19~" [f8]) -(define-key rxvt-function-map "\e[20~" [f9]) -(define-key rxvt-function-map "\e[21~" [f10]) -(define-key rxvt-function-map "\e[23~" [f11]) -(define-key rxvt-function-map "\e[24~" [f12]) -(define-key rxvt-function-map "\e[29~" [print]) - -(define-key rxvt-function-map "\e[11^" [C-f1]) -(define-key rxvt-function-map "\e[12^" [C-f2]) -(define-key rxvt-function-map "\e[13^" [C-f3]) -(define-key rxvt-function-map "\e[14^" [C-f4]) -(define-key rxvt-function-map "\e[15^" [C-f5]) -(define-key rxvt-function-map "\e[17^" [C-f6]) -(define-key rxvt-function-map "\e[18^" [C-f7]) -(define-key rxvt-function-map "\e[19^" [C-f8]) -(define-key rxvt-function-map "\e[20^" [C-f9]) -(define-key rxvt-function-map "\e[21^" [C-f10]) -(define-key rxvt-function-map "\e[23^" [C-f11]) -(define-key rxvt-function-map "\e[24^" [C-f12]) - -(define-key rxvt-function-map "\e[29~" [print]) - -(define-key rxvt-function-map "\e[2;2~" [S-insert]) -(define-key rxvt-function-map "\e[3$" [S-delete]) - -(define-key rxvt-function-map "\e[2^" [C-insert]) -(define-key rxvt-function-map "\e[3^" [C-delete]) -(define-key rxvt-function-map "\e[5^" [C-prior]) -(define-key rxvt-function-map "\e[6^" [C-next]) -(define-key rxvt-function-map "\eOd" [C-left]) -(define-key rxvt-function-map "\eOc" [C-right]) -(define-key rxvt-function-map "\eOa" [C-up]) -(define-key rxvt-function-map "\eOb" [C-down]) - -(define-key rxvt-function-map "\e[5$" [S-prior]) -(define-key rxvt-function-map "\e[6$" [S-next]) -(define-key rxvt-function-map "\e[8$" [S-end]) -(define-key rxvt-function-map "\e[7$" [S-home]) -(define-key rxvt-function-map "\e[d" [S-left]) -(define-key rxvt-function-map "\e[c" [S-right]) -(define-key rxvt-function-map "\e[a" [S-up]) -(define-key rxvt-function-map "\e[b" [S-down]) - -;; Use inheritance to let the main keymap override those defaults. -;; This way we don't override terminfo-derived settings or settings -;; made in the .emacs file. -(unless (let ((map (keymap-parent function-key-map)) - found) - (while (and (not found) map) - (setq found (eq rxvt-function-map map) - map (keymap-parent map))) - found) +(defvar rxvt-function-map nil + "Function key overrides for rxvt.") + +;; Protect against reloads. +(unless rxvt-function-map + (setq rxvt-function-map (make-sparse-keymap)) + + ;; Set up function-key-map entries that termcap and terminfo don't know. + ;; XXX We need to find a way to have these define-keys be display-local. -- Lorentey + (define-key rxvt-function-map "\e[A" [up]) + (define-key rxvt-function-map "\e[B" [down]) + (define-key rxvt-function-map "\e[C" [right]) + (define-key rxvt-function-map "\e[D" [left]) + (define-key rxvt-function-map "\e[7~" [home]) + (define-key rxvt-function-map "\e[2~" [insert]) + (define-key rxvt-function-map "\e[3~" [delete]) + (define-key rxvt-function-map "\e[4~" [select]) + (define-key rxvt-function-map "\e[5~" [prior]) + (define-key rxvt-function-map "\e[6~" [next]) + (define-key rxvt-function-map "\e[11~" [f1]) + (define-key rxvt-function-map "\e[12~" [f2]) + (define-key rxvt-function-map "\e[13~" [f3]) + (define-key rxvt-function-map "\e[14~" [f4]) + (define-key rxvt-function-map "\e[15~" [f5]) + (define-key rxvt-function-map "\e[17~" [f6]) + (define-key rxvt-function-map "\e[18~" [f7]) + (define-key rxvt-function-map "\e[19~" [f8]) + (define-key rxvt-function-map "\e[20~" [f9]) + (define-key rxvt-function-map "\e[21~" [f10]) + (define-key rxvt-function-map "\e[23~" [f11]) + (define-key rxvt-function-map "\e[24~" [f12]) + (define-key rxvt-function-map "\e[29~" [print]) + + (define-key rxvt-function-map "\e[11^" [C-f1]) + (define-key rxvt-function-map "\e[12^" [C-f2]) + (define-key rxvt-function-map "\e[13^" [C-f3]) + (define-key rxvt-function-map "\e[14^" [C-f4]) + (define-key rxvt-function-map "\e[15^" [C-f5]) + (define-key rxvt-function-map "\e[17^" [C-f6]) + (define-key rxvt-function-map "\e[18^" [C-f7]) + (define-key rxvt-function-map "\e[19^" [C-f8]) + (define-key rxvt-function-map "\e[20^" [C-f9]) + (define-key rxvt-function-map "\e[21^" [C-f10]) + (define-key rxvt-function-map "\e[23^" [C-f11]) + (define-key rxvt-function-map "\e[24^" [C-f12]) + + (define-key rxvt-function-map "\e[29~" [print]) + + (define-key rxvt-function-map "\e[2;2~" [S-insert]) + (define-key rxvt-function-map "\e[3$" [S-delete]) + + (define-key rxvt-function-map "\e[2^" [C-insert]) + (define-key rxvt-function-map "\e[3^" [C-delete]) + (define-key rxvt-function-map "\e[5^" [C-prior]) + (define-key rxvt-function-map "\e[6^" [C-next]) + (define-key rxvt-function-map "\eOd" [C-left]) + (define-key rxvt-function-map "\eOc" [C-right]) + (define-key rxvt-function-map "\eOa" [C-up]) + (define-key rxvt-function-map "\eOb" [C-down]) + + (define-key rxvt-function-map "\e[5$" [S-prior]) + (define-key rxvt-function-map "\e[6$" [S-next]) + (define-key rxvt-function-map "\e[8$" [S-end]) + (define-key rxvt-function-map "\e[7$" [S-home]) + (define-key rxvt-function-map "\e[d" [S-left]) + (define-key rxvt-function-map "\e[c" [S-right]) + (define-key rxvt-function-map "\e[a" [S-up]) + (define-key rxvt-function-map "\e[b" [S-down]) + + ;; Use inheritance to let the main keymap override those defaults. + ;; This way we don't override terminfo-derived settings or settings + ;; made in the .emacs file. (set-keymap-parent rxvt-function-map (keymap-parent function-key-map)) (set-keymap-parent function-key-map rxvt-function-map)) |