changeset 110153:b071d3abc3f4

Set revert-buffer-function in Package Menu. * emacs-lisp/package.el (package-menu-mode-map): Change package-menu-revert bindings to revert-buffer. (package-menu-mode): Set revert-buffer-function. (package-menu-revert): Doc fix.
author Chong Yidong <cyd@stupidchicken.com>
date Thu, 02 Sep 2010 11:29:15 -0400
parents 3b368edf4df1
children dd1cdc89c51a
files lisp/ChangeLog lisp/emacs-lisp/package.el
diffstat 2 files changed, 14 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Thu Sep 02 14:10:03 2010 +0000
+++ b/lisp/ChangeLog	Thu Sep 02 11:29:15 2010 -0400
@@ -1,3 +1,10 @@
+2010-09-02  Chong Yidong  <cyd@stupidchicken.com>
+
+	* emacs-lisp/package.el (package-menu-mode-map): Change
+	package-menu-revert bindings to revert-buffer.
+	(package-menu-mode): Set revert-buffer-function.
+	(package-menu-revert): Doc fix.
+
 2010-09-02  Agustín Martín  <agustin.martin@hispalinux.es>
 
 	* textmodes/ispell.el (ispell-init-process): Use "~/" as
--- a/lisp/emacs-lisp/package.el	Thu Sep 02 14:10:03 2010 +0000
+++ b/lisp/emacs-lisp/package.el	Thu Sep 02 11:29:15 2010 -0400
@@ -1195,7 +1195,7 @@
     (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 "g" 'revert-buffer)
     (define-key map "r" 'package-menu-refresh)
     (define-key map "~" 'package-menu-mark-obsolete-for-deletion)
     (define-key map "x" 'package-menu-execute)
@@ -1229,7 +1229,7 @@
 		  :help "Mark a package for installation and move to the next line"))
     (define-key menu-map [s3] '("--"))
     (define-key menu-map [mg]
-      '(menu-item "Update package list" package-menu-revert
+      '(menu-item "Update package list" revert-buffer
 		  :help "Update the list of packages"))
     (define-key menu-map [mr]
       '(menu-item "Refresh package list" package-menu-refresh
@@ -1272,6 +1272,7 @@
   (setq mode-name "Package Menu")
   (setq truncate-lines t)
   (setq buffer-read-only t)
+  (setq revert-buffer-function 'package-menu-revert)
   (setq header-line-format
 	(mapconcat
 	 (lambda (pair)
@@ -1311,8 +1312,10 @@
   (package-refresh-contents)
   (package--generate-package-list))
 
-(defun package-menu-revert ()
-  "Update the list of packages."
+(defun package-menu-revert (&optional arg noconfirm)
+  "Update the list of packages.
+This function is the `revert-buffer-function' for Package Menu
+buffers.  The arguments are ignored."
   (interactive)
   (unless (eq major-mode 'package-menu-mode)
     (error "The current buffer is not a Package Menu"))