Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Louis <usenet26@ossh.com>
Subject: Re: Using emacs-w3m to use for links in emails
Date: Wed, 19 Nov 2003 20:31:51 GMT	[thread overview]
Message-ID: <hhptfodrhm.fsf@ossh.com> (raw)
In-Reply-To: <m3brr8jes9.fsf@home.tcob1.net>

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


           reply	other threads:[~2003-11-19 20:31 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <m3brr8jes9.fsf@home.tcob1.net>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=hhptfodrhm.fsf@ossh.com \
    --to=usenet26@ossh.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).