Gnus development mailing list
 help / color / mirror / Atom feed
From: pmlists@free.fr (Peter Münster)
To: ding@gnus.org
Subject: advising gnus-summary-resend-message, the clean way
Date: Mon, 07 Nov 2011 22:53:40 +0100	[thread overview]
Message-ID: <871utj8uqj.fsf@micropit.couberia.bzh> (raw)

Hello,

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

--8<---------------cut here---------------start------------->8---
(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))
--8<---------------cut here---------------end--------------->8---

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

Redefining `message-read-from-minibuffer' works well:

--8<---------------cut here---------------start------------->8---
(defun message-read-from-minibuffer (prompt &optional initial-contents)
  (bbdb-completing-read-mails prompt initial-contents))
--8<---------------cut here---------------end--------------->8---

But it does not seem clean to me: when there will be other usages of
message-read-from-minibuffer in future gnus versions, this redefinition
could break things.

For now, it works for me, but I would like to know, how it should be
done the clean way.

[1]: Eric Abrahamsen gave me some hints.

-- 
           Peter




             reply	other threads:[~2011-11-07 21:53 UTC|newest]

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

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=871utj8uqj.fsf@micropit.couberia.bzh \
    --to=pmlists@free.fr \
    --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).