[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

Re: w3m mode should extend to .txt files by default



From: "Eduardo Ochs" <eduardoochs@xxxxxxxxx>
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.

(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"))

Regards,