From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.devel Subject: [solved] - Re: Any way to tell Emacs how to open specific URIs? Date: Fri, 27 Nov 2020 18:41:52 +0300 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22554"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.0 (3d08634) (2020-11-07) Cc: Emacs Devel To: =?utf-8?B?6ZmI5b+X5Lyf?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 27 16:52:58 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kig3O-0005mZ-93 for ged-emacs-devel@m.gmane-mx.org; Fri, 27 Nov 2020 16:52:58 +0100 Original-Received: from localhost ([::1]:59288 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kig3N-0003Dr-93 for ged-emacs-devel@m.gmane-mx.org; Fri, 27 Nov 2020 10:52:57 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50716) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kifvu-00053d-OO for emacs-devel@gnu.org; Fri, 27 Nov 2020 10:45:14 -0500 Original-Received: from static.rcdrun.com ([95.85.24.50]:35471) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kifvs-0006x1-JN for emacs-devel@gnu.org; Fri, 27 Nov 2020 10:45:14 -0500 Original-Received: from localhost ([::ffff:197.157.0.29]) (AUTH: PLAIN admin, TLS: TLS1.2,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by static.rcdrun.com with ESMTPSA id 00000000002C0007.000000005FC11F05.000019B2; Fri, 27 Nov 2020 15:45:09 +0000 Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=95.85.24.50; envelope-from=bugs@gnu.support; helo=static.rcdrun.com X-Spam_score_int: -3 X-Spam_score: -0.4 X-Spam_bar: / X-Spam_report: (-0.4 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_SORBS_WEB=1.5, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, WEIRD_PORT=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:259903 Archived-At: * 陈志伟 [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.