summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/package.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 480fddbd320..39cfd8e46ec 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -2117,11 +2117,14 @@ When KEYWORDS are given, only packages with those KEYWORDS are
shown."
(interactive)
(require 'finder-inf nil t)
- (let ((buf (get-buffer-create "*Packages*")))
+ (let* ((buf (get-buffer-create "*Packages*"))
+ (win (get-buffer-window buf)))
(with-current-buffer buf
(package-menu-mode)
(package-menu--generate nil packages keywords))
- (switch-to-buffer buf)))
+ (if win
+ (select-window win)
+ (switch-to-buffer buf))))
;; package-menu--generate rebinds "q" on the fly, so we have to
;; hard-code the binding in the doc-string here.