[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
buffer:// under home directory
- From: Kevin Ryde <user42@xxxxxxxxxx>
- Date: Mon, 20 May 2013 10:07:35 +1000
- X-ml-name: emacs-w3m
- X-mail-count: 12018
With recent debian i386 emacs 24.3 and the current cvs w3m, if you have
(Ba file foo.html in your home directory then
(B M-x find-file ~/foo.html # into buffer foo.html
(B M-x w3m-browse-url buffer://foo.html
(B Cannot retrieve URL: file://~/foo.html
(Bdefault-directory starts with a "~" when under the home directory which
(Bit seems is no good for file://.
(BAn expand-file-name per below does the trick. But then I wondered if
(B (buffer-file-name (get-buffer ...))
(Bwould help if the buffer name isn't the filename, eg. foo.html<2>.
(BIs buffer:// a documented feature? I suppose it could do something like
(Bw3m-region to take the buffer content instead of the file content in
(Bcase you haven't saved, or for a non-file buffer. But perhaps it's not
(Bthat sophisticated yet.
(BI struck this when tinkering with a way to have w3m preview html while
(Bediting, and perhaps rendering buffers like a tar file member if
(Bbrowsing source archive etc. I made a copy to a temp file, but that
(Bloses the current directory for relative links. Perhaps there's
(Bsomething better already which I don't know.
--- w3m.el.~1.1599.~ 2013-04-06 07:20:42.000000000 +1100
(B+++ w3m.el 2013-05-20 09:23:39.000000000 +1000
(B@@ -9417,7 +9417,7 @@
(B (w3m-search-name-anchor fragment-part))
(B ((not (string= file-part ""))
(B (w3m-goto-url (w3m-expand-url (substring url (match-beginning 4))
(B- (concat "file://" default-directory))
(B+ (concat "file://" (expand-file-name default-directory)))
(B reload charset post-data referer handler element))
(B (t (w3m-message "No URL at point")))))
(B ((w3m-url-valid url)
(BIt's a long way to the shop if you want a sausage roll.