From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim X Newsgroups: gmane.emacs.help Subject: Re: How to render html buffer in emacs? Date: Sun, 25 Nov 2007 16:22:01 +1100 Organization: Posted via Supernews, http://www.supernews.com Message-ID: <87ve7qzypy.fsf@lion.rapttech.com.au> References: <87y7coxqqq.fsf@lion.rapttech.com.au> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1195969271 23064 80.91.229.12 (25 Nov 2007 05:41:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 25 Nov 2007 05:41:11 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Nov 25 06:41:19 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IwAF3-0003hf-Vp for geh-help-gnu-emacs@m.gmane.org; Sun, 25 Nov 2007 06:41:18 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IwAEo-0007HQ-VC for geh-help-gnu-emacs@m.gmane.org; Sun, 25 Nov 2007 00:41:02 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news1.google.com!news.glorb.com!sn-xt-sjc-04!sn-xt-sjc-08!sn-xt-sjc-09!sn-post-sjc-01!supernews.com!corp.supernews.com!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux) Cancel-Lock: sha1:8VyUwFmStdFXRh52NJtwmFNiLSU= Original-X-Complaints-To: abuse@supernews.com Original-Lines: 94 Original-Xref: shelby.stanford.edu gnu.emacs.help:154056 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:49488 Archived-At: reader@newsguy.com writes: > Subject: Re: How to render html buffer in emacs? > > Tim X writes: > >> Hallvard B Furuseth 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 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