emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/mastodon 1da8ab0675 05/45: add cmd to url-lookup with no f


From: ELPA Syncer
Subject: [nongnu] elpa/mastodon 1da8ab0675 05/45: add cmd to url-lookup with no fedi-like check
Date: Thu, 1 Feb 2024 10:00:37 -0500 (EST)

branch: elpa/mastodon
commit 1da8ab0675928f84790bd684db28d0b7ee14dab8
Author: marty hiatt <martianhiatus@riseup.net>
Commit: marty hiatt <martianhiatus@riseup.net>

    add cmd to url-lookup with no fedi-like check
---
 lisp/mastodon.el | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lisp/mastodon.el b/lisp/mastodon.el
index bb06d1b7b5..6e05bd8da8 100644
--- a/lisp/mastodon.el
+++ b/lisp/mastodon.el
@@ -341,7 +341,7 @@ from the server and load anew."
 ;; URL lookup: should be available even if `mastodon.el' not loaded:
 
 ;;;###autoload
-(defun mastodon-url-lookup (&optional query-url)
+(defun mastodon-url-lookup (&optional query-url force)
   "If a URL resembles a mastodon link, try to load in `mastodon.el'.
 Does a WebFinger lookup.
 URL can be arg QUERY-URL, or URL at point, or provided by the user.
@@ -352,7 +352,8 @@ not, just browse the URL in the normal fashion."
                     (thing-at-point-url-at-point)
                     (mastodon-tl--property 'shr-url :no-move)
                     (read-string "Lookup URL: "))))
-    (if (not (mastodon--fedi-url-p query))
+    (if (and (not force)
+             (not (mastodon--fedi-url-p query)))
         ;; (shr-browse-url query) ; doesn't work (keep our shr keymap)
         (browse-url query)
       (message "Performing lookup...")
@@ -374,6 +375,11 @@ not, just browse the URL in the normal fashion."
               (t
                (browse-url query)))))))
 
+(defun mastodon-url-lookup-force ()
+  "Call `mastodon-url-lookup' without checking if URL is fedi-like."
+  (interactive)
+  (mastodon-url-lookup nil :force))
+
 (defun mastodon--fedi-url-p (query)
   "Check if QUERY resembles a fediverse URL."
   ;; calqued off 
https://github.com/tuskyapp/Tusky/blob/c8fc2418b8f5458a817bba221d025b822225e130/app/src/main/java/com/keylesspalace/tusky/BottomSheetActivity.kt



reply via email to

[Prev in Thread] Current Thread [Next in Thread]