From: Chong Yidong Date: Wed, 12 Jan 2011 18:57:23 +0000 (-0500) Subject: * emacs-lisp/package.el (package--list-packages): Use switch-to-buffer. X-Git-Tag: emacs-pretest-24.0.90~104^2~618^2~1322^2~236^2~2^2~3 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2a8b13afb756f8d291646df34e2a7d4dc853c2da;p=emacs.git * emacs-lisp/package.el (package--list-packages): Use switch-to-buffer. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0c3f09e157b..e492282d239 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2011-01-12 Chong Yidong + + * emacs-lisp/package.el (package--list-packages): Use + switch-to-buffer. + 2011-01-11 Johan Bockgård * emacs-lisp/unsafep.el (unsafep): Handle backquoted forms. diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index fecddcf16ed..dfe1a4309ca 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1663,15 +1663,15 @@ A value of nil means to display all packages.") Optional PACKAGES is a list of names of packages (symbols) to list; the default is to display everything in `package-alist'." (require 'finder-inf nil t) - (with-current-buffer (get-buffer-create "*Packages*") - (package-menu-mode) - (set (make-local-variable 'package-menu-package-list) packages) - (set (make-local-variable 'package-menu-sort-key) nil) - (package--generate-package-list) - ;; It's okay to use pop-to-buffer here. The package menu buffer - ;; has keybindings, and the user just typed `M-x list-packages', - ;; suggesting that they might want to use them. - (pop-to-buffer (current-buffer)))) + (let ((buf (get-buffer-create "*Packages*"))) + (with-current-buffer buf + (package-menu-mode) + (set (make-local-variable 'package-menu-package-list) packages) + (set (make-local-variable 'package-menu-sort-key) nil) + (package--generate-package-list)) + ;; The package menu buffer has keybindings. If the user types + ;; `M-x list-packages', that suggests it should become current. + (switch-to-buffer buf))) ;;;###autoload (defun list-packages ()