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: Re: Any way to tell Emacs how to open specific URIs? Date: Wed, 2 Dec 2020 20:03:31 +0300 Message-ID: References: <87lfem1ptv.fsf@gnu.org> <87wny52qrf.fsf@gnu.org> <878sah8etp.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23294"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.0 (3d08634) (2020-11-07) To: Emacs Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Dec 02 18:11:03 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 1kkVeh-0005wG-Ja for ged-emacs-devel@m.gmane-mx.org; Wed, 02 Dec 2020 18:11:03 +0100 Original-Received: from localhost ([::1]:48842 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkVeg-0004Q3-IU for ged-emacs-devel@m.gmane-mx.org; Wed, 02 Dec 2020 12:11:02 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55586) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkVdd-0003WK-K6 for emacs-devel@gnu.org; Wed, 02 Dec 2020 12:09:57 -0500 Original-Received: from static.rcdrun.com ([95.85.24.50]:37715) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkVdb-0005RV-K9 for emacs-devel@gnu.org; Wed, 02 Dec 2020 12:09:57 -0500 Original-Received: from localhost ([::ffff:197.157.0.57]) (AUTH: PLAIN admin, TLS: TLS1.2,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by static.rcdrun.com with ESMTPSA id 00000000002C0007.000000005FC7CA61.00001A8C; Wed, 02 Dec 2020 17:09:52 +0000 Content-Disposition: inline In-Reply-To: <878sah8etp.fsf@gnu.org> Received-SPF: pass client-ip=95.85.24.50; envelope-from=bugs@gnu.support; helo=static.rcdrun.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham 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:260182 Archived-At: * Tassilo Horn [2020-12-01 23:14]: > Jean Louis writes: > > Hi Jean, > > > browse-url-handler is called URLl handler but in reality it then > > handles rather URIs, not only URLs and if feature is new and still in > > development, maybe you should reconsider the naming of the variable. > > Well, in reality it not only handles URIs but any string passed to > `browse-url'. > > --8<---------------cut here---------------start------------->8--- > (setq browse-url-handlers > ;; I wanna read my lorem ipsums in text-mode. > '(("lorem ipsum" . > (lambda (text &rest _ignored) > (let ((buf (get-buffer-create "Lorem Ipsum"))) > (set-buffer buf) > (erase-buffer) > (insert text) > (text-mode) > (pop-to-buffer buf)))))) > --8<---------------cut here---------------end--------------->8--- > > Fun aside, I think the name is appropriate because > > a) it is part of browse-url.el and as such must have the browse-url > prefix anyway, > b) its main use are URLs because what else would you pass to > `browse-url'? As URI handler it is fine to invent one owns URIs. And I find it useful to make anything. I would even find more useful if there would be hyperlink system in Emacs where users could programmatically hyperlink anything by regexp and connect hyperlinks to regexps. GNU Hyperbole does similar thing but files are directory based. I am developig hypertext system, dynamic knowledge repository and thus using goto-address-mode and buttons heavily. I am not using it for URLs, I am using it for any URIs, not just URL and my use it also for such, it is easier that way than defining buttons specifically.