Commit a0310a6c authored by Dan Nicolaescu's avatar Dan Nicolaescu
Browse files

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.
parent dab0271f
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>
......
......@@ -775,32 +775,30 @@ Return COLUMN."
;;; 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)
......
......@@ -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)
......
......@@ -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.")
......
......@@ -4011,18 +4011,16 @@ May only be called from within `edebug-recursive-edit'."
(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)
......
......@@ -27,158 +27,156 @@
;; This emulates WordStar, with a major mode.
;;; Code:
(defvar wordstar-mode-map nil "")
(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)
"")
(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)
"")
(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)
"")
(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-j-map not yet implemented
(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))
(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
(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
(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)
;; 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))
(put 'wordstar-mode 'mode-class 'special)
......
......@@ -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.")
......
......@@ -97,7 +97,99 @@ Quoting cannot be used, so the arguments cannot themselves contain spaces."
(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 @@ This function is assumed to be used as callback function for `hl-line-mode'."
;; 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)