emacs-devel
[Top][All Lists]
Advanced

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

[solved] - Re: Any way to tell Emacs how to open specific URIs?


From: Jean Louis
Subject: [solved] - Re: Any way to tell Emacs how to open specific URIs?
Date: Fri, 27 Nov 2020 18:41:52 +0300
User-agent: Mutt/2.0 (3d08634) (2020-11-07)

* 陈志伟 <chenzhiwei03@kuaishou.com> [2020-11-23 05:42]:
> > I strongly need a way to define how to open specific URIs as shown
> > here and to define some of my own. This will expand the program
> > capabilities I am making.
> > 
> > Is there any current way to define how to open these URIs?
> > 
> > Is there any plan to define those URIs how to open them?
> 
> Are `org-insert-link-gloal’ and `org-open-at-point-global’ suitable for your 
> cases?

Thank you. This has been solved.

[[something][asdf]] is not well readable and requires me and users to
use Org mode to see the link. Emacs in general is more capable than
just that and there is goto-address-mode which automatically
recognizes specific parts of text as hyperlinks.

For example text files cannot be easily readable if
shared. People receive text files as instructions on my side and
their email readers will not necessaril support Org mode. Once
they come on computer, maybe yes. But they cannot easily
understand Org hyperlinks.

The new enhancement will recognize following hyperlinks automatically:

("aaa://" "about:" "acap://" "apt:" "bzr://" "bzr+ssh://" "attachment:/" 
"chrome://" "cid:" "content://" "crid://" "cvs://" "data:" "dav:" "dict://" 
"doi:" "dns:" "dtn:" "feed:" "file:/" "finger://" "fish://" "ftp://"; "geo:" 
"git://" "go:" "gopher://"; "h323:" "http://"; "https://"; "im:" "imap://" "info:" 
"ipp:" "irc://" "irc6://" "ircs://" "iris.beep:" "jar:" "ldap://"; "ldaps://" 
"magnet:" "mailto:"; "mid:" "mtqp://" "mupdate://" "news:"; "nfs://" "nntp://"; 
"opaquelocktoken:" "pop://" "pres:" "resource://" "rmi://" "rsync://" "rtsp://" 
"rtspu://" "service:" "sftp://"; "sip:" "sips:" "smb://" "sms:" "snmp://" 
"soap.beep://" "soap.beeps://" "ssh://" "svn://" "svn+ssh://" "tag:" "tel:" 
"telnet://" "tftp://"; "tip://" "tn3270://" "udp://" "urn:" "uuid:" "vemmi://" 
"webcal://" "xri://" "xmlrpc.beep://" "xmlrpc.beeps://" "z39.50r://" 
"z39.50s://" "xmpp:" "fax:" "man:" "mms://" "mmsh://" "modem:" "prospero:" 
"snews:"; "wais://")

Additional URIs can be added to the list to be recognized, that is great now.

Then report displayed on screen may be hyperlinked to subscribe or
chat with user on XMPP instant messaging application `jabber.el' by
simple clicking on:

Joe Doe's XMPP: xmpp:joe@example.com
                ^^^^^^^^^^^^^^^^^^^^
                 hyperlink in goto-address-mode

That hyperlink is much better readable and so much less confusing then this:

Joe Doe's XMPP: [[xmpp:joe@example.com][xmpp:joe@example.com]]

There is tel: URI and that means I can display

Joe Doe:

tel:+1234567890 and automatically initiate the call or send SMS
without thinking of Org formatting.

goto-address-mode is providing hyperlinks on meta level.

In general I am interested to enhance goto-address-mode with various
handlers. Lars already explained in one of bugs or enhancements
reported that he now adapted `browse-url' function to be used with
with `browse-url-handlers'. That now becomes easily customizable and
enhances Emacs to any kind of hyperlinks as above stated.

If I set `browse-url-handlers' to (("gopher:" . elpher-handler-go))

and if I have this:

(defun elpher-handler-go (&rest arg)
  (elpher-go (car arg)))

then this should become hyperlink that can be activated:
gopher://gopher.superglobalmegacorp.com:70/11/install/386BSD/386bsd-0.0/other/GNU/emacs

Org hyperlinks are not really suitable for any mode, they are
specifically not readable unless user has the Org mode. Thos

Additionally one can define more of custom URIs within:
thing-at-point-uri-schemes and by doing that get anything to be
hyperlinked in all modes of Emacs for as long as they enable
goto-address-mode

With that new enhancement and customization all of the above URIs
can appear as hyperlinks automatically in any kind of editing
modes.




reply via email to

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