From: Tim Vaughan Date: Sun, 8 Dec 2019 20:53:00 +0000 (+0100) Subject: Make elpher-go be useful non-interactively. X-Git-Tag: v2.5.0~2 X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=commitdiff_plain;h=258d54f685ffdec64da6b28236972cf0e872fa56;p=elpher.git Make elpher-go be useful non-interactively. --- diff --git a/elpher.el b/elpher.el index 4a31be2..48aaf14 100644 --- a/elpher.el +++ b/elpher.el @@ -1,4 +1,4 @@ -;;; elpher.el --- A friendly gopher client. -*- lexical-binding:t -*- +;;; elpher.el --- A friendly gopher client -*- lexical-binding:t -*- ;; Copyright (C) 2019 Tim Vaughan @@ -1235,15 +1235,15 @@ If ADDRESS is already bookmarked, update the label only." (interactive) (push-button)) -(defun elpher-go () - "Go to a particular gopher site read from the minibuffer." - (interactive) - (let ((page - (let ((host-or-url (read-string "Gopher or Gemini URL: "))) - (elpher-make-page host-or-url - (elpher-address-from-url host-or-url))))) +(defun elpher-go (host-or-url) + "Go to a particular gopher site HOST-OR-URL. +When run interactively HOST-OR-URL is read from the minibuffer." + (interactive "sGopher or Gemini URL: ") + (let ((page (elpher-make-page host-or-url + (elpher-address-from-url host-or-url)))) (switch-to-buffer "*elpher*") - (elpher-visit-page page))) + (elpher-visit-page page) + '())) (defun elpher-go-current () "Go to a particular site read from the minibuffer, initialized with the current URL."