diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2011-03-11 21:49:29 -0500 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2011-03-11 21:49:29 -0500 |
commit | bb0bd45af0817b2dfad40187a20effac4d49da06 (patch) | |
tree | 43ee447d518840269b5baf47ab82816175b2fafd /lisp/ebuff-menu.el | |
parent | 5ef342304deceb61037a9eec17d6b0eb7ac978dd (diff) | |
download | emacs-bb0bd45af0817b2dfad40187a20effac4d49da06.tar.gz |
* lisp/ebuff-menu.el (electric-buffer-menu-mode-map): Move initialization
into declaration. Remove redundant and harmful binding.
Diffstat (limited to 'lisp/ebuff-menu.el')
-rw-r--r-- | lisp/ebuff-menu.el | 101 |
1 files changed, 51 insertions, 50 deletions
diff --git a/lisp/ebuff-menu.el b/lisp/ebuff-menu.el index 7b4c07f74f5..9f9129919da 100644 --- a/lisp/ebuff-menu.el +++ b/lisp/ebuff-menu.el @@ -35,7 +35,56 @@ ;; this depends on the format of list-buffers (from src/buffer.c) and ;; on stuff in lisp/buff-menu.el -(defvar electric-buffer-menu-mode-map nil) +(defvar electric-buffer-menu-mode-map + (let ((map (make-keymap))) + (fillarray (car (cdr map)) 'Electric-buffer-menu-undefined) + (define-key map "\e" nil) + (define-key map "\C-z" 'suspend-frame) + (define-key map "v" 'Electric-buffer-menu-mode-view-buffer) + (define-key map (char-to-string help-char) 'Helper-help) + (define-key map "?" 'Helper-describe-bindings) + (define-key map "\C-c" nil) + (define-key map "\C-c\C-c" 'Electric-buffer-menu-quit) + (define-key map "\C-]" 'Electric-buffer-menu-quit) + (define-key map "q" 'Electric-buffer-menu-quit) + (define-key map " " 'Electric-buffer-menu-select) + (define-key map "\C-m" 'Electric-buffer-menu-select) + (define-key map "\C-l" 'recenter) + (define-key map "s" 'Buffer-menu-save) + (define-key map "d" 'Buffer-menu-delete) + (define-key map "k" 'Buffer-menu-delete) + (define-key map "\C-d" 'Buffer-menu-delete-backwards) + ;; (define-key map "\C-k" 'Buffer-menu-delete) + (define-key map "\177" 'Buffer-menu-backup-unmark) + (define-key map "~" 'Buffer-menu-not-modified) + (define-key map "u" 'Buffer-menu-unmark) + (let ((i ?0)) + (while (<= i ?9) + (define-key map (char-to-string i) 'digit-argument) + (define-key map (concat "\e" (char-to-string i)) 'digit-argument) + (setq i (1+ i)))) + (define-key map "-" 'negative-argument) + (define-key map "\e-" 'negative-argument) + (define-key map "m" 'Buffer-menu-mark) + (define-key map "\C-u" 'universal-argument) + (define-key map "\C-p" 'previous-line) + (define-key map "\C-n" 'next-line) + (define-key map "p" 'previous-line) + (define-key map "n" 'next-line) + (define-key map "\C-v" 'scroll-up) + (define-key map "\ev" 'scroll-down) + (define-key map ">" 'scroll-right) + (define-key map "<" 'scroll-left) + (define-key map "\e\C-v" 'scroll-other-window) + (define-key map "\e>" 'end-of-buffer) + (define-key map "\e<" 'beginning-of-buffer) + (define-key map "\e\e" nil) + (define-key map "\e\e\e" 'Electric-buffer-menu-quit) + ;; This binding prevents the "escape => ESC" function-key-map mapping from + ;; kicking in! + ;; (define-key map [escape escape escape] 'Electric-buffer-menu-quit) + (define-key map [mouse-2] 'Electric-buffer-menu-mouse-select) + map)) (defvar electric-buffer-menu-mode-hook nil "Normal hook run by `electric-buffer-list'.") @@ -168,55 +217,7 @@ Entry to this mode via command `electric-buffer-list' calls the value of ;; generally the same as Buffer-menu-mode-map ;; (except we don't indirect to global-map) (put 'Electric-buffer-menu-undefined 'suppress-keymap t) -(if electric-buffer-menu-mode-map - nil - (let ((map (make-keymap))) - (fillarray (car (cdr map)) 'Electric-buffer-menu-undefined) - (define-key map "\e" nil) - (define-key map "\C-z" 'suspend-frame) - (define-key map "v" 'Electric-buffer-menu-mode-view-buffer) - (define-key map (char-to-string help-char) 'Helper-help) - (define-key map "?" 'Helper-describe-bindings) - (define-key map "\C-c" nil) - (define-key map "\C-c\C-c" 'Electric-buffer-menu-quit) - (define-key map "\C-]" 'Electric-buffer-menu-quit) - (define-key map "q" 'Electric-buffer-menu-quit) - (define-key map " " 'Electric-buffer-menu-select) - (define-key map "\C-m" 'Electric-buffer-menu-select) - (define-key map "\C-l" 'recenter) - (define-key map "s" 'Buffer-menu-save) - (define-key map "d" 'Buffer-menu-delete) - (define-key map "k" 'Buffer-menu-delete) - (define-key map "\C-d" 'Buffer-menu-delete-backwards) - ;(define-key map "\C-k" 'Buffer-menu-delete) - (define-key map "\177" 'Buffer-menu-backup-unmark) - (define-key map "~" 'Buffer-menu-not-modified) - (define-key map "u" 'Buffer-menu-unmark) - (let ((i ?0)) - (while (<= i ?9) - (define-key map (char-to-string i) 'digit-argument) - (define-key map (concat "\e" (char-to-string i)) 'digit-argument) - (setq i (1+ i)))) - (define-key map "-" 'negative-argument) - (define-key map "\e-" 'negative-argument) - (define-key map "m" 'Buffer-menu-mark) - (define-key map "\C-u" 'universal-argument) - (define-key map "\C-p" 'previous-line) - (define-key map "\C-n" 'next-line) - (define-key map "p" 'previous-line) - (define-key map "n" 'next-line) - (define-key map "\C-v" 'scroll-up) - (define-key map "\ev" 'scroll-down) - (define-key map ">" 'scroll-right) - (define-key map "<" 'scroll-left) - (define-key map "\e\C-v" 'scroll-other-window) - (define-key map "\e>" 'end-of-buffer) - (define-key map "\e<" 'beginning-of-buffer) - (define-key map "\e\e" nil) - (define-key map "\e\e\e" 'Electric-buffer-menu-quit) - (define-key map [escape escape escape] 'Electric-buffer-menu-quit) - (define-key map [mouse-2] 'Electric-buffer-menu-mouse-select) - (setq electric-buffer-menu-mode-map map))) + (defun Electric-buffer-menu-exit () (interactive) |