From 2b5b5cdd214be61b91669f143a19a4400f35d8fd Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sat, 9 Mar 2024 10:42:29 +0100 Subject: roll our own url-at-point fun, in case eww not loaded --- lisp/mastodon.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lisp/mastodon.el') diff --git a/lisp/mastodon.el b/lisp/mastodon.el index 4928bf1..4667450 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -455,6 +455,10 @@ Calls `mastodon-tl--get-buffer-type', which see." (mastodon-tl--get-buffer-type)))))) (switch-to-buffer choice))) +(defun mastodon--url-at-point () + "`thing-at-point' provider function." + (get-text-property (point) 'shr-url)) + (defun mastodon-mode-hook-fun () "Function to add to `mastodon-mode-hook'." (when (require 'emojify nil :noerror) @@ -467,8 +471,7 @@ Calls `mastodon-tl--get-buffer-type', which see." ;; make `thing-at-point' functions work: (setq-local thing-at-point-provider-alist (append thing-at-point-provider-alist - '((url . eww--url-at-point))))) - + '((url . mastodon--url-at-point))))) ;;;###autoload (add-hook 'mastodon-mode-hook #'mastodon-mode-hook-fun) -- cgit v1.2.3