From: Tim Vaughan Date: Fri, 8 Oct 2021 12:17:23 +0000 (+0200) Subject: Prevent buffer switching when *elpher* already visible. X-Git-Tag: v3.3.0~4 X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=commitdiff_plain;h=81e107a26924747c10c671882032d341ca6d77c4;p=elpher.git Prevent buffer switching when *elpher* already visible. --- diff --git a/elpher.el b/elpher.el index d8e588c..f2397e9 100644 --- a/elpher.el +++ b/elpher.el @@ -2161,7 +2161,8 @@ When run interactively HOST-OR-URL is read from the minibuffer." (unless (string-empty-p trimmed-host-or-url) (let ((page (elpher-page-from-url trimmed-host-or-url (elpher-get-default-url-scheme)))) - (switch-to-buffer elpher-buffer-name) + (unless (get-buffer-window elpher-buffer-name t) + (switch-to-buffer elpher-buffer-name)) (elpher-with-clean-buffer (elpher-visit-page page)) nil)))) ; non-nil value is displayed by eshell