From: Tim Vaughan Date: Thu, 23 May 2019 07:39:31 +0000 (+0200) Subject: (elpher) switches to existing elpher buffer if one exists. X-Git-Tag: v1.1.0~5 X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=commitdiff_plain;h=b54d1edc08b0fd187ef0238279ab99068e3e9218;p=elpher.git (elpher) switches to existing elpher buffer if one exists. --- diff --git a/elpher.el b/elpher.el index 2764f1d..30ec292 100644 --- a/elpher.el +++ b/elpher.el @@ -742,12 +742,14 @@ The result is stored as a string in the variable ‘elpher-selector-string’." (defun elpher () "Start elpher with default landing page." (interactive) - (switch-to-buffer "*elpher*") - (setq elpher-current-node nil) - (let ((start-node (elpher-make-node nil - elpher-start-address - #'elpher-get-index-node))) - (elpher-visit-node start-node)) + (if (get-buffer "*elpher*") + (switch-to-buffer "*elpher*") + (switch-to-buffer "*elpher*") + (setq elpher-current-node nil) + (let ((start-node (elpher-make-node nil + elpher-start-address + #'elpher-get-index-node))) + (elpher-visit-node start-node))) "Started Elpher.") ; Otherwise (elpher) evaluates to start page string. ;;; elpher.el ends here