X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=elpher.git;a=blobdiff_plain;f=elpher.el;h=f2397e997befc6a57a7b6689f9f7d86828eb3c7a;hp=3d8e77f680c4e9c875369a232ee6394316d342b8;hb=81e107a26924747c10c671882032d341ca6d77c4;hpb=7ac8997eb71a5f5b914bdd4a99317588ba076727 diff --git a/elpher.el b/elpher.el index 3d8e77f..f2397e9 100644 --- a/elpher.el +++ b/elpher.el @@ -2103,7 +2103,8 @@ supports the old protocol elpher, where the link is self-contained." ;; that variable is `browse-url-default-browser' by default, so ;; that's the function that gets advised. If the value is an alist, ;; however, we don't know what to do. Better not interfere? - (when (fboundp browse-url-browser-function) + (when (and (symbolp browse-url-browser-function) + (fboundp browse-url-browser-function)) (advice-add browse-url-browser-function :before-while (lambda (url &rest _args) "Handle gemini, gopher, and finger schemes using Elpher." @@ -2160,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