From: bojohan+news@dd.chalmers.se (Johan Bockgård)
To: emacs-devel@gnu.org
Subject: Re: browse-url and "non-webish" URLs
Date: Wed, 22 Aug 2007 19:17:36 +0200 [thread overview]
Message-ID: <yoij3aybh4jz.fsf@gamma02.me.chalmers.se> (raw)
In-Reply-To: jwvzm0jip9k.fsf-monnier+emacs@gnu.org
Stefan Monnier <monnier@IRO.UMontreal.CA> 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
next prev parent reply other threads:[~2007-08-22 17:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-22 15:11 browse-url and "non-webish" URLs Stefan Monnier
2007-08-22 17:17 ` Johan Bockgård [this message]
2007-08-22 18:39 ` Stefan Monnier
2007-08-22 18:52 ` Stefan Monnier
2007-08-23 14:41 ` Johan Bockgård
2007-08-23 17:34 ` Stefan Monnier
2007-08-23 21:18 ` Johan Bockgård
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=yoij3aybh4jz.fsf@gamma02.me.chalmers.se \
--to=bojohan+news@dd.chalmers.se \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.