# HG changeset patch # User Chong Yidong # Date 1283441355 14400 # Node ID b071d3abc3f4d97460925e6b4e8f3b58dc907c0a # Parent 3b368edf4df11d8e92c8ea352f5998153416848e 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. diff -r 3b368edf4df1 -r b071d3abc3f4 lisp/ChangeLog --- 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 + + * 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 * textmodes/ispell.el (ispell-init-process): Use "~/" as diff -r 3b368edf4df1 -r b071d3abc3f4 lisp/emacs-lisp/package.el --- 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"))