Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

w3m-mode and images

33 views
Skip to first unread message

Raymond Scholz

unread,
Jun 30, 2001, 6:13:05 PM6/30/01
to
Hi!

I just discovered w3m-mode (version 1.0). How do I display images
with an external viewer (like xv)? This is my current setup:

(autoload 'w3m "w3m" "Interface for w3m on Emacs." t)
(setq w3m-coding-system 'iso-8859-1
w3m-input-coding-system 'iso-8859-1
w3m-output-coding-system 'iso-8859-1
w3m-arrived-file-coding-system 'iso-8859-1
w3m-mailto-url-function 'compose-mail
w3m-default-save-directory "~/tmp/down/")

Saying `I' on an image (<IMG SRC="..."> or <A HREF="..."> makes no
difference) offers me to save the image.

There is a variable called `w3m-display-inline-image' but setting it
to `t' doesn't make any difference. Perhaps this setting does only
make sense for XEmacs and Emacs 21.

Cheers, Ray
--
"I heard if you play the NT-4.0-CD backwards, you get a satanic message."
"Thats nothing, if you play it forward, it installs NT-4.0"

Dirk Meyer

unread,
Jul 17, 2001, 4:29:18 AM7/17/01
to
Raymond Scholz wrote:
> There is a variable called `w3m-display-inline-image' but setting it
> to `t' doesn't make any difference. Perhaps this setting does only
> make sense for XEmacs and Emacs 21.

Yes, with Emacs 21 you will get inline images -- very nice. w3m.el is
a nice browser, how can I use this mode in Gnus for rendering
html-Mails?


Dirk

--
A morning without coffee is like something without something else.

Kai Großjohann

unread,
Jul 17, 2001, 5:49:27 AM7/17/01
to
On 17 Jul 2001, Dirk Meyer wrote:

> Yes, with Emacs 21 you will get inline images -- very nice. w3m.el
> is a nice browser, how can I use this mode in Gnus for rendering
> html-Mails?

Various variables might have to be looked at. See mailcap-mime-data
and the output of M-x apropos RET ^mm.*inlin RET

kai
--
~/.signature: No such file or directory

Faux_Pseudo

unread,
Jul 17, 2001, 6:25:14 AM7/17/01
to
--(Once apon a time, in gnu.emacs.help,)--
--(Dirk Meyer said it like only they can.)--

> Raymond Scholz wrote:
> > There is a variable called `w3m-display-inline-image' but setting it
> > to `t' doesn't make any difference. Perhaps this setting does only
> > make sense for XEmacs and Emacs 21.
>
> Yes, with Emacs 21 you will get inline images -- very nice. w3m.el is
> a nice browser, how can I use this mode in Gnus for rendering
> html-Mails?
>

How will this work for the console?
Will it try to launch an external viewer much like links or w3m does?
/me has visions of a framebufferd gnuemacs graphical w3 browser
floating in his head.
/me smackes himself upside the head

--
--(tt...@faux.local|04:45|/home/faux)-- cat .sig
GUI's are for slackers. Get ibpconf.sh 6.1 on freshmeat.net
--(tt...@faux.local|04:45|/home/faux)-- export UIN=66618055

It's a damn poor mind that can only think of one way to spell a word.
- Andrew Jackson

John Wiegley

unread,
Jul 17, 2001, 1:05:51 PM7/17/01
to

>>>>> On Tue Jul 17, Dirk writes:

> Yes, with Emacs 21 you will get inline images -- very nice. w3m.el
> is a nice browser, how can I use this mode in Gnus for rendering
> html-Mails?

Add this to your .gnus file:

(defadvice mm-inline-text (around use-w3m-instead (handle) activate)
(let ((type (mm-handle-media-subtype handle)))
(if (not (equal type "html"))
ad-do-it
(let ((text (mm-get-part handle))
(b (point)))
(save-excursion
(insert text)
(save-restriction
(narrow-to-region b (point))
(goto-char (point-min))
(w3m-region (point-min) (point-max)))
(mm-handle-set-undisplayer
handle
`(lambda ()
(let (buffer-read-only)
(if (functionp 'remove-specifier)
(mapcar (lambda (prop)
(remove-specifier
(face-property 'default prop)
(current-buffer)))
'(background background-pixmap foreground)))
(delete-region ,(point-min-marker)
,(point-max-marker))))))))))

Mike Woolley

unread,
Jul 18, 2001, 8:48:51 AM7/18/01
to
John Wiegley <jo...@gnu.org> writes:

> >>>>> On Tue Jul 17, Dirk writes:
>
> > Yes, with Emacs 21 you will get inline images -- very nice. w3m.el
> > is a nice browser, how can I use this mode in Gnus for rendering
> > html-Mails?
>
> Add this to your .gnus file:
>
> (defadvice mm-inline-text (around use-w3m-instead (handle) activate)

> ...

Wow, that works great - much better and faster than W3!

The only problem is that it does nothing when you mouse-2 on links
(although they are still highlighted).
Is there any way of getting it to invoke browse-url (or equivalent)?

Cheers,
Mike

those who know me have no need of my name

unread,
Jul 18, 2001, 1:22:11 PM7/18/01
to
<ug0buh...@ariel.co.uk> divulged:

>The only problem is that it does nothing when you mouse-2 on links
>(although they are still highlighted).
>Is there any way of getting it to invoke browse-url (or equivalent)?

isn't w3m-mode just w3m running in a term-mode buffer? if so it's unlikely
that you can invoke emacs functions, though you might be able to convince
w3m to use the mouse itself.

--
okay, have a sig then

Hannu Koivisto

unread,
Jul 18, 2001, 3:23:53 PM7/18/01
to
those who know me have no need of my name <not-a-rea...@usa.net> writes:

| <ug0buh...@ariel.co.uk> divulged:
|
| >The only problem is that it does nothing when you mouse-2 on links
| >(although they are still highlighted).
| >Is there any way of getting it to invoke browse-url (or equivalent)?
|
| isn't w3m-mode just w3m running in a term-mode buffer? if so it's unlikely

Definitely not. I'm sure John's emacs-w3m washing could be
modified (well, actually it is emacs-w3m's rendering code that has
to be modified/augmented/adviced/whateva) to do the same thing the
default W3 washing does, but I don't really have any need to read
HTML mails so I won't be doing that :)

--
Hannu

gr...@visiontech-dml.com

unread,
Jul 19, 2001, 3:59:19 AM7/19/01
to
Mike Woolley (mi...@ariel.co.uk) writes:

> John Wiegley <jo...@gnu.org> writes:
>
> > Add this to your .gnus file:
> >
> > (defadvice mm-inline-text (around use-w3m-instead (handle) activate)
> > ...
>
> Wow, that works great - much better and faster than W3!
>

> The only problem is that it does nothing when you mouse-2 on links
> (although they are still highlighted).
> Is there any way of getting it to invoke browse-url (or equivalent)?


try this.

(defvar gnus-w3m-minor-mode nil)

(make-variable-buffer-local 'gnus-w3m-minor-mode)
(add-to-list 'minor-mode-alist '(gnus-w3m-minor-mode " w3m"))
(add-to-list 'minor-mode-map-alist (cons 'gnus-w3m-minor-mode w3m-mode-map))

(defadvice mm-inline-text (around use-w3m-instead (handle) activate)

(let ((type (mm-handle-media-subtype handle)))
(if (not (equal type "html"))
ad-do-it
(let ((text (mm-get-part handle))
(b (point)))
(save-excursion
(insert text)
(save-restriction
(narrow-to-region b (point))
(goto-char (point-min))
(w3m-region (point-min) (point-max))

+ (setq gnus-w3m-minor-mode t))


(mm-handle-set-undisplayer
handle
`(lambda ()
(let (buffer-read-only)

+ (setq gnus-w3m-minor-mode nil)

Mike Woolley

unread,
Jul 20, 2001, 5:28:47 AM7/20/01
to
gr...@visiontech-dml.com writes:

> Mike Woolley (mi...@ariel.co.uk) writes:
>
> > John Wiegley <jo...@gnu.org> writes:
> >
> > > Add this to your .gnus file:
> > >
> > > (defadvice mm-inline-text (around use-w3m-instead (handle) activate)
> > > ...
> >
> > Wow, that works great - much better and faster than W3!
> >
> > The only problem is that it does nothing when you mouse-2 on links
> > (although they are still highlighted).
> > Is there any way of getting it to invoke browse-url (or equivalent)?
>
>
> try this.
>
> (defvar gnus-w3m-minor-mode nil)

> ...

That does what I want, thanks!

Cheers,
Mike

Jay Belanger

unread,
Jul 20, 2001, 4:57:30 PM7/20/01
to

Mike Woolley <mi...@ariel.co.uk> writes:
> gr...@visiontech-dml.com writes:
...

> > try this.
> >
> > (defvar gnus-w3m-minor-mode nil)
> > ...
>
> That does what I want, thanks!

That works great here, too.
But if I haven't started emacs-w3m before I start gnus, I get an error
complaining about w3m-region (which I can fix with
(autoload 'w3m-region "w3m") )
and about an unbound variable, w3m-mode-map.
What's the best way to handle that?

Jay

those who know me have no need of my name

unread,
Jul 20, 2001, 9:29:15 PM7/20/01
to
<m3itgn7...@vh213601.truman.edu> divulged:

>But if I haven't started emacs-w3m before I start gnus, I get an error
>complaining about w3m-region (which I can fix with
>(autoload 'w3m-region "w3m") )
>and about an unbound variable, w3m-mode-map.
>What's the best way to handle that?

as long as it's somewhere in your load-path either (load-library "w3m") or
(require 'w3m).

--
warning: i hate typing uppercase and will do my utmost to avoid it. hence
where the emacs norm is to use M-, \M-, C-, \C-, RET, SPC, i use \m-, \m-,
\c-, \c-, <ret>, and <spc>.

Jay Belanger

unread,
Jul 20, 2001, 10:54:33 PM7/20/01
to

those who know me have no need of my name <not-a-rea...@usa.net> writes:
...

> as long as it's somewhere in your load-path either (load-library "w3m") or
> (require 'w3m).

Ah, I had been loading the individual functions that I used.

Thanks!

Jay

0 new messages