Re: bbdb-complete-name return value

2011-02-06 Thread Roland Winkler
On Sun Feb 6 2011 Antoine Levitt wrote:
> > Currently bbdb-complete-mail (the new name of bbdb-complete-name)
> > really has no well-defined return values whatsoever. Would it help
> > if it returned non-nil whenever it had done "something"?  Would this
> > be the right thing??
> 
> I believe it would. That's the way other completions framework behave,
> and certainly the way message expects it to. But then again, I'm no
> expert on these things, and maybe other MUA have different expectations.
> 
> In any event, a simple "t" after (run-hooks 'bbdb-complete-mail-hook)
> does the trick, but it probably needs to be changed in some other
> places.

Thanks, I'll try to look into this more carefully. It'll be easy to
add a return value of "always t", though it's my gut feeling that
the return value should be non-zero only if bbdb-complete-mail had
done "something" (so that another completion command can take over).

Roland

--
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world? 
http://p.sf.net/sfu/oracle-sfdevnlfb
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: bbdb-complete-name return value

2011-02-06 Thread Antoine Levitt
06/02/11 18:26, Roland Winkler
> On Sun Feb 6 2011 Antoine Levitt wrote:
>> >> When using another completion in message mode, such as
>> >> 
>> >> (setq message-tab-body-function (lambda () (interactive) (dabbrev-expand
>> >> nil)))
>> >> 
>> >> , a successful BBDB completion also triggers the dabbrev-expand
>> >> completion.
>> >
>> > I am not sure I understand your problem.  (I am not using
>> > message-mode myself.)
>> 
>> The way message, as insinuated by bbdb, works, is that it calls bbdb
>> first, and then if the return value is nil, calls
>> message-tab-body-function : see message-tab and message-expand-name.
>> 
>> Therefore, message depends on the return value of
>> bbdb-complete-name. Without going into the details of message, simply
>> type "Bo" and eval (bbdb-complete-name) in a buffer. If it completes to
>> a single name, it returns nil, which is not the behaviour relied upon by
>> message (and possibly other MUAs).
>
> I see! It seems we have here another example that other code has
> evolved, but BBDB is still behaving in some kind of old-fashioned way.
>
> Currently bbdb-complete-mail (the new name of bbdb-complete-name)
> really has no well-defined return values whatsoever. Would it help
> if it returned non-nil whenever it had done "something"?  Would this
> be the right thing??

I believe it would. That's the way other completions framework behave,
and certainly the way message expects it to. But then again, I'm no
expert on these things, and maybe other MUA have different expectations.

In any event, a simple "t" after (run-hooks 'bbdb-complete-mail-hook)
does the trick, but it probably needs to be changed in some other
places.

--
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world? 
http://p.sf.net/sfu/oracle-sfdevnlfb
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: bbdb-complete-name return value

2011-02-06 Thread Roland Winkler
On Sun Feb 6 2011 Antoine Levitt wrote:
> >> When using another completion in message mode, such as
> >> 
> >> (setq message-tab-body-function (lambda () (interactive) (dabbrev-expand
> >> nil)))
> >> 
> >> , a successful BBDB completion also triggers the dabbrev-expand
> >> completion.
> >
> > I am not sure I understand your problem.  (I am not using
> > message-mode myself.)
> 
> The way message, as insinuated by bbdb, works, is that it calls bbdb
> first, and then if the return value is nil, calls
> message-tab-body-function : see message-tab and message-expand-name.
> 
> Therefore, message depends on the return value of
> bbdb-complete-name. Without going into the details of message, simply
> type "Bo" and eval (bbdb-complete-name) in a buffer. If it completes to
> a single name, it returns nil, which is not the behaviour relied upon by
> message (and possibly other MUAs).

I see! It seems we have here another example that other code has
evolved, but BBDB is still behaving in some kind of old-fashioned way.

Currently bbdb-complete-mail (the new name of bbdb-complete-name)
really has no well-defined return values whatsoever. Would it help
if it returned non-nil whenever it had done "something"?  Would this
be the right thing??

Possibly, we should continue this discussion on some other list,

Roland

--
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world? 
http://p.sf.net/sfu/oracle-sfdevnlfb
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: bbdb-complete-name return value

2011-02-06 Thread Antoine Levitt
Hi, thanks for looking into it!
06/02/11 17:45, Roland Winkler
> On Fri Feb 4 2011 Antoine Levitt wrote:
>> I've got an issue with the bbdb-complete-name function. 
>
> It seems you are using BBDB 2.xx.  Recently BBDB has been upgraded
> significantly.  You might want to try BBDB 3 which is avaiable at
> http://cvs.savannah.gnu.org/viewvc/bbdb/?root=bbdb
> To check it out, use
> cvs -d:pserver:anonym...@cvs.sv.gnu.org:/sources/bbdb co bbdb

Ah, thanks! I tried using the sourceforge CVS, but it was down. Anyway,
I just updated to latest CVS (bbdb-version: BBDB version 3.02 ($Date:
2011/01/16 18:03:33 $)), and the problem is still the same.

>
>> When using another completion in message mode, such as
>> 
>> (setq message-tab-body-function (lambda () (interactive) (dabbrev-expand
>> nil)))
>> 
>> , a successful BBDB completion also triggers the dabbrev-expand
>> completion.
>
> I am not sure I understand your problem.  (I am not using
> message-mode myself.)

The way message, as insinuated by bbdb, works, is that it calls bbdb
first, and then if the return value is nil, calls
message-tab-body-function : see message-tab and message-expand-name.

Therefore, message depends on the return value of
bbdb-complete-name. Without going into the details of message, simply
type "Bo" and eval (bbdb-complete-name) in a buffer. If it completes to
a single name, it returns nil, which is not the behaviour relied upon by
message (and possibly other MUAs).

Antoine

--
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world? 
http://p.sf.net/sfu/oracle-sfdevnlfb
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: bbdb-complete-name return value

2011-02-06 Thread Roland Winkler
On Fri Feb 4 2011 Antoine Levitt wrote:
> I've got an issue with the bbdb-complete-name function. 

It seems you are using BBDB 2.xx.  Recently BBDB has been upgraded
significantly.  You might want to try BBDB 3 which is avaiable at
http://cvs.savannah.gnu.org/viewvc/bbdb/?root=bbdb
To check it out, use
cvs -d:pserver:anonym...@cvs.sv.gnu.org:/sources/bbdb co bbdb

> When using another completion in message mode, such as
> 
> (setq message-tab-body-function (lambda () (interactive) (dabbrev-expand
> nil)))
> 
> , a successful BBDB completion also triggers the dabbrev-expand
> completion.

I am not sure I understand your problem.  (I am not using
message-mode myself.)

I thought that the completion function is normally bound to TAB.  So
this can be either your personal function or the BBDB function.
What am I missing here?

Note also that the internals of bbdb-complete-name have changed in
BBDB 3.  In that sense, I am hesitant to look into this more
carefully unless I know that the same problem still exists with BBDB 3.

Roland

--
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world? 
http://p.sf.net/sfu/oracle-sfdevnlfb
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/