Gnus development mailing list
 help / color / mirror / Atom feed
* advising gnus-summary-resend-message, the clean way
@ 2011-11-07 21:53 Peter Münster
  2011-11-07 23:18 ` Katsumi Yamaoka
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Münster @ 2011-11-07 21:53 UTC (permalink / raw)
  To: ding

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




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-11-07 23:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-07 21:53 advising gnus-summary-resend-message, the clean way Peter Münster
2011-11-07 23:18 ` Katsumi Yamaoka

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).