bug#44783: 28.0.50; wish for eww: include gopher and gemini links

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#44783: 28.0.50; wish for eww: include gopher and gemini links

Jean Louis

It would be good to handle other links from eww such as gopher and
gemini

- defcustom for function to launch gemini client, could be Emacs
  package as elpher, preferred or could be external program

- defcustom for function to launch gopher client, could be Emacs
  package like elpher, preferred, or could be external program
 
--
Thanks,
Jean Louis
⎔ λ 🄯 𝍄 𝌡 𝌚



Reply | Threaded
Open this post in threaded view
|

bug#44783: 28.0.50; wish for eww: include gopher and gemini links

Eli Zaretskii
> Date: Sat, 21 Nov 2020 22:41:29 +0300
> From: Jean Louis <[hidden email]>
>
>
> It would be good to handle other links from eww such as gopher and
> gemini
>
> - defcustom for function to launch gemini client, could be Emacs
>   package as elpher, preferred or could be external program
>
> - defcustom for function to launch gopher client, could be Emacs
>   package like elpher, preferred, or could be external program

Doesn't browse-url already support that?



Reply | Threaded
Open this post in threaded view
|

bug#44783: 28.0.50; wish for eww: include gopher and gemini links

Jean Louis
* Eli Zaretskii <[hidden email]> [2020-11-21 22:53]:

> > Date: Sat, 21 Nov 2020 22:41:29 +0300
> > From: Jean Louis <[hidden email]>
> >
> >
> > It would be good to handle other links from eww such as gopher and
> > gemini
> >
> > - defcustom for function to launch gemini client, could be Emacs
> >   package as elpher, preferred or could be external program
> >
> > - defcustom for function to launch gopher client, could be Emacs
> >   package like elpher, preferred, or could be external program
>
> Doesn't browse-url already support that?

I see unknown url scheme gopher and trying to open gopher. If unknown
it should not even try opening it.

But gopher and gemini are well known protocols and Emacs is one of its
browsers. Elpher package recognizes WWW and redirects to eww, so eww
should be able to redirect to something else such as elpher or
external gopher and gemini browsers.



Reply | Threaded
Open this post in threaded view
|

bug#44783: 28.0.50; wish for eww: include gopher and gemini links

Lars Ingebrigtsen
In reply to this post by Jean Louis
Jean Louis <[hidden email]> writes:

> It would be good to handle other links from eww such as gopher and
> gemini
>
> - defcustom for function to launch gemini client, could be Emacs
>   package as elpher, preferred or could be external program
>
> - defcustom for function to launch gopher client, could be Emacs
>   package like elpher, preferred, or could be external program

I've now added eww-use-browse-url, which you can change to make eww hand
off gopher: links to browse-url.  browse-url has machinery to further
decide how to handle these things via browse-url-handlers.

--
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



Reply | Threaded
Open this post in threaded view
|

bug#44783: 28.0.50; wish for eww: include gopher and gemini links

Jean Louis
* Lars Ingebrigtsen <[hidden email]> [2020-11-24 10:24]:

> Jean Louis <[hidden email]> writes:
>
> > It would be good to handle other links from eww such as gopher and
> > gemini
> >
> > - defcustom for function to launch gemini client, could be Emacs
> >   package as elpher, preferred or could be external program
> >
> > - defcustom for function to launch gopher client, could be Emacs
> >   package like elpher, preferred, or could be external program
>
> I've now added eww-use-browse-url, which you can change to make eww hand
> off gopher: links to browse-url.  browse-url has machinery to further
> decide how to handle these things via browse-url-handlers.

Really?

Do you think I could then also use goto-address-mode where hyperlinks
appear and that I can customize it to open up any kinds of URI
hyperlinks?






Reply | Threaded
Open this post in threaded view
|

bug#44783: 28.0.50; wish for eww: include gopher and gemini links

Lars Ingebrigtsen
Jean Louis <[hidden email]> writes:

> Do you think I could then also use goto-address-mode where hyperlinks
> appear and that I can customize it to open up any kinds of URI
> hyperlinks?

If goto-address-mode calls browse-url, yes.

--
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



Reply | Threaded
Open this post in threaded view
|

bug#44783: 28.0.50; wish for eww: include gopher and gemini links

Jean Louis
* Lars Ingebrigtsen <[hidden email]> [2020-11-24 12:05]:
> Jean Louis <[hidden email]> writes:
>
> > Do you think I could then also use goto-address-mode where hyperlinks
> > appear and that I can customize it to open up any kinds of URI
> > hyperlinks?
>
> If goto-address-mode calls browse-url, yes.

C-c RET (translated from C-c <return>) runs the command
goto-address-at-point (found in goto-address-highlight-keymap), which
is an autoloaded interactive compiled Lisp function in ‘goto-addr.el’.

It is bound to <mouse-2>, C-c RET.

(goto-address-at-point &optional EVENT)

Send to the e-mail address or load the URL at point.
Send mail to address at point.  See documentation for
‘goto-address-find-address-at-point’.  If no address is found
there, then load the URL at or before point.

Then I see:

;;;###autoload
(defun goto-address-at-point (&optional event)
  "Send to the e-mail address or load the URL at point.
Send mail to address at point.  See documentation for
`goto-address-find-address-at-point'.  If no address is found
there, then load the URL at or before point."
  (interactive (list last-input-event))
  (save-excursion
    (if event (posn-set-point (event-end event)))
    (let ((address (save-excursion (goto-address-find-address-at-point))))
      (if (and address
               (save-excursion
                 (goto-char (previous-single-char-property-change
                             (point) 'goto-address nil
                             (line-beginning-position)))
                 (not (looking-at goto-address-url-regexp))))
          (compose-mail address)
        (let ((url (browse-url-url-at-point)))
          (if url
              (browse-url url)
            (error "No e-mail address or URL found")))))))

Do you think that this above need not be changed and that I can still
update to follow any type of hyperlink with the new change?




Reply | Threaded
Open this post in threaded view
|

bug#44783: 28.0.50; wish for eww: include gopher and gemini links

Lars Ingebrigtsen
Jean Louis <[hidden email]> writes:

>> If goto-address-mode calls browse-url, yes.

[...]

> (let ((url (browse-url-url-at-point)))
>  (if url
>      (browse-url url)
>    (error "No e-mail address or URL found")))))))

So it does use browse-url

> Do you think that this above need not be changed and that I can still
> update to follow any type of hyperlink with the new change?

I'm not sure what you're asking -- I have made no change to
goto-address-mode or browse-url.

browse-url-handlers is the variable to customise to change how
browse-url works, now as before.

--
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



Reply | Threaded
Open this post in threaded view
|

bug#44783: 28.0.50; wish for eww: include gopher and gemini links

Lars Ingebrigtsen
In reply to this post by Lars Ingebrigtsen
Jean Louis <[hidden email]> writes:

> The customization for `eww-use-browse-url' does not look best to
> me. Please clarify it, is it meant only for mailto: or user shall be
> able to add various other regular expressions for various URIs?

The doc string is:

---

eww will use ‘browse-url’ when following links that match this regexp.
The action to be taken can further be customized via
‘browse-url-handlers’.

---

(Oh, bad grammar; I'll fix.)

But I don't understand how this can be interpreted to be for mailto:
links in particular.

--
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



Reply | Threaded
Open this post in threaded view
|

bug#44783: 28.0.50; wish for eww: include gopher and gemini links

Lars Ingebrigtsen
Jean Louis <[hidden email]> writes:

> Because it is by default for mailto: but maybe there shall be
> repeatable INS list that users can enter various URI prefixes. And one
> shall use URI rather than URL, as it is not same. While URL is URI,
> not all URIs are URL.

I don't understand what you mean here, but it's a regexep -- it can
match whatever you want it to match.

--
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



Reply | Threaded
Open this post in threaded view
|

bug#44783: 28.0.50; wish for eww: include gopher and gemini links

Jean Louis
* Lars Ingebrigtsen <[hidden email]> [2020-11-30 13:25]:
> Jean Louis <[hidden email]> writes:
>
> > Because it is by default for mailto: but maybe there shall be
> > repeatable INS list that users can enter various URI prefixes. And one
> > shall use URI rather than URL, as it is not same. While URL is URI,
> > not all URIs are URL.
>
> I don't understand what you mean here, but it's a regexep -- it can
> match whatever you want it to match.

Thank you.

I was thinking it is not a list, not I see it is a list, that is good.

Close.



Reply | Threaded
Open this post in threaded view
|

bug#44783: 28.0.50; wish for eww: include gopher and gemini links

Lars Ingebrigtsen
Jean Louis <[hidden email]> writes:

> I was thinking it is not a list, not I see it is a list, that is good.

No, it's a regexp.  You can say mailto:\\|gopher:\\|gemini: or whatever
you want.

--
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



Reply | Threaded
Open this post in threaded view
|

bug#44783: 28.0.50; wish for eww: include gopher and gemini links

Jean Louis
* Lars Ingebrigtsen <[hidden email]> [2020-11-30 14:13]:
> Jean Louis <[hidden email]> writes:
>
> > I was thinking it is not a list, not I see it is a list, that is good.
>
> No, it's a regexp.  You can say mailto:\\|gopher:\\|gemini: or whatever
> you want.

I just wonder why is regexp in one line. That makes it harder for
users. My expectation is to have it as a list

[INS] Regexp: mailto:
[INS] Regexp: gopher:

etc.



Reply | Threaded
Open this post in threaded view
|

bug#44783: 28.0.50; wish for eww: include gopher and gemini links

Basil L. Contovounesios
Jean Louis <[hidden email]> writes:

> * Lars Ingebrigtsen <[hidden email]> [2020-11-30 14:13]:
>> Jean Louis <[hidden email]> writes:
>>
>> > I was thinking it is not a list, not I see it is a list, that is good.
>>
>> No, it's a regexp.  You can say mailto:\\|gopher:\\|gemini: or whatever
>> you want.
>
> I just wonder why is regexp in one line. That makes it harder for
> users. My expectation is to have it as a list

I don't mind either way, but FWIW rx allows for some programmatic regexp
composition:

  (with-eval-after-load 'eww
    (setq eww-use-browse-url
          (rx (| (: bos (| "gopher:" "gemini:"))
                 (regexp eww-use-browse-url)))))

--
Basil