From: Stefan Monnier Date: Sat, 12 Mar 2011 02:49:29 +0000 (-0500) Subject: * lisp/ebuff-menu.el (electric-buffer-menu-mode-map): Move initialization X-Git-Tag: emacs-pretest-24.0.90~104^3~104 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bb0bd45af0817b2dfad40187a20effac4d49da06;p=emacs.git * lisp/ebuff-menu.el (electric-buffer-menu-mode-map): Move initialization into declaration. Remove redundant and harmful binding. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e368e660fe2..bf3775b3852 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2011-03-12 Stefan Monnier + + * ebuff-menu.el (electric-buffer-menu-mode-map): Move initialization + into declaration. Remove redundant and harmful binding. + 2011-03-11 Juanma Barranquero Backport revno:103463 from trunk. 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)