Gnus development mailing list
 help / color / mirror / Atom feed
From: Katsumi Yamaoka <yamaoka@jpl.org>
To: ding@gnus.org
Subject: Re: advising gnus-summary-resend-message, the clean way
Date: Tue, 08 Nov 2011 08:18:08 +0900	[thread overview]
Message-ID: <b4maa87ldxr.fsf@jpl.org> (raw)
In-Reply-To: <871utj8uqj.fsf@micropit.couberia.bzh>

Peter Münster wrote:
> I want to use bbdb completion, even in the mini-buffer, so my first
> idea[1] was, to advise gnus-summary-resend-message:

> (defadvice gnus-summary-resend-message (around pm/resend-with-bbdb activate)
>   "Resend message with bbdb address completion."
>   (flet ((message-read-from-minibuffer (p &optional d)
>                                        (bbdb-completing-read-mails p d)))
>     ad-do-it))

> But it does not work, I think it's because
> `message-read-from-minibuffer' is called from the `interactive' form.
[...]

In advice.el there are some examples to tweak the interactive form.
Maybe this is what you want:

(defadvice gnus-summary-resend-message (before pm/resend-with-bbdb activate)
  "Resend message with bbdb address completion."
  (interactive
   (list (bbdb-completing-read-mails
	  "Resend message(s) to: "
	  (when (and gnus-summary-resend-default-address
		     (gnus-buffer-live-p gnus-original-article-buffer))
	    (with-current-buffer gnus-original-article-buffer
	      (nnmail-fetch-field "to"))))
	 current-prefix-arg)))

This shows advised function definition w/o byte-compilation.

(let ((ad-default-compilation-action 'never))
  (defadvice gnus-summary-resend-message ...FORMS...)
  (pp (symbol-function 'gnus-summary-resend-message))
  nil)



      reply	other threads:[~2011-11-07 23:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-07 21:53 Peter Münster
2011-11-07 23:18 ` Katsumi Yamaoka [this message]

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=b4maa87ldxr.fsf@jpl.org \
    --to=yamaoka@jpl.org \
    --cc=ding@gnus.org \
    /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).