From: Dmitry Gutov Date: Sun, 23 Mar 2014 08:35:56 +0000 (+0200) Subject: * lisp/emacs-lisp/package.el (package-show-package-list): If the buffer X-Git-Tag: emacs-24.3.90~110 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2614c1af39e9a9746133a7e04e19f378ad593909;p=emacs.git * lisp/emacs-lisp/package.el (package-show-package-list): If the buffer is already displayed in another window, switch to that window. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b73bb1e67d5..feb78f59fc7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-03-23 Dmitry Gutov + + * emacs-lisp/package.el (package-show-package-list): If the buffer + is already displayed in another window, switch to that window. + 2014-03-21 Daniel Colascione * mail/emacsbug.el (report-emacs-bug): Include memory usage 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.