Eduardo Ochs | 2 Dec 2008 15:42
Picon
Gravatar

[emacs-w3m:10480] Re: w3m mode should extend to .txt files by default

Is it possible to adapt that idea to force w3m to open local files
that do not end with "\\.[sx]?html?\\'" as HTML?

Here's an example: run

  cd /tmp/
  wget http://angg.twu.net/emacs.html
  cp -v ~/TH/L/emacs.html /tmp/emacs.ht
  cp -v ~/TH/L/emacs.html /tmp/emacs.txt
  wget http://www.polimetrica.com/main/list.php

  # Optional
  # (find-file "~/.w3m/")
  # (shell-command-to-string "rm -Rv ~/.w3m/")
  rm -Rv ~/.w3m/

and now (broken, but I hope this may be a step in the right
direction):

  (w3m "file:///tmp/emacs.html")
  (w3m "file:///tmp/emacs.txt")
  (w3m "file:///tmp/emacs.ht")
  (w3m "file:///tmp/list.php")
  (let ((w3m-local-find-file-regexps '(nil . "")))
    (w3m "file:///tmp/emacs.html"))
  (let ((w3m-local-find-file-regexps '(nil . "")))
    (w3m "file:///tmp/emacs.txt"))
  (let ((w3m-local-find-file-regexps '(nil . "")))
    (w3m "file:///tmp/emacs.ht"))
  (let ((w3m-local-find-file-regexps '(nil . "")))
(Continue reading)

Naohiro Aota | 2 Dec 2008 16:39
Picon

[emacs-w3m:10482] Re: w3m mode should extend to .txt files by default

From: "Eduardo Ochs" <eduardoochs <at> gmail.com>
Subject: [emacs-w3m:10480] Re: w3m mode should extend to .txt files by default
Date: Tue, 2 Dec 2008 09:42:14 -0500

> Is it possible to adapt that idea to force w3m to open local files
> that do not end with "\\.[sx]?html?\\'" as HTML?
> 
> Here's an example: run
> 
> (snip)
> 
> and now (broken, but I hope this may be a step in the right
> direction):
> 
> (snip)
> 
> In the case ".html" w3m treats it as HTML, as expected;
> in the case ".txt" w3m renders it as plain text (not good),
> in the case ".ht" I get the message
> 
>   Input emacs.ht's content type (default Download):
> 
> in the minibuffer while a temporary buffer called "*w3m-work*" is
> displayed, and when I answer "text/html" w3m renders it as HTML -
> good, but how do I skip the question? And it seems that the answer is
> cached in ~/.w3m/ in some format that I do not understand...
> and the case ".php" seems to be similar to the case ".ht"...

You mean you want open any local file as HTML? Maybe, this is what you
want.
(Continue reading)

Eduardo Ochs | 2 Dec 2008 16:53
Picon
Gravatar

[emacs-w3m:10483] Re: w3m mode should extend to .txt files by default

Perfect, thanks!
Cheers, 8-)
  Eduardo Ochs
  eduardoochs <at> gmail.com
  http://angg.twu.net/

> You mean you want open any local file as HTML? Maybe, this is what you
> want.
>
> (let ((w3m-local-find-file-regexps '(nil . ""))
>      (w3m-content-type-alist (append  w3m-content-type-alist
>                                       '(("text/html" "" nil nil)))))
>  (w3m "file:///home/naota/list.php"))


Gmane