From 0bb2e4c86f986c35bf6760ae5c8e5ad4b9eace7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Vanicat?= Date: Wed, 26 May 2010 17:09:35 +0200 Subject: [PATCH] Removing a duplicate switch-to-buffer We don't need to change buffer twice when we use a new buffer --- magit.el | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/magit.el b/magit.el index 07b605e5..77868e78 100644 --- a/magit.el +++ b/magit.el @@ -2495,11 +2495,10 @@ insert a line to tell how to insert more of them" (setq topdir (magit-get-top-dir dir)))) (when topdir (let ((buf (or (magit-find-buffer 'status topdir) - (switch-to-buffer - (get-buffer-create - (concat "*magit: " - (file-name-nondirectory - (directory-file-name topdir)) "*")))))) + (get-buffer-create + (concat "*magit: " + (file-name-nondirectory + (directory-file-name topdir)) "*"))))) (switch-to-buffer buf) (magit-mode-init topdir 'status #'magit-refresh-status) (magit-status-mode t)))))