unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Tim X <timx@nospam.dev.null>
To: help-gnu-emacs@gnu.org
Subject: Re: render *html -  via lynx ?
Date: Thu, 04 Sep 2008 19:08:52 +1000	[thread overview]
Message-ID: <87k5dsth0b.fsf@lion.rapttech.com.au> (raw)
In-Reply-To: 1220451375.291032@vasbyt.isdsl.net

problems@gmail writes:

> When I've got a dir-listing showing in an emacs window,
> I can 'mid-mouse-it' to open the text.  
> [how] Can I open it in a window depending on its type ?
> Eg. for a *.html, can I indirectly use lynx, which via:
> 'lynx -dump <filePathName>' will render it ?
>
> TIA.
>

Yep, you sure can. I've done this using defadvice. I just put a
defadvice around view-file which checks to see if the file name ends
with htm/html and if so, view it with w3m, otherwise, it just opens it
normally. Then, in dired, if I hit 'v' to view the file and its an html
file, its rendered, otherwise it is displayed as normal. 

However, there are simpler alternatives. have a look at the browse-url
package that comes wtih emacs. It has functions for browsing the file at
point, browsing the current buffer as html, browsing a file etc
etc. From memory, the source file ahs some suggestions on key bindings
that would achieve what you like. I use the more complicated solution
because I get so use to hitting v to view a file, I found I kept
forgetting to hit another key when it was an HTML file. 

the nice thing about using browse-url is taht it can be configured to
use various different browsers, including stand-alone ones like firefox
or w3m or emacs-w3m or emacs w3 or ...

You can even configure it to use different browsers depending on the
URL. So, for example, you could configure it to use a text based browser
like w3m or lynx for local files that are probably documentation and
fairly simple and use something like firefox for urls that are external
and may need javascript or a more feature rich browser. doing this gives
you fast rendering of local text oriented HTML files and the ability to
use an external browser for more complex files - all called from within emacs.

Tim


-- 
tcross (at) rapttech dot com dot au


  reply	other threads:[~2008-09-04  9:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-03 14:23 render *html - via lynx ? Unknown
2008-09-04  9:08 ` Tim X [this message]
2008-09-04 15:02 ` Drew Adams
2008-09-04 16:12   ` Thierry Volpiatto
2008-09-04 15:46 ` David Hansen

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k5dsth0b.fsf@lion.rapttech.com.au \
    --to=timx@nospam.dev.null \
    --cc=help-gnu-emacs@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.
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).