Closed jabranham closed 7 years ago
What are the arguments being passed to it? The error means that sx-open-link
takes exactly one mandatory argument, but it was passed two arguments.
Also, this is really neat! I'll have to make the same setup in my own configuration once this is working 😄
Wow, that was fast. Thanks!
I'm late to the party, but here's an useful customisation: if possible, open SE links from eww
using sx.el
:
(defun andre-eww-follow-link-maybe-sx (orig-fun &rest args)
(let ((url (get-text-property (point) 'shr-url)))
(if (or
(string-match ".*\.stackexchange\.com" url)
(string-match ".*\.stackoverflow\.com" url))
(sx-open-link url)
(apply orig-fun args))))
(advice-add 'eww-follow-link :around #'andre-eww-follow-link-maybe-sx)
OK, not so fast. This won't work for URLs from a Google Search.
I'm surprised eww doesn't use browse-url
.
I'm trying to get it set up to where if I open a stackexchange link in Emacs it uses sx.el instead of firefox or eww or whatever. I currently have this:
In my config. But when I do C-c C-o on a link to follow it, I get this error:
If I do
M-x sx-open-link
and yank the link in, everything works great.