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

Re: w3m-find-file



>>>>> In [emacs-w3m : No.08908] Andreas Roehler wrote:

> quite often I want to use w3m as a viewer of an already
> current html-buffer.

> The way I do that now is `M-x w3m-find-file' which
> prompts me to the default-directory.

> That's not bad, however, I think it could do better:

> deliver the current buffer with this prompt, in order
> to enable RET to view it.

> May be I miss something.

> If not, it wouldn't be a big thing to change
> `w3m-find-file' appropriately, would try a proposal.

The name of the command looks inappropriate to use for *buffer*.
There is already the command `w3m-region', that you can use for
the current buffer as follows:

M-<
C-SPC or C-@
M->
M-x w3m-region RET

As many commands `FOO-region' have friends `FOO-buffer' (e.g,,
`ispell-region' and `ispell-buffer'), we may provide the command
`w3m-buffer'.  Does it meet your wish?

(defun w3m-buffer (&optional url charset)
  "Render the current buffer.
See `w3m-region' for the optional arguments."
  (interactive (list (w3m-expand-file-name-as-url (or (buffer-file-name)
						      default-directory))))
  (w3m-region (point-min) (point-max) url charset))

Regards,