unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* render *html -  via lynx ?
@ 2008-09-03 14:23 Unknown
  2008-09-04  9:08 ` Tim X
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Unknown @ 2008-09-03 14:23 UTC (permalink / raw)
  To: help-gnu-emacs

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.



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

* Re: render *html -  via lynx ?
  2008-09-03 14:23 render *html - via lynx ? Unknown
@ 2008-09-04  9:08 ` Tim X
  2008-09-04 15:02 ` Drew Adams
  2008-09-04 15:46 ` David Hansen
  2 siblings, 0 replies; 5+ messages in thread
From: Tim X @ 2008-09-04  9:08 UTC (permalink / raw)
  To: help-gnu-emacs

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


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

* RE: render *html -  via lynx ?
  2008-09-03 14:23 render *html - via lynx ? Unknown
  2008-09-04  9:08 ` Tim X
@ 2008-09-04 15:02 ` Drew Adams
  2008-09-04 16:12   ` Thierry Volpiatto
  2008-09-04 15:46 ` David Hansen
  2 siblings, 1 reply; 5+ messages in thread
From: Drew Adams @ 2008-09-04 15:02 UTC (permalink / raw)
  To: problems, help-gnu-emacs

> 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 ?

I don't have a general answer for you, but on Windows, yes, you can, using
w32-browser.el:

http://www.emacswiki.org/cgi-bin/wiki/MsShellExecute#w32-browser

http://www.emacswiki.org/cgi-bin/wiki/DiredPlus#w32-browser






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

* Re: render *html -  via lynx ?
  2008-09-03 14:23 render *html - via lynx ? Unknown
  2008-09-04  9:08 ` Tim X
  2008-09-04 15:02 ` Drew Adams
@ 2008-09-04 15:46 ` David Hansen
  2 siblings, 0 replies; 5+ messages in thread
From: David Hansen @ 2008-09-04 15:46 UTC (permalink / raw)
  To: help-gnu-emacs

On Wed, 03 Sep 2008 09:23:35 -0500 Unknown <unknown@unknown.invalid> wrote:

> 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 ?

dired-x.el (part of GNU Emacs) has a feature to "guess" the right shell
command, maybe that helps.  From my ~/.emacs

(eval-after-load 'dired
  '(progn
     (require 'dired-x)
     (setq dired-guess-shell-alist-user '(("\\.avi" "mplayer ? &")
                                          ("\\.mpg" "mplayer ? &")
                                          ("\\.wmv" "mplayer ? &")))))

But for simple .html i'd suggest emacs-w3m, a very nice browser.

David





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

* Re: render *html -  via lynx ?
  2008-09-04 15:02 ` Drew Adams
@ 2008-09-04 16:12   ` Thierry Volpiatto
  0 siblings, 0 replies; 5+ messages in thread
From: Thierry Volpiatto @ 2008-09-04 16:12 UTC (permalink / raw)
  To: Drew Adams; +Cc: help-gnu-emacs

"Drew Adams" <drew.adams@oracle.com> 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 ?
>
> I don't have a general answer for you, but on Windows, yes, you can, using
> w32-browser.el:
>
> http://www.emacswiki.org/cgi-bin/wiki/MsShellExecute#w32-browser
>
> http://www.emacswiki.org/cgi-bin/wiki/DiredPlus#w32-browser

I use extview.el 
http://www.emacswiki.org/cgi-bin/emacs/extview.el
I also use this simple code to open an html file in dired with w3m:

,----
| ;; Browse html file with w3m in dired
| (defun tv-find-file-as-url ()
|   (interactive)
|   (w3m-find-file (expand-file-name (thing-at-point 'filename))))
|   
| (define-key dired-mode-map (kbd "F") 'tv-find-file-as-url)
`----

but there is other tools may be better:
http://www.emacswiki.org/cgi-bin/wiki/CategoryExternalUtilities

-- 
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France




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

end of thread, other threads:[~2008-09-04 16:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-03 14:23 render *html - via lynx ? Unknown
2008-09-04  9:08 ` Tim X
2008-09-04 15:02 ` Drew Adams
2008-09-04 16:12   ` Thierry Volpiatto
2008-09-04 15:46 ` David Hansen

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).