Re: completition in mini-buffer

2011-11-07 Thread Eric Abrahamsen
On Tue, Nov 08 2011, Peter Münster wrote:

> On Mon, Nov 07 2011, Peter Münster wrote:
>
>> (defadvice gnus-summary-resend-message (around resend-with-bbdb (address n)
>>activate)
>>   "Resend message with bbdb address completion."
>>   (flet ((message-read-from-minibuffer (p &optional d)
>>(bbdb-completing-read-mails p d)))
>> ad-do-it))
>>
>> There are no errors, but `bbdb-completing-read-mails' is not called...
>> Why?
>
> Found it: the reason seems to be, that `message-read-from-minibuffer' is
> called from the `interactive' form...

Looks like you're getting a solution over in emacs, hope it works!


--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/

Re: completition in mini-buffer

2011-11-07 Thread Peter Münster
On Mon, Nov 07 2011, Peter Münster wrote:

> (defadvice gnus-summary-resend-message (around resend-with-bbdb (address n)
>activate)
>   "Resend message with bbdb address completion."
>   (flet ((message-read-from-minibuffer (p &optional d)
>(bbdb-completing-read-mails p d)))
> ad-do-it))
>
> There are no errors, but `bbdb-completing-read-mails' is not called...
> Why?

Found it: the reason seems to be, that `message-read-from-minibuffer' is
called from the `interactive' form...

-- 
   Peter


--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/

Re: completition in mini-buffer

2011-11-07 Thread Peter Münster
On Mon, Nov 07 2011, Eric Abrahamsen wrote:

> Also: see `bbdb-completing-read-mails', it might be enough to replace
> `message-read-from-minibuffer' with your own function that uses this.

Thanks! Redefinig `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 would be nicer, if this redefinition would be active only for
some selected commands, such as `gnus-summary-resend-message', so I
tried it with `defadvice', but it does not work:

--8<---cut here---start->8---
(defadvice gnus-summary-resend-message (around resend-with-bbdb (address n)
   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---

There are no errors, but `bbdb-completing-read-mails' is not called...
Why?

TIA for any help,
-- 
   Peter


--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: completition in mini-buffer

2011-11-06 Thread Eric Abrahamsen
On Mon, Nov 07 2011, Eric Abrahamsen wrote:

> On Mon, Nov 07 2011, Peter Münster wrote:
>
>> Hello,
>>
>> What should I do, to get completion of email addresses in the
>> mini-buffer, when using `gnus-summary-resend-message' (S-D-r)?
>>
>> TIA for any hint!
>
> Well, this is really only a hint, but that command uses
> `message-read-from-minibuffer', which will use `mail-abbrevs-setup' if
> it's bound. You could probably write a function that would hook bbdb
> into `mail-abbrevs-setup' so that bbdb names and addresses are present
> for completion. I have no idea if that would work, and it would likely
> "feel" different than the usual address completion in new message
> address header fields, but it could work…

Also: see `bbdb-completing-read-mails', it might be enough to replace
`message-read-from-minibuffer' with your own function that uses this.

E


--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/

Re: completition in mini-buffer

2011-11-06 Thread Eric Abrahamsen
On Mon, Nov 07 2011, Peter Münster wrote:

> Hello,
>
> What should I do, to get completion of email addresses in the
> mini-buffer, when using `gnus-summary-resend-message' (S-D-r)?
>
> TIA for any hint!

Well, this is really only a hint, but that command uses
`message-read-from-minibuffer', which will use `mail-abbrevs-setup' if
it's bound. You could probably write a function that would hook bbdb
into `mail-abbrevs-setup' so that bbdb names and addresses are present
for completion. I have no idea if that would work, and it would likely
"feel" different than the usual address completion in new message
address header fields, but it could work…

Eric


--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/

completition in mini-buffer

2011-11-06 Thread Peter Münster
Hello,

What should I do, to get completion of email addresses in the
mini-buffer, when using `gnus-summary-resend-message' (S-D-r)?

TIA for any hint!

-- 
   Peter


--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/