Sam Cramer | 21 May 18:58
Picon

customizing the MH-Show buffer -- 2 questions

I've got two questions regarding customization of the MH-Show buffer.

1) When I receive a multi-part message with text/plain and text/html
parts, a button is shown only for the text/html part.  Is there a way to
have a button shown for the text/plain part too?

2) I'm using w3m to display text/html parts; of the various options
(lynx etc.) it seems to do the best job of rendering HTML.  However, I
can't copy or follow an embedded link.  Does anyone have a solution for
this problem?

Thanks,
Sam

Satyaki Das | 21 May 19:39
Face
Picon
Favicon

Re: customizing the MH-Show buffer -- 2 questions

Sam Cramer <cramer <at> netapp.com> writes:

> I've got two questions regarding customization of the MH-Show buffer.
> 
> 1) When I receive a multi-part message with text/plain and text/html
> parts, a button is shown only for the text/html part.  Is there a way to
> have a button shown for the text/plain part too?

Are you asking about multipart/alternative? Right now MH-E just
displays the preferred part and doesn't show the other
alternatives. If there is a multipart message, we should be
displaying all parts.

I can think of cases where it would be nice to be able to have
buttons for the alternatives. For instance the type that you
usually prefer might be garbled. May be you should add a feature
request for this.

> 2) I'm using w3m to display text/html parts; of the various options
> (lynx etc.) it seems to do the best job of rendering HTML.  However, I
> can't copy or follow an embedded link.  Does anyone have a solution for
> this problem?

If you are using w3m you could define the following function in
your .emacs and bind it to a suitable key. However this only works
for w3m -- I suspect one could write similar functions for the
other renderers.

(defun mh-follow-w3m-link (link)
  "Follow LINK at point."
(Continue reading)

Sam Cramer | 21 May 20:01
Picon

Re: customizing the MH-Show buffer -- 2 questions

Satyaki Das <satyakid <at> stanford.edu> wrote:

> Sam Cramer <cramer <at> netapp.com> writes:
> 
> > parts, a button is shown only for the text/html part.  Is there a way to
> > have a button shown for the text/plain part too?
> 
> Are you asking about multipart/alternative? Right now MH-E just
> displays the preferred part and doesn't show the other
> alternatives. If there is a multipart message, we should be
> displaying all parts.
> 
> I can think of cases where it would be nice to be able to have
> buttons for the alternatives. For instance the type that you
> usually prefer might be garbled. May be you should add a feature
> request for this.

Yes, I'm asking about multipart/alternative.  I will submit a feature
request.

> > 2) I'm using w3m to display text/html parts; of the various options
> > (lynx etc.) it seems to do the best job of rendering HTML.  However, I
> > can't copy or follow an embedded link.  Does anyone have a solution for
> > this problem?
> 
> If you are using w3m you could define the following function in
> your .emacs and bind it to a suitable key. However this only works
> for w3m -- I suspect one could write similar functions for the
> other renderers.
> 
(Continue reading)

Sam Cramer | 22 May 02:44
Picon

annoying behavior when incorporating mail

When I incorporate new mail, point jumps to a previously read message.
Has anyone else seen this?  Is there something I can do to help debug
the problem?

Thanks,
Sam

Satyaki Das | 22 May 03:14
Face
Picon
Favicon

Re: annoying behavior when incorporating mail

Sam Cramer <cramer <at> netapp.com> writes:

> When I incorporate new mail, point jumps to a previously read message.
> Has anyone else seen this?

I haven't seen this. For me, the first new message becomes cur.

>                             Is there something I can do to help debug
> the problem?

Steps to replicate the problem, starting with "emacs -q" might
help.

Satyaki

Win Treese | 22 May 06:09
Picon
Favicon

Re: customizing the MH-Show buffer -- 2 questions

Satyaki wrote:

> If you are using w3m you could define the following function in
> your .emacs and bind it to a suitable key. However this only works
> for w3m -- I suspect one could write similar functions for the
> other renderers.
> 
> (defun mh-follow-w3m-link (link)
>   "Follow LINK at point."
>   (interactive (list (get-text-property (point) 'w3m-href-anchor)))
>   (if link
>       (browse-url link)
>     (error "No w3m hyperlink at point")))

I wrote a slightly different one:

(defun my-w3m-browse-url-externally (&optional arg)
  "Browse a URL from a w3m buffer in an external browser, as browse-url does."
  (interactive)
  (let ((url (and (functionp 'w3m-anchor) (w3m-anchor))))
    (if url
	(browse-url url)
      (browse-url-at-point))))

which uses browse-url-at-point to grab the URL if w3m isn't rendering it
as a link. 

Win Treese

(Continue reading)

Satyaki Das | 22 May 06:26
Face
Picon
Favicon

Re: customizing the MH-Show buffer -- 2 questions

Win Treese <treese <at> acm.org> writes:

> I wrote a slightly different one:
> 
> (defun my-w3m-browse-url-externally (&optional arg)
>   "Browse a URL from a w3m buffer in an external browser, as browse-url does."
>   (interactive)
>   (let ((url (and (functionp 'w3m-anchor) (w3m-anchor))))
>     (if url
> 	(browse-url url)
>       (browse-url-at-point))))

Neat idea. However I think it is preferable to use 
   (fboundp 'w3m-anchor)
in the above function instead of
   (functionp 'w3m-anchor)
On my Emacs the latter always returns nil.

I didn't know about the w3m-anchor macro, just used
text-properties-at in the show buffer to find the property that
has the URL.

For extra credit write a version that will allow you to click the
link with the mouse :-).

Satyaki

Win Treese | 22 May 07:15
Picon
Favicon

Re: customizing the MH-Show buffer -- 2 questions

> Neat idea. However I think it is preferable to use 
>    (fboundp 'w3m-anchor)
> in the above function instead of
>    (functionp 'w3m-anchor)
> On my Emacs the latter always returns nil.

That's useful to know. In case anyone was wondering, it's there for the
case where w3m isn't loaded, so you can always get the
browse-url-at-point behavior if there's a URL there.

> I didn't know about the w3m-anchor macro, just used
> text-properties-at in the show buffer to find the property that
> has the URL.

It took me a while to track it down!

> For extra credit write a version that will allow you to click the
> link with the mouse :-).

I have:

(add-hook 'mh-show-mode-hook
	  (lambda () (local-set-key [mouse-2]
	  	  'my-w3m-browse-url-externally)))

(defadvice mm-setup-w3m (after my-w3m-fix-mouse activate)
  "Change the mouse binding for w3m used with mh-e"
  (define-key w3m-minor-mode-map [mouse-2] 'my-w3m-browse-url-externally))

I couldn't find a hook for w3m that set up the mouse binding at the
(Continue reading)

Satyaki Das | 22 May 07:34
X-Face
Picon
Favicon

Re: customizing the MH-Show buffer -- 2 questions

Win Treese <treese <at> acm.org> writes:

> (add-hook 'mh-show-mode-hook
> 	  (lambda () (local-set-key [mouse-2]
> 	  	  'my-w3m-browse-url-externally)))

IIUC, this requires two clicks -- the first to put point in the
URL and the next to visit the URL. This can be done with one click
by using event-* functions. For example mh-push-button does this
(the function is more complicated than it needs to be since XEmacs
and Emacs handle mouse events differently).

> (defadvice mm-setup-w3m (after my-w3m-fix-mouse activate)
>   "Change the mouse binding for w3m used with mh-e"
>   (define-key w3m-minor-mode-map [mouse-2] 'my-w3m-browse-url-externally))
> 
> I couldn't find a hook for w3m that set up the mouse binding at the
> right point, so I just advise a function that gets called after w3m is
> done messing with keybindings. It's ugly, but it seems to work for me.

Good idea. I like defadvice :-). But sometimes they cause tricky
debugging problems, when you forget that a function has been
advised and the function definition you are looking at is not what
is being used. This has happened to me a couple of times.

Satyaki

Peter Davis | 22 May 17:20

Some questions ...

I've been dabbling with MH-E for a while, along with several other mail
tools that operate on MH folder (mutt, MH, Sylpheed-Claws, etc.)  I'm
now thinking of trying to use MH-E more, but I have some key questions I
can't seem to find answers to.

1) Is there some currently documentation somewhere?  Everything I've
found (on-line, info files, etc.) seems to be at V5 or 6 level, and I'm
using 7.2.

2) How can I set the "From:" in my outgoing mail?  Right now, it's
coming out with an invalid address (which is why I didn't use it for
this message.)

3) I use a Perl script to fetch my mail and pre-sort it into different
folders.  This uses rcvstore, so the .mh_sequences file in each folders
gets updated correctly.  Is there a way in MH-E to find out which
folders contain new messages?  New messages get put into about 20
folders out of several hundred on my system, so I don't want to have to
check all 20 to figure out which ones have new mail.

Thanks very much!

-pd

--

-- 
--------
                             Peter Davis
               Funny stuff at http://www.pfdstudio.com
                 The artwork formerly shown as prints
    List of resources for children's writers and illustrators at:
(Continue reading)


Gmane