Mercurial > emacs
changeset 110909:cc035ccb9275
Declare and define in one step various mode maps.
* lisp/shell.el (shell-mode-map):
* lisp/progmodes/modula2.el (m2-mode-map):
* lisp/progmodes/inf-lisp.el (inferior-lisp-mode-map):
* lisp/play/mpuz.el (mpuz-mode-map):
* lisp/play/landmark.el (lm-mode-map):
* lisp/play/decipher.el (decipher-mode-map):
* lisp/play/5x5.el (5x5-mode-map):
* lisp/net/telnet.el (telnet-mode-map):
* lisp/net/quickurl.el (quickurl-list-mode-map):
* lisp/net/mairix.el (mairix-searches-mode-map):
* lisp/net/eudc-hotlist.el (eudc-hotlist-mode-map):
* lisp/net/dig.el (dig-mode-map):
* lisp/mail/mspools.el (mspools-mode-map):
* lisp/hexl.el (hexl-mode-map):
* lisp/emulation/ws-mode.el (wordstar-C-k-map, wordstar-mode-map)
(wordstar-C-o-map, wordstar-C-q-map):
* lisp/emacs-lisp/edebug.el (edebug-eval-mode-map):
* lisp/emacs-lisp/chart.el (chart-map):
* lisp/edmacro.el (edmacro-mode-map):
* lisp/array.el (array-mode-map): Declare and define in one step.
* lisp/erc/erc-list.el (erc-list-menu-mode-map): Declare and define in one step.
author | Dan Nicolaescu <dann@ics.uci.edu> |
---|---|
date | Sun, 10 Oct 2010 16:12:30 -0700 |
parents | 2a4bfc24abf0 |
children | de51e19494d6 |
files | lisp/ChangeLog lisp/array.el lisp/edmacro.el lisp/emacs-lisp/chart.el lisp/emacs-lisp/edebug.el lisp/emulation/ws-mode.el lisp/erc/erc-list.el lisp/hexl.el lisp/mail/mspools.el lisp/net/dig.el lisp/net/eudc-hotlist.el lisp/net/mairix.el lisp/net/quickurl.el lisp/net/telnet.el lisp/play/5x5.el lisp/play/decipher.el lisp/play/landmark.el lisp/play/mpuz.el lisp/progmodes/inf-lisp.el lisp/progmodes/modula2.el lisp/shell.el |
diffstat | 21 files changed, 506 insertions(+), 520 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ChangeLog Sun Oct 10 22:48:40 2010 +0000 +++ b/lisp/ChangeLog Sun Oct 10 16:12:30 2010 -0700 @@ -1,5 +1,27 @@ 2010-10-10 Dan Nicolaescu <dann@ics.uci.edu> + * shell.el (shell-mode-map): + * progmodes/modula2.el (m2-mode-map): + * progmodes/inf-lisp.el (inferior-lisp-mode-map): + * play/mpuz.el (mpuz-mode-map): + * play/landmark.el (lm-mode-map): + * play/decipher.el (decipher-mode-map): + * play/5x5.el (5x5-mode-map): + * net/telnet.el (telnet-mode-map): + * net/quickurl.el (quickurl-list-mode-map): + * net/mairix.el (mairix-searches-mode-map): + * net/eudc-hotlist.el (eudc-hotlist-mode-map): + * net/dig.el (dig-mode-map): + * mail/mspools.el (mspools-mode-map): + * hexl.el (hexl-mode-map): + * emulation/ws-mode.el (wordstar-C-k-map, wordstar-mode-map) + (wordstar-C-o-map, wordstar-C-q-map): + * emacs-lisp/edebug.el (edebug-eval-mode-map): + * emacs-lisp/chart.el (chart-map): + * edmacro.el (edmacro-mode-map): + * erc/erc-list.el (erc-list-menu-mode-map): + * array.el (array-mode-map): Declare and define in one step. + * vc/log-view.el (log-view-mode-map): Bind revert-buffer. 2010-10-10 Daiki Ueno <ueno@unixuser.org>
--- a/lisp/array.el Sun Oct 10 22:48:40 2010 +0000 +++ b/lisp/array.el Sun Oct 10 16:12:30 2010 -0700 @@ -775,32 +775,30 @@ ;;; Array mode. -(defvar array-mode-map nil +(defvar array-mode-map + (let ((map (make-keymap))) + (define-key map "\M-ad" 'array-display-local-variables) + (define-key map "\M-am" 'array-make-template) + (define-key map "\M-ae" 'array-expand-rows) + (define-key map "\M-ar" 'array-reconfigure-rows) + (define-key map "\M-a=" 'array-what-position) + (define-key map "\M-ag" 'array-goto-cell) + (define-key map "\M-af" 'array-fill-rectangle) + (define-key map "\C-n" 'array-next-row) + (define-key map "\C-p" 'array-previous-row) + (define-key map "\C-f" 'array-forward-column) + (define-key map "\C-b" 'array-backward-column) + (define-key map "\M-n" 'array-copy-down) + (define-key map "\M-p" 'array-copy-up) + (define-key map "\M-f" 'array-copy-forward) + (define-key map "\M-b" 'array-copy-backward) + (define-key map "\M-\C-n" 'array-copy-row-down) + (define-key map "\M-\C-p" 'array-copy-row-up) + (define-key map "\M-\C-f" 'array-copy-column-forward) + (define-key map "\M-\C-b" 'array-copy-column-backward) + map) "Keymap used in array mode.") -(if array-mode-map - () - (setq array-mode-map (make-keymap)) - ;; Bind keys. - (define-key array-mode-map "\M-ad" 'array-display-local-variables) - (define-key array-mode-map "\M-am" 'array-make-template) - (define-key array-mode-map "\M-ae" 'array-expand-rows) - (define-key array-mode-map "\M-ar" 'array-reconfigure-rows) - (define-key array-mode-map "\M-a=" 'array-what-position) - (define-key array-mode-map "\M-ag" 'array-goto-cell) - (define-key array-mode-map "\M-af" 'array-fill-rectangle) - (define-key array-mode-map "\C-n" 'array-next-row) - (define-key array-mode-map "\C-p" 'array-previous-row) - (define-key array-mode-map "\C-f" 'array-forward-column) - (define-key array-mode-map "\C-b" 'array-backward-column) - (define-key array-mode-map "\M-n" 'array-copy-down) - (define-key array-mode-map "\M-p" 'array-copy-up) - (define-key array-mode-map "\M-f" 'array-copy-forward) - (define-key array-mode-map "\M-b" 'array-copy-backward) - (define-key array-mode-map "\M-\C-n" 'array-copy-row-down) - (define-key array-mode-map "\M-\C-p" 'array-copy-row-up) - (define-key array-mode-map "\M-\C-f" 'array-copy-column-forward) - (define-key array-mode-map "\M-\C-b" 'array-copy-column-backward)) (put 'array-mode 'mode-class 'special)
--- a/lisp/edmacro.el Sun Oct 10 22:48:40 2010 +0000 +++ b/lisp/edmacro.el Sun Oct 10 16:12:30 2010 -0700 @@ -81,11 +81,11 @@ "*Non-nil if `edit-kbd-macro' should leave 8-bit characters intact. Default nil means to write characters above \\177 in octal notation.") -(defvar edmacro-mode-map nil) -(unless edmacro-mode-map - (setq edmacro-mode-map (make-sparse-keymap)) - (define-key edmacro-mode-map "\C-c\C-c" 'edmacro-finish-edit) - (define-key edmacro-mode-map "\C-c\C-q" 'edmacro-insert-key)) +(defvar edmacro-mode-map + (let ((map (make-sparse-keymap))) + (define-key map "\C-c\C-c" 'edmacro-finish-edit) + (define-key map "\C-c\C-q" 'edmacro-insert-key) + map)) (defvar edmacro-store-hook) (defvar edmacro-finish-hook)
--- a/lisp/emacs-lisp/chart.el Sun Oct 10 22:48:40 2010 +0000 +++ b/lisp/emacs-lisp/chart.el Sun Oct 10 16:12:30 2010 -0700 @@ -62,11 +62,7 @@ (require 'eieio) ;;; Code: -(defvar chart-map nil "Keymap used in chart mode.") -(if chart-map - () - (setq chart-map (make-sparse-keymap)) - ) +(defvar chart-map (make-sparse-keymap) "Keymap used in chart mode.") (defvar chart-local-object nil "Local variable containing the locally displayed chart object.")
--- a/lisp/emacs-lisp/edebug.el Sun Oct 10 22:48:40 2010 +0000 +++ b/lisp/emacs-lisp/edebug.el Sun Oct 10 16:12:30 2010 -0700 @@ -4011,18 +4011,16 @@ -(defvar edebug-eval-mode-map nil - "Keymap for Edebug Eval mode. Superset of Lisp Interaction mode.") - -(unless edebug-eval-mode-map - (setq edebug-eval-mode-map (make-sparse-keymap)) - (set-keymap-parent edebug-eval-mode-map lisp-interaction-mode-map) - - (define-key edebug-eval-mode-map "\C-c\C-w" 'edebug-where) - (define-key edebug-eval-mode-map "\C-c\C-d" 'edebug-delete-eval-item) - (define-key edebug-eval-mode-map "\C-c\C-u" 'edebug-update-eval-list) - (define-key edebug-eval-mode-map "\C-x\C-e" 'edebug-eval-last-sexp) - (define-key edebug-eval-mode-map "\C-j" 'edebug-eval-print-last-sexp)) +(defvar edebug-eval-mode-map + (let ((map (make-sparse-keymap))) + (set-keymap-parent map lisp-interaction-mode-map) + (define-key map "\C-c\C-w" 'edebug-where) + (define-key map "\C-c\C-d" 'edebug-delete-eval-item) + (define-key map "\C-c\C-u" 'edebug-update-eval-list) + (define-key map "\C-x\C-e" 'edebug-eval-last-sexp) + (define-key map "\C-j" 'edebug-eval-print-last-sexp) + map) +"Keymap for Edebug Eval mode. Superset of Lisp Interaction mode.") (put 'edebug-eval-mode 'mode-class 'special)
--- a/lisp/emulation/ws-mode.el Sun Oct 10 22:48:40 2010 +0000 +++ b/lisp/emulation/ws-mode.el Sun Oct 10 16:12:30 2010 -0700 @@ -27,158 +27,156 @@ ;; This emulates WordStar, with a major mode. ;;; Code: - -(defvar wordstar-mode-map nil "") -(defvar wordstar-C-j-map nil "") -(defvar wordstar-C-k-map nil "") -(defvar wordstar-C-o-map nil "") -(defvar wordstar-C-q-map nil "") - -(if wordstar-mode-map - () - (setq wordstar-mode-map (make-keymap)) - ;; (setq wordstar-C-j-map (make-keymap)) ; later, perhaps - (setq wordstar-C-k-map (make-keymap)) - (setq wordstar-C-o-map (make-keymap)) - (setq wordstar-C-q-map (make-keymap)) +(defvar wordstar-C-k-map + (let ((map (make-keymap))) + (define-key map " " ()) + (define-key map "0" 'ws-set-marker-0) + (define-key map "1" 'ws-set-marker-1) + (define-key map "2" 'ws-set-marker-2) + (define-key map "3" 'ws-set-marker-3) + (define-key map "4" 'ws-set-marker-4) + (define-key map "5" 'ws-set-marker-5) + (define-key map "6" 'ws-set-marker-6) + (define-key map "7" 'ws-set-marker-7) + (define-key map "8" 'ws-set-marker-8) + (define-key map "9" 'ws-set-marker-9) + (define-key map "b" 'ws-begin-block) + (define-key map "\C-b" 'ws-begin-block) + (define-key map "c" 'ws-copy-block) + (define-key map "\C-c" 'ws-copy-block) + (define-key map "d" 'save-buffers-kill-emacs) + (define-key map "\C-d" 'save-buffers-kill-emacs) + (define-key map "f" 'find-file) + (define-key map "\C-f" 'find-file) + (define-key map "h" 'ws-show-markers) + (define-key map "\C-h" 'ws-show-markers) + (define-key map "i" 'ws-indent-block) + (define-key map "\C-i" 'ws-indent-block) + (define-key map "k" 'ws-end-block) + (define-key map "\C-k" 'ws-end-block) + (define-key map "p" 'ws-print-block) + (define-key map "\C-p" 'ws-print-block) + (define-key map "q" 'kill-emacs) + (define-key map "\C-q" 'kill-emacs) + (define-key map "r" 'insert-file) + (define-key map "\C-r" 'insert-file) + (define-key map "s" 'save-some-buffers) + (define-key map "\C-s" 'save-some-buffers) + (define-key map "t" 'ws-mark-word) + (define-key map "\C-t" 'ws-mark-word) + (define-key map "u" 'ws-exdent-block) + (define-key map "\C-u" 'keyboard-quit) + (define-key map "v" 'ws-move-block) + (define-key map "\C-v" 'ws-move-block) + (define-key map "w" 'ws-write-block) + (define-key map "\C-w" 'ws-write-block) + (define-key map "x" 'save-buffers-kill-emacs) + (define-key map "\C-x" 'save-buffers-kill-emacs) + (define-key map "y" 'ws-delete-block) + (define-key map "\C-y" 'ws-delete-block) + map) + "") - (define-key wordstar-mode-map "\C-a" 'backward-word) - (define-key wordstar-mode-map "\C-b" 'fill-paragraph) - (define-key wordstar-mode-map "\C-c" 'scroll-up) - (define-key wordstar-mode-map "\C-d" 'forward-char) - (define-key wordstar-mode-map "\C-e" 'previous-line) - (define-key wordstar-mode-map "\C-f" 'forward-word) - (define-key wordstar-mode-map "\C-g" 'delete-char) - (define-key wordstar-mode-map "\C-h" 'backward-char) - (define-key wordstar-mode-map "\C-i" 'indent-for-tab-command) - (define-key wordstar-mode-map "\C-j" 'help-for-help) - (define-key wordstar-mode-map "\C-k" wordstar-C-k-map) - (define-key wordstar-mode-map "\C-l" 'ws-repeat-search) - (define-key wordstar-mode-map "\C-n" 'open-line) - (define-key wordstar-mode-map "\C-o" wordstar-C-o-map) - (define-key wordstar-mode-map "\C-p" 'quoted-insert) - (define-key wordstar-mode-map "\C-q" wordstar-C-q-map) - (define-key wordstar-mode-map "\C-r" 'scroll-down) - (define-key wordstar-mode-map "\C-s" 'backward-char) - (define-key wordstar-mode-map "\C-t" 'kill-word) - (define-key wordstar-mode-map "\C-u" 'keyboard-quit) - (define-key wordstar-mode-map "\C-v" 'overwrite-mode) - (define-key wordstar-mode-map "\C-w" 'scroll-down-line) - (define-key wordstar-mode-map "\C-x" 'next-line) - (define-key wordstar-mode-map "\C-y" 'kill-complete-line) - (define-key wordstar-mode-map "\C-z" 'scroll-up-line) - - ;; wordstar-C-k-map +(defvar wordstar-C-o-map + (let ((map (make-keymap))) + (define-key map " " ()) + (define-key map "c" 'wordstar-center-line) + (define-key map "\C-c" 'wordstar-center-line) + (define-key map "b" 'switch-to-buffer) + (define-key map "\C-b" 'switch-to-buffer) + (define-key map "j" 'justify-current-line) + (define-key map "\C-j" 'justify-current-line) + (define-key map "k" 'kill-buffer) + (define-key map "\C-k" 'kill-buffer) + (define-key map "l" 'list-buffers) + (define-key map "\C-l" 'list-buffers) + (define-key map "m" 'auto-fill-mode) + (define-key map "\C-m" 'auto-fill-mode) + (define-key map "r" 'set-fill-column) + (define-key map "\C-r" 'set-fill-column) + (define-key map "\C-u" 'keyboard-quit) + (define-key map "wd" 'delete-other-windows) + (define-key map "wh" 'split-window-horizontally) + (define-key map "wo" 'other-window) + (define-key map "wv" 'split-window-vertically) + map) + "") - (define-key wordstar-C-k-map " " ()) - (define-key wordstar-C-k-map "0" 'ws-set-marker-0) - (define-key wordstar-C-k-map "1" 'ws-set-marker-1) - (define-key wordstar-C-k-map "2" 'ws-set-marker-2) - (define-key wordstar-C-k-map "3" 'ws-set-marker-3) - (define-key wordstar-C-k-map "4" 'ws-set-marker-4) - (define-key wordstar-C-k-map "5" 'ws-set-marker-5) - (define-key wordstar-C-k-map "6" 'ws-set-marker-6) - (define-key wordstar-C-k-map "7" 'ws-set-marker-7) - (define-key wordstar-C-k-map "8" 'ws-set-marker-8) - (define-key wordstar-C-k-map "9" 'ws-set-marker-9) - (define-key wordstar-C-k-map "b" 'ws-begin-block) - (define-key wordstar-C-k-map "\C-b" 'ws-begin-block) - (define-key wordstar-C-k-map "c" 'ws-copy-block) - (define-key wordstar-C-k-map "\C-c" 'ws-copy-block) - (define-key wordstar-C-k-map "d" 'save-buffers-kill-emacs) - (define-key wordstar-C-k-map "\C-d" 'save-buffers-kill-emacs) - (define-key wordstar-C-k-map "f" 'find-file) - (define-key wordstar-C-k-map "\C-f" 'find-file) - (define-key wordstar-C-k-map "h" 'ws-show-markers) - (define-key wordstar-C-k-map "\C-h" 'ws-show-markers) - (define-key wordstar-C-k-map "i" 'ws-indent-block) - (define-key wordstar-C-k-map "\C-i" 'ws-indent-block) - (define-key wordstar-C-k-map "k" 'ws-end-block) - (define-key wordstar-C-k-map "\C-k" 'ws-end-block) - (define-key wordstar-C-k-map "p" 'ws-print-block) - (define-key wordstar-C-k-map "\C-p" 'ws-print-block) - (define-key wordstar-C-k-map "q" 'kill-emacs) - (define-key wordstar-C-k-map "\C-q" 'kill-emacs) - (define-key wordstar-C-k-map "r" 'insert-file) - (define-key wordstar-C-k-map "\C-r" 'insert-file) - (define-key wordstar-C-k-map "s" 'save-some-buffers) - (define-key wordstar-C-k-map "\C-s" 'save-some-buffers) - (define-key wordstar-C-k-map "t" 'ws-mark-word) - (define-key wordstar-C-k-map "\C-t" 'ws-mark-word) - (define-key wordstar-C-k-map "u" 'ws-exdent-block) - (define-key wordstar-C-k-map "\C-u" 'keyboard-quit) - (define-key wordstar-C-k-map "v" 'ws-move-block) - (define-key wordstar-C-k-map "\C-v" 'ws-move-block) - (define-key wordstar-C-k-map "w" 'ws-write-block) - (define-key wordstar-C-k-map "\C-w" 'ws-write-block) - (define-key wordstar-C-k-map "x" 'save-buffers-kill-emacs) - (define-key wordstar-C-k-map "\C-x" 'save-buffers-kill-emacs) - (define-key wordstar-C-k-map "y" 'ws-delete-block) - (define-key wordstar-C-k-map "\C-y" 'ws-delete-block) - - ;; wordstar-C-j-map not yet implemented - - ;; wordstar-C-o-map +(defvar wordstar-C-q-map + (let ((map (make-keymap))) + (define-key map " " ()) + (define-key map "0" 'ws-find-marker-0) + (define-key map "1" 'ws-find-marker-1) + (define-key map "2" 'ws-find-marker-2) + (define-key map "3" 'ws-find-marker-3) + (define-key map "4" 'ws-find-marker-4) + (define-key map "5" 'ws-find-marker-5) + (define-key map "6" 'ws-find-marker-6) + (define-key map "7" 'ws-find-marker-7) + (define-key map "8" 'ws-find-marker-8) + (define-key map "9" 'ws-find-marker-9) + (define-key map "a" 'ws-query-replace) + (define-key map "\C-a" 'ws-query-replace) + (define-key map "b" 'ws-goto-block-begin) + (define-key map "\C-b" 'ws-goto-block-begin) + (define-key map "c" 'end-of-buffer) + (define-key map "\C-c" 'end-of-buffer) + (define-key map "d" 'end-of-line) + (define-key map "\C-d" 'end-of-line) + (define-key map "f" 'ws-search) + (define-key map "\C-f" 'ws-search) + (define-key map "k" 'ws-goto-block-end) + (define-key map "\C-k" 'ws-goto-block-end) + (define-key map "l" 'ws-undo) + (define-key map "\C-l" 'ws-undo) + (define-key map "p" 'ws-last-cursorp) + (define-key map "\C-p" 'ws-last-cursorp) + (define-key map "r" 'beginning-of-buffer) + (define-key map "\C-r" 'beginning-of-buffer) + (define-key map "s" 'beginning-of-line) + (define-key map "\C-s" 'beginning-of-line) + (define-key map "\C-u" 'keyboard-quit) + (define-key map "w" 'ws-last-error) + (define-key map "\C-w" 'ws-last-error) + (define-key map "y" 'ws-kill-eol) + (define-key map "\C-y" 'ws-kill-eol) + (define-key map "\177" 'ws-kill-bol) + map) + "") - (define-key wordstar-C-o-map " " ()) - (define-key wordstar-C-o-map "c" 'wordstar-center-line) - (define-key wordstar-C-o-map "\C-c" 'wordstar-center-line) - (define-key wordstar-C-o-map "b" 'switch-to-buffer) - (define-key wordstar-C-o-map "\C-b" 'switch-to-buffer) - (define-key wordstar-C-o-map "j" 'justify-current-line) - (define-key wordstar-C-o-map "\C-j" 'justify-current-line) - (define-key wordstar-C-o-map "k" 'kill-buffer) - (define-key wordstar-C-o-map "\C-k" 'kill-buffer) - (define-key wordstar-C-o-map "l" 'list-buffers) - (define-key wordstar-C-o-map "\C-l" 'list-buffers) - (define-key wordstar-C-o-map "m" 'auto-fill-mode) - (define-key wordstar-C-o-map "\C-m" 'auto-fill-mode) - (define-key wordstar-C-o-map "r" 'set-fill-column) - (define-key wordstar-C-o-map "\C-r" 'set-fill-column) - (define-key wordstar-C-o-map "\C-u" 'keyboard-quit) - (define-key wordstar-C-o-map "wd" 'delete-other-windows) - (define-key wordstar-C-o-map "wh" 'split-window-horizontally) - (define-key wordstar-C-o-map "wo" 'other-window) - (define-key wordstar-C-o-map "wv" 'split-window-vertically) +(defvar wordstar-mode-map + (let ((map (make-keymap))) + (define-key map "\C-a" 'backward-word) + (define-key map "\C-b" 'fill-paragraph) + (define-key map "\C-c" 'scroll-up) + (define-key map "\C-d" 'forward-char) + (define-key map "\C-e" 'previous-line) + (define-key map "\C-f" 'forward-word) + (define-key map "\C-g" 'delete-char) + (define-key map "\C-h" 'backward-char) + (define-key map "\C-i" 'indent-for-tab-command) + (define-key map "\C-j" 'help-for-help) + (define-key map "\C-k" wordstar-C-k-map) + (define-key map "\C-l" 'ws-repeat-search) + (define-key map "\C-n" 'open-line) + (define-key map "\C-o" wordstar-C-o-map) + (define-key map "\C-p" 'quoted-insert) + (define-key map "\C-q" wordstar-C-q-map) + (define-key map "\C-r" 'scroll-down) + (define-key map "\C-s" 'backward-char) + (define-key map "\C-t" 'kill-word) + (define-key map "\C-u" 'keyboard-quit) + (define-key map "\C-v" 'overwrite-mode) + (define-key map "\C-w" 'scroll-down-line) + (define-key map "\C-x" 'next-line) + (define-key map "\C-y" 'kill-complete-line) + (define-key map "\C-z" 'scroll-up-line) + map) + "") - ;; wordstar-C-q-map - (define-key wordstar-C-q-map " " ()) - (define-key wordstar-C-q-map "0" 'ws-find-marker-0) - (define-key wordstar-C-q-map "1" 'ws-find-marker-1) - (define-key wordstar-C-q-map "2" 'ws-find-marker-2) - (define-key wordstar-C-q-map "3" 'ws-find-marker-3) - (define-key wordstar-C-q-map "4" 'ws-find-marker-4) - (define-key wordstar-C-q-map "5" 'ws-find-marker-5) - (define-key wordstar-C-q-map "6" 'ws-find-marker-6) - (define-key wordstar-C-q-map "7" 'ws-find-marker-7) - (define-key wordstar-C-q-map "8" 'ws-find-marker-8) - (define-key wordstar-C-q-map "9" 'ws-find-marker-9) - (define-key wordstar-C-q-map "a" 'ws-query-replace) - (define-key wordstar-C-q-map "\C-a" 'ws-query-replace) - (define-key wordstar-C-q-map "b" 'ws-goto-block-begin) - (define-key wordstar-C-q-map "\C-b" 'ws-goto-block-begin) - (define-key wordstar-C-q-map "c" 'end-of-buffer) - (define-key wordstar-C-q-map "\C-c" 'end-of-buffer) - (define-key wordstar-C-q-map "d" 'end-of-line) - (define-key wordstar-C-q-map "\C-d" 'end-of-line) - (define-key wordstar-C-q-map "f" 'ws-search) - (define-key wordstar-C-q-map "\C-f" 'ws-search) - (define-key wordstar-C-q-map "k" 'ws-goto-block-end) - (define-key wordstar-C-q-map "\C-k" 'ws-goto-block-end) - (define-key wordstar-C-q-map "l" 'ws-undo) - (define-key wordstar-C-q-map "\C-l" 'ws-undo) - (define-key wordstar-C-q-map "p" 'ws-last-cursorp) - (define-key wordstar-C-q-map "\C-p" 'ws-last-cursorp) - (define-key wordstar-C-q-map "r" 'beginning-of-buffer) - (define-key wordstar-C-q-map "\C-r" 'beginning-of-buffer) - (define-key wordstar-C-q-map "s" 'beginning-of-line) - (define-key wordstar-C-q-map "\C-s" 'beginning-of-line) - (define-key wordstar-C-q-map "\C-u" 'keyboard-quit) - (define-key wordstar-C-q-map "w" 'ws-last-error) - (define-key wordstar-C-q-map "\C-w" 'ws-last-error) - (define-key wordstar-C-q-map "y" 'ws-kill-eol) - (define-key wordstar-C-q-map "\C-y" 'ws-kill-eol) - (define-key wordstar-C-q-map "\177" 'ws-kill-bol)) +;; wordstar-C-j-map not yet implemented +(defvar wordstar-C-j-map nil "") + (put 'wordstar-mode 'mode-class 'special)
--- a/lisp/erc/erc-list.el Sun Oct 10 22:48:40 2010 +0000 +++ b/lisp/erc/erc-list.el Sun Oct 10 16:12:30 2010 -0700 @@ -117,19 +117,18 @@ (sort-fields col (point-min) (point-max)) (sort-numeric-fields col (point-min) (point-max)))))) -(defvar erc-list-menu-mode-map nil +(defvar erc-list-menu-mode-map + (let ((map (make-keymap))) + (suppress-keymap map) + (define-key map "k" 'erc-list-kill) + (define-key map "j" 'erc-list-join) + (define-key map "g" 'erc-list-revert) + (define-key map "n" 'next-line) + (define-key map "p" 'previous-line) + (define-key map "q" 'quit-window) + map) "Local keymap for `erc-list-mode' buffers.") -(unless erc-list-menu-mode-map - (setq erc-list-menu-mode-map (make-keymap)) - (suppress-keymap erc-list-menu-mode-map) - (define-key erc-list-menu-mode-map "k" 'erc-list-kill) - (define-key erc-list-menu-mode-map "j" 'erc-list-join) - (define-key erc-list-menu-mode-map "g" 'erc-list-revert) - (define-key erc-list-menu-mode-map "n" 'next-line) - (define-key erc-list-menu-mode-map "p" 'previous-line) - (define-key erc-list-menu-mode-map "q" 'quit-window)) - (defvar erc-list-menu-sort-button-map nil "Local keymap for ERC list menu mode sorting buttons.")
--- a/lisp/hexl.el Sun Oct 10 22:48:40 2010 +0000 +++ b/lisp/hexl.el Sun Oct 10 16:12:30 2010 -0700 @@ -97,7 +97,99 @@ (defvar hexl-max-address 0 "Maximum offset into hexl buffer.") -(defvar hexl-mode-map nil) +(defvar hexl-mode-map + (let ((map (make-keymap))) + ;; Make all self-inserting keys go through hexl-self-insert-command, + ;; because we need to convert them to unibyte characters before + ;; inserting them into the buffer. + (define-key map [remap self-insert-command] 'hexl-self-insert-command) + + (define-key map "\C-m" 'hexl-self-insert-command) + (define-key map [left] 'hexl-backward-char) + (define-key map [right] 'hexl-forward-char) + (define-key map [up] 'hexl-previous-line) + (define-key map [down] 'hexl-next-line) + (define-key map [M-left] 'hexl-backward-short) + (define-key map [?\e left] 'hexl-backward-short) + (define-key map [M-right] 'hexl-forward-short) + (define-key map [?\e right] 'hexl-forward-short) + (define-key map [next] 'hexl-scroll-up) + (define-key map [prior] 'hexl-scroll-down) + (define-key map [home] 'hexl-beginning-of-line) + (define-key map [end] 'hexl-end-of-line) + (define-key map [C-home] 'hexl-beginning-of-buffer) + (define-key map [C-end] 'hexl-end-of-buffer) + (define-key map [deletechar] 'undefined) + (define-key map [deleteline] 'undefined) + (define-key map [insertline] 'undefined) + (define-key map [S-delete] 'undefined) + (define-key map "\177" 'undefined) + + (define-key map "\C-a" 'hexl-beginning-of-line) + (define-key map "\C-b" 'hexl-backward-char) + (define-key map "\C-d" 'undefined) + (define-key map "\C-e" 'hexl-end-of-line) + (define-key map "\C-f" 'hexl-forward-char) + + (if (not (memq (key-binding (char-to-string help-char)) + '(help-command ehelp-command))) + (define-key map (char-to-string help-char) 'undefined)) + + (define-key map "\C-k" 'undefined) + (define-key map "\C-n" 'hexl-next-line) + (define-key map "\C-o" 'undefined) + (define-key map "\C-p" 'hexl-previous-line) + (define-key map "\C-q" 'hexl-quoted-insert) + (define-key map "\C-t" 'undefined) + (define-key map "\C-v" 'hexl-scroll-up) + (define-key map "\C-w" 'undefined) + (define-key map "\C-y" 'undefined) + + (fset 'hexl-ESC-prefix (copy-keymap 'ESC-prefix)) + (define-key map "\e" 'hexl-ESC-prefix) + (define-key map "\e\C-a" 'hexl-beginning-of-512b-page) + (define-key map "\e\C-b" 'hexl-backward-short) + (define-key map "\e\C-d" 'hexl-insert-decimal-char) + (define-key map "\e\C-e" 'hexl-end-of-512b-page) + (define-key map "\e\C-f" 'hexl-forward-short) + (define-key map "\e\C-i" 'undefined) + (define-key map "\e\C-j" 'undefined) + (define-key map "\e\C-k" 'undefined) + (define-key map "\e\C-o" 'hexl-insert-octal-char) + (define-key map "\e\C-q" 'undefined) + (define-key map "\e\C-t" 'undefined) + (define-key map "\e\C-x" 'hexl-insert-hex-char) + (define-key map "\eb" 'hexl-backward-word) + (define-key map "\ec" 'undefined) + (define-key map "\ed" 'undefined) + (define-key map "\ef" 'hexl-forward-word) + (define-key map "\eg" 'hexl-goto-hex-address) + (define-key map "\ei" 'undefined) + (define-key map "\ej" 'hexl-goto-address) + (define-key map "\ek" 'undefined) + (define-key map "\el" 'undefined) + (define-key map "\eq" 'undefined) + (define-key map "\es" 'undefined) + (define-key map "\et" 'undefined) + (define-key map "\eu" 'undefined) + (define-key map "\ev" 'hexl-scroll-down) + (define-key map "\ey" 'undefined) + (define-key map "\ez" 'undefined) + (define-key map "\e<" 'hexl-beginning-of-buffer) + (define-key map "\e>" 'hexl-end-of-buffer) + + (fset 'hexl-C-c-prefix (copy-keymap mode-specific-map)) + (define-key map "\C-c" 'hexl-C-c-prefix) + (define-key map "\C-c\C-c" 'hexl-mode-exit) + + (fset 'hexl-C-x-prefix (copy-keymap 'Control-X-prefix)) + (define-key map "\C-x" 'hexl-C-x-prefix) + (define-key map "\C-x[" 'hexl-beginning-of-1k-page) + (define-key map "\C-x]" 'hexl-end-of-1k-page) + (define-key map "\C-x\C-p" 'undefined) + (define-key map "\C-x\C-s" 'hexl-save-buffer) + (define-key map "\C-x\C-t" 'undefined) + map)) ;; Variable declarations for suppressing warnings from the byte-compiler. (defvar ruler-mode) @@ -1017,100 +1109,6 @@ ;; startup stuff. -(if hexl-mode-map - nil - (setq hexl-mode-map (make-keymap)) - ;; Make all self-inserting keys go through hexl-self-insert-command, - ;; because we need to convert them to unibyte characters before - ;; inserting them into the buffer. - (define-key hexl-mode-map [remap self-insert-command] 'hexl-self-insert-command) - - (define-key hexl-mode-map "\C-m" 'hexl-self-insert-command) - (define-key hexl-mode-map [left] 'hexl-backward-char) - (define-key hexl-mode-map [right] 'hexl-forward-char) - (define-key hexl-mode-map [up] 'hexl-previous-line) - (define-key hexl-mode-map [down] 'hexl-next-line) - (define-key hexl-mode-map [M-left] 'hexl-backward-short) - (define-key hexl-mode-map [?\e left] 'hexl-backward-short) - (define-key hexl-mode-map [M-right] 'hexl-forward-short) - (define-key hexl-mode-map [?\e right] 'hexl-forward-short) - (define-key hexl-mode-map [next] 'hexl-scroll-up) - (define-key hexl-mode-map [prior] 'hexl-scroll-down) - (define-key hexl-mode-map [home] 'hexl-beginning-of-line) - (define-key hexl-mode-map [end] 'hexl-end-of-line) - (define-key hexl-mode-map [C-home] 'hexl-beginning-of-buffer) - (define-key hexl-mode-map [C-end] 'hexl-end-of-buffer) - (define-key hexl-mode-map [deletechar] 'undefined) - (define-key hexl-mode-map [deleteline] 'undefined) - (define-key hexl-mode-map [insertline] 'undefined) - (define-key hexl-mode-map [S-delete] 'undefined) - (define-key hexl-mode-map "\177" 'undefined) - - (define-key hexl-mode-map "\C-a" 'hexl-beginning-of-line) - (define-key hexl-mode-map "\C-b" 'hexl-backward-char) - (define-key hexl-mode-map "\C-d" 'undefined) - (define-key hexl-mode-map "\C-e" 'hexl-end-of-line) - (define-key hexl-mode-map "\C-f" 'hexl-forward-char) - - (if (not (memq (key-binding (char-to-string help-char)) - '(help-command ehelp-command))) - (define-key hexl-mode-map (char-to-string help-char) 'undefined)) - - (define-key hexl-mode-map "\C-k" 'undefined) - (define-key hexl-mode-map "\C-n" 'hexl-next-line) - (define-key hexl-mode-map "\C-o" 'undefined) - (define-key hexl-mode-map "\C-p" 'hexl-previous-line) - (define-key hexl-mode-map "\C-q" 'hexl-quoted-insert) - (define-key hexl-mode-map "\C-t" 'undefined) - (define-key hexl-mode-map "\C-v" 'hexl-scroll-up) - (define-key hexl-mode-map "\C-w" 'undefined) - (define-key hexl-mode-map "\C-y" 'undefined) - - (fset 'hexl-ESC-prefix (copy-keymap 'ESC-prefix)) - (define-key hexl-mode-map "\e" 'hexl-ESC-prefix) - (define-key hexl-mode-map "\e\C-a" 'hexl-beginning-of-512b-page) - (define-key hexl-mode-map "\e\C-b" 'hexl-backward-short) - (define-key hexl-mode-map "\e\C-d" 'hexl-insert-decimal-char) - (define-key hexl-mode-map "\e\C-e" 'hexl-end-of-512b-page) - (define-key hexl-mode-map "\e\C-f" 'hexl-forward-short) - (define-key hexl-mode-map "\e\C-i" 'undefined) - (define-key hexl-mode-map "\e\C-j" 'undefined) - (define-key hexl-mode-map "\e\C-k" 'undefined) - (define-key hexl-mode-map "\e\C-o" 'hexl-insert-octal-char) - (define-key hexl-mode-map "\e\C-q" 'undefined) - (define-key hexl-mode-map "\e\C-t" 'undefined) - (define-key hexl-mode-map "\e\C-x" 'hexl-insert-hex-char) - (define-key hexl-mode-map "\eb" 'hexl-backward-word) - (define-key hexl-mode-map "\ec" 'undefined) - (define-key hexl-mode-map "\ed" 'undefined) - (define-key hexl-mode-map "\ef" 'hexl-forward-word) - (define-key hexl-mode-map "\eg" 'hexl-goto-hex-address) - (define-key hexl-mode-map "\ei" 'undefined) - (define-key hexl-mode-map "\ej" 'hexl-goto-address) - (define-key hexl-mode-map "\ek" 'undefined) - (define-key hexl-mode-map "\el" 'undefined) - (define-key hexl-mode-map "\eq" 'undefined) - (define-key hexl-mode-map "\es" 'undefined) - (define-key hexl-mode-map "\et" 'undefined) - (define-key hexl-mode-map "\eu" 'undefined) - (define-key hexl-mode-map "\ev" 'hexl-scroll-down) - (define-key hexl-mode-map "\ey" 'undefined) - (define-key hexl-mode-map "\ez" 'undefined) - (define-key hexl-mode-map "\e<" 'hexl-beginning-of-buffer) - (define-key hexl-mode-map "\e>" 'hexl-end-of-buffer) - - (fset 'hexl-C-c-prefix (copy-keymap mode-specific-map)) - (define-key hexl-mode-map "\C-c" 'hexl-C-c-prefix) - (define-key hexl-mode-map "\C-c\C-c" 'hexl-mode-exit) - - (fset 'hexl-C-x-prefix (copy-keymap 'Control-X-prefix)) - (define-key hexl-mode-map "\C-x" 'hexl-C-x-prefix) - (define-key hexl-mode-map "\C-x[" 'hexl-beginning-of-1k-page) - (define-key hexl-mode-map "\C-x]" 'hexl-end-of-1k-page) - (define-key hexl-mode-map "\C-x\C-p" 'undefined) - (define-key hexl-mode-map "\C-x\C-s" 'hexl-save-buffer) - (define-key hexl-mode-map "\C-x\C-t" 'undefined)) - (easy-menu-define hexl-menu hexl-mode-map "Hexl Mode menu" `("Hexl" :help "Hexl-specific Features"
--- a/lisp/mail/mspools.el Sun Oct 10 22:48:40 2010 +0000 +++ b/lisp/mail/mspools.el Sun Oct 10 16:12:30 2010 -0700 @@ -172,7 +172,16 @@ (defvar mspools-buffer "*spools*" "Name of buffer for displaying spool info.") -(defvar mspools-mode-map nil +(defvar mspools-mode-map + (let ((map (make-sparse-keymap))) + (define-key map "\C-c\C-c" 'mspools-visit-spool) + (define-key map "\C-m" 'mspools-visit-spool) + (define-key map " " 'mspools-visit-spool) + (define-key map "?" 'mspools-help) + (define-key map "q" 'mspools-quit) + (define-key map "n" 'next-line) + (define-key map "p" 'previous-line) + (define-key map "g" 'revert-buffer)) "Keymap for the *spools* buffer.") ;;; Code @@ -320,21 +329,6 @@ )))) (car (nth line-num mspools-files)))) -;;; Keymap - -(if mspools-mode-map - () - (setq mspools-mode-map (make-sparse-keymap)) - - (define-key mspools-mode-map "\C-c\C-c" 'mspools-visit-spool) - (define-key mspools-mode-map "\C-m" 'mspools-visit-spool) - (define-key mspools-mode-map " " 'mspools-visit-spool) - (define-key mspools-mode-map "?" 'mspools-help) - (define-key mspools-mode-map "q" 'mspools-quit) - (define-key mspools-mode-map "n" 'next-line) - (define-key mspools-mode-map "p" 'previous-line) - (define-key mspools-mode-map "g" 'revert-buffer)) - ;;; Spools mode functions (defun mspools-revert-buffer (ignore noconfirm)
--- a/lisp/net/dig.el Sun Oct 10 22:48:40 2010 +0000 +++ b/lisp/net/dig.el Sun Oct 10 16:12:30 2010 -0700 @@ -129,12 +129,11 @@ (put 'dig-mode 'mode-class 'special) -(defvar dig-mode-map nil) -(unless dig-mode-map - (setq dig-mode-map (make-sparse-keymap)) - (suppress-keymap dig-mode-map) - - (define-key dig-mode-map "q" 'dig-exit)) +(defvar dig-mode-map + (let ((map (make-sparse-keymap))) + (suppress-keymap map) + (define-key map "q" 'dig-exit) + map)) (define-derived-mode dig-mode nil "Dig" "Major mode for displaying dig output."
--- a/lisp/net/eudc-hotlist.el Sun Oct 10 22:48:40 2010 +0000 +++ b/lisp/net/eudc-hotlist.el Sun Oct 10 16:12:30 2010 -0700 @@ -33,9 +33,18 @@ (require 'eudc) (defvar eudc-hotlist-menu nil) -(defvar eudc-hotlist-mode-map nil) (defvar eudc-hotlist-list-beginning nil) +(defvar eudc-hotlist-mode-map + (let ((map (make-sparse-keymap))) + (define-key map "a" 'eudc-hotlist-add-server) + (define-key map "d" 'eudc-hotlist-delete-server) + (define-key map "s" 'eudc-hotlist-select-server) + (define-key map "t" 'eudc-hotlist-transpose-servers) + (define-key map "q" 'eudc-hotlist-quit-edit) + (define-key map "x" 'kill-this-buffer) + map)) + (defun eudc-hotlist-mode () "Major mode used to edit the hotlist of servers. @@ -169,16 +178,6 @@ (forward-line 1) (transpose-lines 1)))))) -(setq eudc-hotlist-mode-map - (let ((map (make-sparse-keymap))) - (define-key map "a" 'eudc-hotlist-add-server) - (define-key map "d" 'eudc-hotlist-delete-server) - (define-key map "s" 'eudc-hotlist-select-server) - (define-key map "t" 'eudc-hotlist-transpose-servers) - (define-key map "q" 'eudc-hotlist-quit-edit) - (define-key map "x" 'kill-this-buffer) - map)) - (defconst eudc-hotlist-menu '("EUDC Hotlist Edit" ["---" nil nil]
--- a/lisp/net/mairix.el Sun Oct 10 22:48:40 2010 +0000 +++ b/lisp/net/mairix.el Sun Oct 10 16:12:30 2010 -0700 @@ -735,23 +735,21 @@ ;;;; Major mode for editing/deleting/saving searches -(defvar mairix-searches-mode-map nil "'mairix-searches-mode' keymap.") - -;; Keymap -(if (not mairix-searches-mode-map) - (let ((map (make-keymap))) - (define-key map [(return)] 'mairix-select-search) - (define-key map [(down)] 'mairix-next-search) - (define-key map [(up)] 'mairix-previous-search) - (define-key map [(right)] 'mairix-next-search) - (define-key map [(left)] 'mairix-previous-search) - (define-key map "\C-p" 'mairix-previous-search) - (define-key map "\C-n" 'mairix-next-search) - (define-key map [(q)] 'mairix-select-quit) - (define-key map [(e)] 'mairix-select-edit) - (define-key map [(d)] 'mairix-select-delete) - (define-key map [(s)] 'mairix-select-save) - (setq mairix-searches-mode-map map))) +(defvar mairix-searches-mode-map + (let ((map (make-keymap))) + (define-key map [(return)] 'mairix-select-search) + (define-key map [(down)] 'mairix-next-search) + (define-key map [(up)] 'mairix-previous-search) + (define-key map [(right)] 'mairix-next-search) + (define-key map [(left)] 'mairix-previous-search) + (define-key map "\C-p" 'mairix-previous-search) + (define-key map "\C-n" 'mairix-next-search) + (define-key map [(q)] 'mairix-select-quit) + (define-key map [(e)] 'mairix-select-edit) + (define-key map [(d)] 'mairix-select-delete) + (define-key map [(s)] 'mairix-select-save) + (setq mairix-searches-mode-map map)) + "'mairix-searches-mode' keymap.") (defvar mairix-searches-mode-font-lock-keywords)
--- a/lisp/net/quickurl.el Sun Oct 10 22:48:40 2010 +0000 +++ b/lisp/net/quickurl.el Sun Oct 10 16:12:30 2010 -0700 @@ -173,7 +173,20 @@ (defvar quickurl-urls nil "URL alist for use with `quickurl' and `quickurl-ask'.") -(defvar quickurl-list-mode-map nil +(defvar quickurl-list-mode-map + (let ((map (make-sparse-keymap))) + (suppress-keymap map t) + (define-key map "a" #'quickurl-list-add-url) + (define-key map [(control m)] #'quickurl-list-insert-url) + (define-key map "u" #'quickurl-list-insert-naked-url) + (define-key map " " #'quickurl-list-insert-with-lookup) + (define-key map "l" #'quickurl-list-insert-lookup) + (define-key map "d" #'quickurl-list-insert-with-desc) + (define-key map [(control g)] #'quickurl-list-quit) + (define-key map "q" #'quickurl-list-quit) + (define-key map [mouse-2] #'quickurl-list-mouse-select) + (define-key map "?" #'describe-mode) + map) "Local keymap for a `quickurl-list-mode' buffer.") (defvar quickurl-list-buffer-name "*quickurl-list*" @@ -420,21 +433,6 @@ ;; quickurl-list mode. -(unless quickurl-list-mode-map - (let ((map (make-sparse-keymap))) - (suppress-keymap map t) - (define-key map "a" #'quickurl-list-add-url) - (define-key map [(control m)] #'quickurl-list-insert-url) - (define-key map "u" #'quickurl-list-insert-naked-url) - (define-key map " " #'quickurl-list-insert-with-lookup) - (define-key map "l" #'quickurl-list-insert-lookup) - (define-key map "d" #'quickurl-list-insert-with-desc) - (define-key map [(control g)] #'quickurl-list-quit) - (define-key map "q" #'quickurl-list-quit) - (define-key map [mouse-2] #'quickurl-list-mouse-select) - (define-key map "?" #'describe-mode) - (setq quickurl-list-mode-map map))) - (put 'quickurl-list-mode 'mode-class 'special) ;;;###autoload
--- a/lisp/net/telnet.el Sun Oct 10 22:48:40 2010 +0000 +++ b/lisp/net/telnet.el Sun Oct 10 16:12:30 2010 -0700 @@ -61,7 +61,15 @@ LOGIN-NAME, which is optional, says what to log in as on that machine.") (defvar telnet-new-line "\r") -(defvar telnet-mode-map nil) +(defvar telnet-mode-map + (let ((map (nconc (make-sparse-keymap) comint-mode-map))) + (define-key telnet-mode-map "\C-m" 'telnet-send-input) + ;; (define-key telnet-mode-map "\C-j" 'telnet-send-input) + (define-key map "\C-c\C-q" 'send-process-next-char) + (define-key map "\C-c\C-c" 'telnet-interrupt-subjob) + (define-key map "\C-c\C-z" 'telnet-c-z) + map)) + (defvar telnet-prompt-pattern "^[^#$%>\n]*[#$%>] *") (defvar telnet-replace-c-g nil) (make-variable-buffer-local @@ -104,16 +112,6 @@ (prog1 (read-char) (setq quit-flag nil)))))) -; initialization on first load. -(if telnet-mode-map - nil - (setq telnet-mode-map (nconc (make-sparse-keymap) comint-mode-map)) - (define-key telnet-mode-map "\C-m" 'telnet-send-input) -; (define-key telnet-mode-map "\C-j" 'telnet-send-input) - (define-key telnet-mode-map "\C-c\C-q" 'send-process-next-char) - (define-key telnet-mode-map "\C-c\C-c" 'telnet-interrupt-subjob) - (define-key telnet-mode-map "\C-c\C-z" 'telnet-c-z)) - ;;maybe should have a flag for when have found type (defun telnet-check-software-type-initialize (string) "Tries to put correct initializations in. Needs work."
--- a/lisp/play/5x5.el Sun Oct 10 22:48:40 2010 +0000 +++ b/lisp/play/5x5.el Sun Oct 10 16:12:30 2010 -0700 @@ -108,12 +108,7 @@ (defvar 5x5-buffer-name "*5x5*" "Name of the 5x5 play buffer.") -(defvar 5x5-mode-map nil - "Local keymap for the 5x5 game.") - -;; Keymap. - -(unless 5x5-mode-map +(defvar 5x5-mode-map (let ((map (make-sparse-keymap))) (suppress-keymap map t) (define-key map "?" #'describe-mode) @@ -141,7 +136,8 @@ (define-key map [(control c) (control x)] #'5x5-crack-xor-mutate) (define-key map "n" #'5x5-new-game) (define-key map "q" #'5x5-quit-game) - (setq 5x5-mode-map map))) + map) + "Local keymap for the 5x5 game.") ;; Menu definition.
--- a/lisp/play/decipher.el Sun Oct 10 22:48:40 2010 +0000 +++ b/lisp/play/decipher.el Sun Oct 10 16:12:30 2010 -0700 @@ -154,38 +154,37 @@ 'bold))) in your `.emacs' file.") -(defvar decipher-mode-map nil +(defvar decipher-mode-map + (let ((map (make-keymap))) + (suppress-keymap map) + (define-key map "A" 'decipher-show-alphabet) + (define-key map "C" 'decipher-complete-alphabet) + (define-key map "D" 'decipher-digram-list) + (define-key map "F" 'decipher-frequency-count) + (define-key map "M" 'decipher-make-checkpoint) + (define-key map "N" 'decipher-adjacency-list) + (define-key map "R" 'decipher-restore-checkpoint) + (define-key map "U" 'decipher-undo) + (define-key map " " 'decipher-keypress) + (define-key map [remap undo] 'decipher-undo) + (define-key map [remap advertised-undo] 'decipher-undo) + (let ((key ?a)) + (while (<= key ?z) + (define-key map (vector key) 'decipher-keypress) + (incf key))) + map) "Keymap for Decipher mode.") -(if (not decipher-mode-map) - (progn - (setq decipher-mode-map (make-keymap)) - (suppress-keymap decipher-mode-map) - (define-key decipher-mode-map "A" 'decipher-show-alphabet) - (define-key decipher-mode-map "C" 'decipher-complete-alphabet) - (define-key decipher-mode-map "D" 'decipher-digram-list) - (define-key decipher-mode-map "F" 'decipher-frequency-count) - (define-key decipher-mode-map "M" 'decipher-make-checkpoint) - (define-key decipher-mode-map "N" 'decipher-adjacency-list) - (define-key decipher-mode-map "R" 'decipher-restore-checkpoint) - (define-key decipher-mode-map "U" 'decipher-undo) - (define-key decipher-mode-map " " 'decipher-keypress) - (define-key decipher-mode-map [remap undo] 'decipher-undo) - (define-key decipher-mode-map [remap advertised-undo] 'decipher-undo) - (let ((key ?a)) - (while (<= key ?z) - (define-key decipher-mode-map (vector key) 'decipher-keypress) - (incf key))))) + -(defvar decipher-stats-mode-map nil - "Keymap for Decipher-Stats mode.") -(if (not decipher-stats-mode-map) - (progn - (setq decipher-stats-mode-map (make-keymap)) - (suppress-keymap decipher-stats-mode-map) - (define-key decipher-stats-mode-map "D" 'decipher-digram-list) - (define-key decipher-stats-mode-map "F" 'decipher-frequency-count) - (define-key decipher-stats-mode-map "N" 'decipher-adjacency-list) - )) +(defvar decipher-stats-mode-map + (let ((map (make-keymap))) + (suppress-keymap map) + (define-key map "D" 'decipher-digram-list) + (define-key map "F" 'decipher-frequency-count) + (define-key map "N" 'decipher-adjacency-list) + map) +"Keymap for Decipher-Stats mode.") + (defvar decipher-mode-syntax-table nil "Decipher mode syntax table")
--- a/lisp/play/landmark.el Sun Oct 10 22:48:40 2010 +0000 +++ b/lisp/play/landmark.el Sun Oct 10 16:12:30 2010 -0700 @@ -159,52 +159,52 @@ :type 'hook :group 'lm) -(defvar lm-mode-map nil +(defvar lm-mode-map + (let ((map (make-sparse-keymap))) + ;; Key bindings for cursor motion. + (define-key map "y" 'lm-move-nw) ; y + (define-key map "u" 'lm-move-ne) ; u + (define-key map "b" 'lm-move-sw) ; b + (define-key map "n" 'lm-move-se) ; n + (define-key map "h" 'backward-char) ; h + (define-key map "l" 'forward-char) ; l + (define-key map "j" 'lm-move-down) ; j + (define-key map "k" 'lm-move-up) ; k + + (define-key map [kp-7] 'lm-move-nw) + (define-key map [kp-9] 'lm-move-ne) + (define-key map [kp-1] 'lm-move-sw) + (define-key map [kp-3] 'lm-move-se) + (define-key map [kp-4] 'backward-char) + (define-key map [kp-6] 'forward-char) + (define-key map [kp-2] 'lm-move-down) + (define-key map [kp-8] 'lm-move-up) + + (define-key map "\C-n" 'lm-move-down) ; C-n + (define-key map "\C-p" 'lm-move-up) ; C-p + + ;; Key bindings for entering Human moves. + (define-key map "X" 'lm-human-plays) ; X + (define-key map "x" 'lm-human-plays) ; x + + (define-key map " " 'lm-start-robot) ; SPC + (define-key map [down-mouse-1] 'lm-start-robot) + (define-key map [drag-mouse-1] 'lm-click) + (define-key map [mouse-1] 'lm-click) + (define-key map [down-mouse-2] 'lm-click) + (define-key map [mouse-2] 'lm-mouse-play) + (define-key map [drag-mouse-2] 'lm-mouse-play) + + (define-key map [remap previous-line] 'lm-move-up) + (define-key map [remap next-line] 'lm-move-down) + (define-key map [remap beginning-of-line] 'lm-beginning-of-line) + (define-key map [remap end-of-line] 'lm-end-of-line) + (define-key map [remap undo] 'lm-human-takes-back) + (define-key map [remap advertised-undo] 'lm-human-takes-back) + map) "Local keymap to use in Lm mode.") -(if lm-mode-map nil - (setq lm-mode-map (make-sparse-keymap)) - ;; Key bindings for cursor motion. - (define-key lm-mode-map "y" 'lm-move-nw) ; y - (define-key lm-mode-map "u" 'lm-move-ne) ; u - (define-key lm-mode-map "b" 'lm-move-sw) ; b - (define-key lm-mode-map "n" 'lm-move-se) ; n - (define-key lm-mode-map "h" 'backward-char) ; h - (define-key lm-mode-map "l" 'forward-char) ; l - (define-key lm-mode-map "j" 'lm-move-down) ; j - (define-key lm-mode-map "k" 'lm-move-up) ; k - - (define-key lm-mode-map [kp-7] 'lm-move-nw) - (define-key lm-mode-map [kp-9] 'lm-move-ne) - (define-key lm-mode-map [kp-1] 'lm-move-sw) - (define-key lm-mode-map [kp-3] 'lm-move-se) - (define-key lm-mode-map [kp-4] 'backward-char) - (define-key lm-mode-map [kp-6] 'forward-char) - (define-key lm-mode-map [kp-2] 'lm-move-down) - (define-key lm-mode-map [kp-8] 'lm-move-up) - - (define-key lm-mode-map "\C-n" 'lm-move-down) ; C-n - (define-key lm-mode-map "\C-p" 'lm-move-up) ; C-p - - ;; Key bindings for entering Human moves. - (define-key lm-mode-map "X" 'lm-human-plays) ; X - (define-key lm-mode-map "x" 'lm-human-plays) ; x - - (define-key lm-mode-map " " 'lm-start-robot) ; SPC - (define-key lm-mode-map [down-mouse-1] 'lm-start-robot) - (define-key lm-mode-map [drag-mouse-1] 'lm-click) - (define-key lm-mode-map [mouse-1] 'lm-click) - (define-key lm-mode-map [down-mouse-2] 'lm-click) - (define-key lm-mode-map [mouse-2] 'lm-mouse-play) - (define-key lm-mode-map [drag-mouse-2] 'lm-mouse-play) - - (define-key lm-mode-map [remap previous-line] 'lm-move-up) - (define-key lm-mode-map [remap next-line] 'lm-move-down) - (define-key lm-mode-map [remap beginning-of-line] 'lm-beginning-of-line) - (define-key lm-mode-map [remap end-of-line] 'lm-end-of-line) - (define-key lm-mode-map [remap undo] 'lm-human-takes-back) - (define-key lm-mode-map [remap advertised-undo] 'lm-human-takes-back)) (defvar lm-emacs-won () "*For making font-lock use the winner's face for the line.")
--- a/lisp/play/mpuz.el Sun Oct 10 22:48:40 2010 +0000 +++ b/lisp/play/mpuz.el Sun Oct 10 16:12:30 2010 -0700 @@ -87,33 +87,34 @@ :type 'hook :group 'mpuz) -(defvar mpuz-mode-map nil +(defvar mpuz-mode-map + (let ((map (make-sparse-keymap))) + (define-key map "a" 'mpuz-try-letter) + (define-key map "b" 'mpuz-try-letter) + (define-key map "c" 'mpuz-try-letter) + (define-key map "d" 'mpuz-try-letter) + (define-key map "e" 'mpuz-try-letter) + (define-key map "f" 'mpuz-try-letter) + (define-key map "g" 'mpuz-try-letter) + (define-key map "h" 'mpuz-try-letter) + (define-key map "i" 'mpuz-try-letter) + (define-key map "j" 'mpuz-try-letter) + (define-key map "A" 'mpuz-try-letter) + (define-key map "B" 'mpuz-try-letter) + (define-key map "C" 'mpuz-try-letter) + (define-key map "D" 'mpuz-try-letter) + (define-key map "E" 'mpuz-try-letter) + (define-key map "F" 'mpuz-try-letter) + (define-key map "G" 'mpuz-try-letter) + (define-key map "H" 'mpuz-try-letter) + (define-key map "I" 'mpuz-try-letter) + (define-key map "J" 'mpuz-try-letter) + (define-key map "\C-g" 'mpuz-offer-abort) + (define-key map "?" 'describe-mode) + map) "Local keymap to use in Mult Puzzle.") -(if mpuz-mode-map nil - (setq mpuz-mode-map (make-sparse-keymap)) - (define-key mpuz-mode-map "a" 'mpuz-try-letter) - (define-key mpuz-mode-map "b" 'mpuz-try-letter) - (define-key mpuz-mode-map "c" 'mpuz-try-letter) - (define-key mpuz-mode-map "d" 'mpuz-try-letter) - (define-key mpuz-mode-map "e" 'mpuz-try-letter) - (define-key mpuz-mode-map "f" 'mpuz-try-letter) - (define-key mpuz-mode-map "g" 'mpuz-try-letter) - (define-key mpuz-mode-map "h" 'mpuz-try-letter) - (define-key mpuz-mode-map "i" 'mpuz-try-letter) - (define-key mpuz-mode-map "j" 'mpuz-try-letter) - (define-key mpuz-mode-map "A" 'mpuz-try-letter) - (define-key mpuz-mode-map "B" 'mpuz-try-letter) - (define-key mpuz-mode-map "C" 'mpuz-try-letter) - (define-key mpuz-mode-map "D" 'mpuz-try-letter) - (define-key mpuz-mode-map "E" 'mpuz-try-letter) - (define-key mpuz-mode-map "F" 'mpuz-try-letter) - (define-key mpuz-mode-map "G" 'mpuz-try-letter) - (define-key mpuz-mode-map "H" 'mpuz-try-letter) - (define-key mpuz-mode-map "I" 'mpuz-try-letter) - (define-key mpuz-mode-map "J" 'mpuz-try-letter) - (define-key mpuz-mode-map "\C-g" 'mpuz-offer-abort) - (define-key mpuz-mode-map "?" 'describe-mode)) + (defun mpuz-mode () "Multiplication puzzle mode.
--- a/lisp/progmodes/inf-lisp.el Sun Oct 10 22:48:40 2010 +0000 +++ b/lisp/progmodes/inf-lisp.el Sun Oct 10 16:12:30 2010 -0700 @@ -80,19 +80,17 @@ :type 'regexp :group 'inferior-lisp) -(defvar inferior-lisp-mode-map nil) -(unless inferior-lisp-mode-map - (setq inferior-lisp-mode-map (copy-keymap comint-mode-map)) - (set-keymap-parent inferior-lisp-mode-map lisp-mode-shared-map) - (define-key inferior-lisp-mode-map "\C-x\C-e" 'lisp-eval-last-sexp) - (define-key inferior-lisp-mode-map "\C-c\C-l" 'lisp-load-file) - (define-key inferior-lisp-mode-map "\C-c\C-k" 'lisp-compile-file) - (define-key inferior-lisp-mode-map "\C-c\C-a" 'lisp-show-arglist) - (define-key inferior-lisp-mode-map "\C-c\C-d" 'lisp-describe-sym) - (define-key inferior-lisp-mode-map "\C-c\C-f" - 'lisp-show-function-documentation) - (define-key inferior-lisp-mode-map "\C-c\C-v" - 'lisp-show-variable-documentation)) +(defvar inferior-lisp-mode-map + (let ((map (copy-keymap comint-mode-map))) + (set-keymap-parent map lisp-mode-shared-map) + (define-key map "\C-x\C-e" 'lisp-eval-last-sexp) + (define-key map "\C-c\C-l" 'lisp-load-file) + (define-key map "\C-c\C-k" 'lisp-compile-file) + (define-key map "\C-c\C-a" 'lisp-show-arglist) + (define-key map "\C-c\C-d" 'lisp-describe-sym) + (define-key map "\C-c\C-f" 'lisp-show-function-documentation) + (define-key map "\C-c\C-v" 'lisp-show-variable-documentation) + map)) ;;; These commands augment Lisp mode, so you can process Lisp code in ;;; the source files.
--- a/lisp/progmodes/modula2.el Sun Oct 10 22:48:40 2010 +0000 +++ b/lisp/progmodes/modula2.el Sun Oct 10 16:12:30 2010 -0700 @@ -69,10 +69,7 @@ (setq m2-mode-syntax-table table))) ;;; Added by TEP -(defvar m2-mode-map nil - "Keymap used in Modula-2 mode.") - -(if m2-mode-map () +(defvar m2-mode-map (let ((map (make-sparse-keymap))) (define-key map "\^i" 'm2-tab) (define-key map "\C-cb" 'm2-begin) @@ -103,7 +100,8 @@ (define-key map "\C-c\C-t" 'm2-toggle) (define-key map "\C-c\C-l" 'm2-link) (define-key map "\C-c\C-c" 'm2-compile) - (setq m2-mode-map map))) + map) + "Keymap used in Modula-2 mode.") (defcustom m2-indent 5 "*This variable gives the indentation in Modula-2-Mode."
--- a/lisp/shell.el Sun Oct 10 22:48:40 2010 +0000 +++ b/lisp/shell.el Sun Oct 10 16:12:30 2010 -0700 @@ -334,26 +334,25 @@ (defvar shell-dirstack-query nil "Command used by `shell-resync-dirs' to query the shell.") -(defvar shell-mode-map nil) -(cond ((not shell-mode-map) - (setq shell-mode-map (nconc (make-sparse-keymap) comint-mode-map)) - (define-key shell-mode-map "\C-c\C-f" 'shell-forward-command) - (define-key shell-mode-map "\C-c\C-b" 'shell-backward-command) - (define-key shell-mode-map "\t" 'comint-dynamic-complete) - (define-key shell-mode-map (kbd "M-RET") 'shell-resync-dirs) - (define-key shell-mode-map "\M-?" - 'comint-dynamic-list-filename-completions) - (define-key shell-mode-map [menu-bar completion] - (cons "Complete" - (copy-keymap (lookup-key comint-mode-map [menu-bar completion])))) - (define-key-after (lookup-key shell-mode-map [menu-bar completion]) - [complete-env-variable] '("Complete Env. Variable Name" . - shell-dynamic-complete-environment-variable) - 'complete-file) - (define-key-after (lookup-key shell-mode-map [menu-bar completion]) - [expand-directory] '("Expand Directory Reference" . - shell-replace-by-expanded-directory) - 'complete-expand))) +(defvar shell-mode-map + (let ((map (nconc (make-sparse-keymap) comint-mode-map))) + (define-key map "\C-c\C-f" 'shell-forward-command) + (define-key map "\C-c\C-b" 'shell-backward-command) + (define-key map "\t" 'comint-dynamic-complete) + (define-key map (kbd "M-RET") 'shell-resync-dirs) + (define-key map "\M-?" 'comint-dynamic-list-filename-completions) + (define-key map [menu-bar completion] + (cons "Complete" + (copy-keymap (lookup-key comint-mode-map [menu-bar completion])))) + (define-key-after (lookup-key map [menu-bar completion]) + [complete-env-variable] '("Complete Env. Variable Name" . + shell-dynamic-complete-environment-variable) + 'complete-file) + (define-key-after (lookup-key map [menu-bar completion]) + [expand-directory] '("Expand Directory Reference" . + shell-replace-by-expanded-directory) + 'complete-expand) + map)) (defcustom shell-mode-hook '() "Hook for customizing Shell mode."