unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How to render html buffer in emacs?
@ 2007-11-23 18:45 Hallvard B Furuseth
  2007-11-24  3:32 ` Tim X
  0 siblings, 1 reply; 7+ messages in thread
From: Hallvard B Furuseth @ 2007-11-23 18:45 UTC (permalink / raw)
  To: help-gnu-emacs

How do I get Emacs to render a HTML buffer (as a web page, not as html
source)?  I've been looking a bit at the w3m doc, but it has hopeless
chapter names and only lists how to use it with some specific apps
(gnus, mail readers, etc).

-- 
Hallvard

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to render html buffer in emacs?
  2007-11-23 18:45 How to render html buffer in emacs? Hallvard B Furuseth
@ 2007-11-24  3:32 ` Tim X
  2007-11-24 13:14   ` William Xu
                     ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Tim X @ 2007-11-24  3:32 UTC (permalink / raw)
  To: help-gnu-emacs

Hallvard B Furuseth <h.b.furuseth@usit.uio.no> writes:

> How do I get Emacs to render a HTML buffer (as a web page, not as html
> source)?  I've been looking a bit at the w3m doc, but it has hopeless
> chapter names and only lists how to use it with some specific apps
> (gnus, mail readers, etc).
>

The easiest way to do this is to use the browse-url package. 

,----[ C-h f browse-url-of-file RET ]
| browse-url-of-file is an interactive compiled Lisp function in `browse-url.el'.
| (browse-url-of-file &optional FILE)
| 
| Ask a WWW browser to display FILE.
| Display the current buffer's file if FILE is nil or if called
| interactively.  Turn the filename into a URL with function
| `browse-url-file-url'.  Pass the URL to a browser using the
| `browse-url' function then run `browse-url-of-file-hook'.
| 
| [back]
`----

,----[ C-h f browse-url-of-dired-file RET ]
| browse-url-of-dired-file is an interactive compiled Lisp function in `browse-url.el'.
| (browse-url-of-dired-file)
| 
| In Dired, ask a WWW browser to display the file named on this line.
| 
| [back]
`----

etc.

tim

-- 
tcross (at) rapttech dot com dot au

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to render html buffer in emacs?
  2007-11-24  3:32 ` Tim X
@ 2007-11-24 13:14   ` William Xu
  2007-11-24 17:50   ` reader
       [not found]   ` <mailman.4034.1195926644.18990.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 7+ messages in thread
From: William Xu @ 2007-11-24 13:14 UTC (permalink / raw)
  To: help-gnu-emacs

Tim X <timx@nospam.dev.null> writes:

> Hallvard B Furuseth <h.b.furuseth@usit.uio.no> writes:
>
>> How do I get Emacs to render a HTML buffer (as a web page, not as html
>> source)?  I've been looking a bit at the w3m doc, but it has hopeless
>> chapter names and only lists how to use it with some specific apps
>> (gnus, mail readers, etc).
>>
>
> The easiest way to do this is to use the browse-url package. 
>
> ,----[ C-h f browse-url-of-file RET ]

[...]

> ,----[ C-h f browse-url-of-dired-file RET ]

[...]

Or, browse-url-of-buffer

-- 
William

http://williamxu.net9.org

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to render html buffer in emacs?
  2007-11-24  3:32 ` Tim X
  2007-11-24 13:14   ` William Xu
@ 2007-11-24 17:50   ` reader
  2007-11-25 22:48     ` Bastien
       [not found]   ` <mailman.4034.1195926644.18990.help-gnu-emacs@gnu.org>
  2 siblings, 1 reply; 7+ messages in thread
From: reader @ 2007-11-24 17:50 UTC (permalink / raw)
  To: help-gnu-emacs

Tim X <timx@nospam.dev.null> writes:

> Hallvard B Furuseth <h.b.furuseth@usit.uio.no> writes:
>
>> How do I get Emacs to render a HTML buffer (as a web page, not as html
>> source)?  I've been looking a bit at the w3m doc, but it has hopeless
>> chapter names and only lists how to use it with some specific apps
>> (gnus, mail readers, etc).
>>
>
> The easiest way to do this is to use the browse-url package. 
>
> ,----[ C-h f browse-url-of-file RET ]
> | browse-url-of-file is an interactive compiled Lisp function in `browse-url.el'.
> | (browse-url-of-file &optional FILE)
> | 
> | Ask a WWW browser to display FILE.
> | Display the current buffer's file if FILE is nil or if called
> | interactively.  Turn the filename into a URL with function
> | `browse-url-file-url'.  Pass the URL to a browser using the
> | `browse-url' function then run `browse-url-of-file-hook'.
> | 
> | [back]
> `----
>
> ,----[ C-h f browse-url-of-dired-file RET ]
> | browse-url-of-dired-file is an interactive compiled Lisp function in `browse-url.el'.
> | (browse-url-of-dired-file)
> | 
> | In Dired, ask a WWW browser to display the file named on this line.
> | 
> | [back]
> `----

Sorry to butt in but: 
browse-url-of-file doesn't work here.. it gives this error
   browse-url: Wrong type argument: listp, w3m-browse-url

Which appears to mean my settings for w3m are interfering but not sure
what to do about it.  I'm not sure what all they are even but
I see:
  browse-url-browser-function is a variable defined in `browse-url.el'.
Its value is browse-url-firefox

So what do I need to do to have browse-url-of-file call firefox?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to render html buffer in emacs?
       [not found]   ` <mailman.4034.1195926644.18990.help-gnu-emacs@gnu.org>
@ 2007-11-25  5:22     ` Tim X
  0 siblings, 0 replies; 7+ messages in thread
From: Tim X @ 2007-11-25  5:22 UTC (permalink / raw)
  To: help-gnu-emacs

reader@newsguy.com writes:

> Subject: Re: How to render html buffer in emacs?
>
> Tim X <timx@nospam.dev.null> writes:
>
>> Hallvard B Furuseth <h.b.furuseth@usit.uio.no> writes:
>>
>>> How do I get Emacs to render a HTML buffer (as a web page, not as html
>>> source)?  I've been looking a bit at the w3m doc, but it has hopeless
>>> chapter names and only lists how to use it with some specific apps
>>> (gnus, mail readers, etc).
>>>
>>
>> The easiest way to do this is to use the browse-url package. 
>>
>> ,----[ C-h f browse-url-of-file RET ]
>> | browse-url-of-file is an interactive compiled Lisp function in `browse-url.el'.
>> | (browse-url-of-file &optional FILE)
>> | 
>> | Ask a WWW browser to display FILE.
>> | Display the current buffer's file if FILE is nil or if called
>> | interactively.  Turn the filename into a URL with function
>> | `browse-url-file-url'.  Pass the URL to a browser using the
>> | `browse-url' function then run `browse-url-of-file-hook'.
>> | 
>> | [back]
>> `----
>>
>> ,----[ C-h f browse-url-of-dired-file RET ]
>> | browse-url-of-dired-file is an interactive compiled Lisp function in `browse-url.el'.
>> | (browse-url-of-dired-file)
>> | 
>> | In Dired, ask a WWW browser to display the file named on this line.
>> | 
>> | [back]
>> `----
>
> Sorry to butt in but: 
> browse-url-of-file doesn't work here.. it gives this error
>    browse-url: Wrong type argument: listp, w3m-browse-url
>
> Which appears to mean my settings for w3m are interfering but not sure
> what to do about it.  I'm not sure what all they are even but
> I see:
>   browse-url-browser-function is a variable defined in `browse-url.el'.
> Its value is browse-url-firefox
>

You need to configure browse-url and tell it your preferred/default browser
is firefox. Best way to to this is through the customize mechanism. Do a

M-x customize-group <ret> browse-url

to get a list of what can be customized - its pretty straight-forward. 

Note that the error you get is telling you that emacs was expecting a list
and got instead a symbol/function name. Not sure where you have set that,
but you probably need to remove it and just use customize. One of the
advantages of customize is that it will often protect you from simple
errors like this by only allowing you to set things in the correct
format. Not sure where you have something ot of place without seeing a
backtrace, but check the variable browse-url-browser-function as a
start. Mine has 

,----[ C-h v browse-url-browser-function RET ]
| browse-url-browser-function is a variable defined in `browse-url.el'.
| Its value is w3m-browse-url
| 
| 
| Documentation:
| Function to display the current buffer in a WWW browser.
| This is used by the `browse-url-at-point', `browse-url-at-mouse', and
| `browse-url-of-file' commands.
| 
| If the value is not a function it should be a list of pairs
| (REGEXP . FUNCTION).  In this case the function called will be the one
| associated with the first REGEXP which matches the current URL.  The
| function is passed the URL and any other args of `browse-url'.  The last
| regexp should probably be "." to specify a default browser.
| 
| You can customize this variable.
| 
| [back]
`----

My relevant lines from the customize section in my .emacs are

 '(browse-url-browser-function (quote w3m-browse-url))

Tim

-- 
tcross (at) rapttech dot com dot au

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to render html buffer in emacs?
  2007-11-24 17:50   ` reader
@ 2007-11-25 22:48     ` Bastien
  2007-11-25 23:35       ` Lennart Borgman (gmail)
  0 siblings, 1 reply; 7+ messages in thread
From: Bastien @ 2007-11-25 22:48 UTC (permalink / raw)
  To: help-gnu-emacs

reader@newsguy.com writes:

> Sorry to butt in but: 
> browse-url-of-file doesn't work here.. it gives this error
>    browse-url: Wrong type argument: listp, w3m-browse-url

It looks like your configuration wants to use w3m and it is not loaded:

  (setq browse-url-browser-function 'w3m-browse-url)
  (autoload 'w3m-browse-url "w3m" "Ask emacs-w3m to show a URL." t)

Or if you want to use firefox instead:

  (setq browse-url-browser-function 'browse-url-firefox)

HTH,

-- 
Bastien

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to render html buffer in emacs?
  2007-11-25 22:48     ` Bastien
@ 2007-11-25 23:35       ` Lennart Borgman (gmail)
  0 siblings, 0 replies; 7+ messages in thread
From: Lennart Borgman (gmail) @ 2007-11-25 23:35 UTC (permalink / raw)
  To: help-gnu-emacs

Maybe I ought to mention that in nXhtml there is are several menu 
entries for viewing the file you are editing (for local file, for 
uploaded file etc).

This can actually be used to view also uploaded php/eruby/django etc 
files with your web browser.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-11-25 23:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-23 18:45 How to render html buffer in emacs? Hallvard B Furuseth
2007-11-24  3:32 ` Tim X
2007-11-24 13:14   ` William Xu
2007-11-24 17:50   ` reader
2007-11-25 22:48     ` Bastien
2007-11-25 23:35       ` Lennart Borgman (gmail)
     [not found]   ` <mailman.4034.1195926644.18990.help-gnu-emacs@gnu.org>
2007-11-25  5:22     ` Tim X

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).