changeset 109018:3fa4756bb7be

emacs-lisp/package.el (package-menu-mode-map): Move initialization into declaration.
author Juanma Barranquero <lekktu@gmail.com>
date Thu, 17 Jun 2010 13:02:42 +0200
parents 1bf6e768d93b
children cc5e488bdbb4
files lisp/ChangeLog lisp/emacs-lisp/package.el
diffstat 2 files changed, 20 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Thu Jun 17 12:45:25 2010 +0200
+++ b/lisp/ChangeLog	Thu Jun 17 13:02:42 2010 +0200
@@ -1,5 +1,8 @@
 2010-06-17  Juanma Barranquero  <lekktu@gmail.com>
 
+	* emacs-lisp/package.el (package-menu-mode-map):
+	Move initialization into declaration.
+
 	* menu-bar.el (menu-bar-options-menu): Fix typo in menu entry.
 
 2010-06-17  Chong Yidong  <cyd@stupidchicken.com>
--- a/lisp/emacs-lisp/package.el	Thu Jun 17 12:45:25 2010 +0200
+++ b/lisp/emacs-lisp/package.el	Thu Jun 17 13:02:42 2010 +0200
@@ -1040,27 +1040,25 @@
 
 ;;;; Package menu mode.
 
-(defvar package-menu-mode-map nil
+(defvar package-menu-mode-map
+  (let ((map (make-keymap)))
+    (suppress-keymap map)
+    (define-key map "q" 'quit-window)
+    (define-key map "n" 'next-line)
+    (define-key map "p" 'previous-line)
+    (define-key map "u" 'package-menu-mark-unmark)
+    (define-key map "\177" 'package-menu-backup-unmark)
+    (define-key map "d" 'package-menu-mark-delete)
+    (define-key map "i" 'package-menu-mark-install)
+    (define-key map "g" 'package-menu-revert)
+    (define-key map "r" 'package-menu-refresh)
+    (define-key map "~" 'package-menu-mark-obsolete-for-deletion)
+    (define-key map "x" 'package-menu-execute)
+    (define-key map "h" 'package-menu-quick-help)
+    (define-key map "?" 'package-menu-view-commentary)
+    map)
   "Local keymap for `package-menu-mode' buffers.")
 
-(unless package-menu-mode-map
-  (setq package-menu-mode-map (make-keymap))
-  (suppress-keymap package-menu-mode-map)
-  (define-key package-menu-mode-map "q" 'quit-window)
-  (define-key package-menu-mode-map "n" 'next-line)
-  (define-key package-menu-mode-map "p" 'previous-line)
-  (define-key package-menu-mode-map "u" 'package-menu-mark-unmark)
-  (define-key package-menu-mode-map "\177" 'package-menu-backup-unmark)
-  (define-key package-menu-mode-map "d" 'package-menu-mark-delete)
-  (define-key package-menu-mode-map "i" 'package-menu-mark-install)
-  (define-key package-menu-mode-map "g" 'package-menu-revert)
-  (define-key package-menu-mode-map "r" 'package-menu-refresh)
-  (define-key package-menu-mode-map "~"
-    'package-menu-mark-obsolete-for-deletion)
-  (define-key package-menu-mode-map "x" 'package-menu-execute)
-  (define-key package-menu-mode-map "h" 'package-menu-quick-help)
-  (define-key package-menu-mode-map "?" 'package-menu-view-commentary))
-
 (defvar package-menu-sort-button-map
   (let ((map (make-sparse-keymap)))
     (define-key map [header-line mouse-1] 'package-menu-sort-by-column)