Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Re: Using emacs-w3m to use for links in emails
       [not found] <m3brr8jes9.fsf@home.tcob1.net>
@ 2003-11-19 20:31 ` Louis
  0 siblings, 0 replies; only message in thread
From: Louis @ 2003-11-19 20:31 UTC (permalink / raw)


sean@tcob1.net (Sean Rima) writes:

> Hi folks
>
> I cannot get emacs-w3m to handle urls inside email, ie similar to Spamcop returns
>
> Sean

I use the following within ~/.gnus pressing <ENTER> on a URL fires up
w3m within the current buffer:

;; -- <SNIP>

(setq mm-text-html-renderer 'w3m)

(require 'w3m)
(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)
                (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))))))))))

;; -- <SNIP> --

-- 
LCC


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-11-19 20:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <m3brr8jes9.fsf@home.tcob1.net>
2003-11-19 20:31 ` Using emacs-w3m to use for links in emails Louis

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 NNTP newsgroup(s).