[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: browse-url and "non-webish" URLs
From: |
Johan Bockgård |
Subject: |
Re: browse-url and "non-webish" URLs |
Date: |
Wed, 22 Aug 2007 19:17:36 +0200 |
User-agent: |
Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux) |
Stefan Monnier <address@hidden> writes:
> I haven't had time to look into it yet, but I'd like to see the
> following in browse-url: if the URL refers to a "text file" then use
> url-insert-file-contents (or if url-handler-mode is ON, just use
> find-file-other-window).
Like
(require 'url-handlers)
(defun browse-url-emacs (url &optional new-window)
(let ((file-name-handler-alist
(cons (cons url-handler-regexp 'url-file-handler)
file-name-handler-alist)))
(if new-window
(find-file-other-window url)
(find-file url))))
(setq browse-url-browser-function
'(("\\.el\\'" . browse-url-emacs)
("." . browse-url-firefox)))
(browse-url
"http://www.emacswiki.org/cgi-bin/emacs/download/eight-puzzle.el")
--
Johan Bockgård