emacs-devel
[Top][All Lists]
Advanced

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

Re: Any way to tell Emacs how to open specific URIs?


From: Jean Louis
Subject: Re: Any way to tell Emacs how to open specific URIs?
Date: Wed, 2 Dec 2020 20:03:31 +0300
User-agent: Mutt/2.0 (3d08634) (2020-11-07)

* Tassilo Horn <tsdh@gnu.org> [2020-12-01 23:14]:
> Jean Louis <bugs@gnu.support> 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.




reply via email to

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