From b2ae61663cca5a66e43112cccb9619c49d46df44 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sat, 3 Sep 2022 12:58:09 +0200 Subject: url-lookup: read-string if no arg or url at point --- lisp/mastodon.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/mastodon.el b/lisp/mastodon.el index a85a7f7..3162e91 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -269,12 +269,15 @@ If REPLY-JSON is the json of the toot being replied to." ;;;###autoload (defun mastodon-url-lookup (&optional query-url) - "Do a WebFinger lookup for QUERY-URL, or the URL at point. + "Do a WebFinger lookup for a URL. +URL can be arg QUERY-URL, or URL at point, or provided by the user. If a status or account is found, load it in `mastodon.el', if not, just browse the URL in the normal fashion." (interactive) (message "Performing lookup...") - (let* ((query (or query-url (url-get-url-at-point))) + (let* ((query (or query-url + (url-get-url-at-point) + (read-string "Lookup URL: "))) (url (format "%s/api/v2/search" mastodon-instance-url)) (param (concat "resolve=t")) ; webfinger (response (mastodon-http--get-search-json url query param :silent))) -- cgit v1.2.3 From 4d431d69db1690df906f1bffeb4d518c38bdddae Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sat, 3 Sep 2022 12:59:41 +0200 Subject: readme: url-lookup --- README.org | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.org b/README.org index ffd66e6..2bd6103 100644 --- a/README.org +++ b/README.org @@ -206,6 +206,8 @@ You can download and use your instance's custom emoji *** Other commands and account settings: +- =mastodon-url-lookup=: Attempt to load URL in =mastodon.el=. URL may be the one at point or provided in the minibuffer. Should also work if =mastodon.el= is not yet loaded. + - =mastodon-tl-view-instance-description=: View information about the instance that the author of the toot at point is on. - =mastodon-tl-view-own-instance=: View information about your own instance. - =mastodon-search-trending-tags=: View a list of trending hashtags on your instance. -- cgit v1.2.3