Re: Alias support

On Mon, Jul 10, 2000 at 10:28:21AM +0200, Berend De Schouwer wrote:
> On Mon, 10 Jul 2000 08:39:40 Matthew Guenther wrote:
> > On Sat, Jul 08, 2000 at 01:36:15PM +0200, Berend De Schouwer wrote:
> > > On Fri, 07 Jul 2000 19:14:55 Berend De Schouwer wrote:
> > > > Hi,
> > > > 
> 	[ ... snip ... ]
> > > 
> > 
> > Okay, I tried your patch, and it seems to be working for me so far
> > (although it did seem to cause an infinite loop of Balsa Error dialog
> > boxes, but I can't repeat it).
> I've had similar problems until I go "make clean; make" because it changes
> an offset somewhere.  Maybe that was the problem.
> > However I've noticed a few things that should probably be fixed before
> > it goes into CVS.  
> Excellent: Feedback.
> > Primarily, I think you're duplicating a lot of effort with your
> > expand_alias and word_in_array functions that already exists in Glib's
> > string-completion functions.  It would be a good idea to use as much of
> > glib as possible IMHO.
> I thought so too, but I only have glib reference documentation, and it
> isn't complete enough to tell me which function do that(!).  I actually
> first wrote it with the libc str(cat|str|cpy) functions, until I got the
> glib ones going.  I really need to find better documentation.

Do you have the glib reference from  That's the only
glib documentation I use (the only docs for it in existence I think).  As
Peter Williams mentioned, use of the GCompletion functions was what I was
referring to.  Using this should also fix another problem I noticed, if you
don't type a complete name it doesn't expand (i.e. I type Guen<Enter>, but
it doesn't expand to my address.) 

> That said, I need to fill documentation about alias into the Balsa manual
> :P

Don't worry too much about that, it's probably a good idea to leave the
documentation until the implementation has fully settled out.

> > Secondarily, for me it is very natural to press TAB to complete the
> > alias, it would be very helpful to be able to do so in Balsa (so it
> > would be similar to my other, console-based mail client, mutt and pine). 
> I've thought about this, and I haven't done it (yet) because: 
> - I need a way to NOT expand the alias, which tab currently does.  
> - I need a signal on gtk_entry() for tab.  
> The first problem is a policy choice, and could be an option.  The second
> problem comes down to playing with gtk.

Hmmm, perhaps you should have TAB only perform the expansion if whatever's
being typed isn't already a valid email address.  That way if I typed in
someone's address and pressed tab, it would correctly move to the next
field.  We already have functions to test for valid addresses, so that
shouldn't be too difficult.

This will involve messing around with GTK/GDK's keyboard signals, but I
think a proper implementation will have to do this regardless.  I know
Gnumeric has tab completion in cell items, maybe you could check out their

> > Also, it would be helpful (to me at least) to see what I'm currently
> > typing will be expanded into before I actually complete it (similar to
> > many windows applications, like typing urls into win32 netscape).
> I personally hate that.  It also requires caching the aliases otherwise
> its too slow, and I need to trap every keystroke in a gtk_entry() box.
> Its also a problem with multiple alias matches.  I don't say I won't
> implement it, but its a whole new ballgame.

Hmmm, it's not necessary, as long as I can select to easily unexpand it if
it expands to the wrong address (maybe ESC or Backspace immediately after an

> I'm thinking: - start with a blank entry.  - trap every key, when user
> hits ',' forget about the previous input, and make blank again.  - As the
> user types, print "<user input><cursor> [<first matched alias>]" - If the
> user hits <tab> or <end>, replace with <first matched alias>, and change
> focus.
> Problems: - If more than one matched alias, what do you do?  - If "joe" is
> an alias, but I don't want it expanded, what does the user do?

Good point, I think netscape just matches the last one used, but this would
probably be a little too complicated.

> > Have you given any thought into how you will handle multiple alias
> > matches?
> Currently: - multiple aliases gives a gnome warning box.  This is because
> you shouldn't have multiple aliases.  It would be nice if it told you
> which GnomeCard entries match, but it doesn't do that yet.  - multiple
> usernames (when using usernames and not aliases) refuses to expand, but
> doesn't give a warning.  The reason is, that you could know a lot of
> people called "John", so warning about that is bad.

I think it would be possible to solve two problems with one stone, have any
expansion that matches more than one alias or name pop up a gnome dialog
containing a GtkList of all the possible matches.  Double-clicking on a
match or selecting one and pressing "OK" would invoke that expansion.
Pressing "Cancel" would leave whatever you typed.  This feature or something
like it would be necessary to properly fix the partial-name completion
problem I mentioned above.

> > I think the patch is an excellent start to adding alias support, thanks
> > for the help!
> Cool.
> I've now patched GnomeCard to be able to enter aliases too.

It seems to me that GnomeCard already supports aliases, it just calls them
Card Names instead of aliases.  Card names are arbitrary but are usually the
first and last names of people or the company name... but they can be
anything.  We should probably avoid duplicating the functionalities on
fields if it's not going to add anything appreciable.  We don't want people
to have to go through and add a field to all the records of their address


      Matthew Guenther                          Nice guys get sick.

PGP signature

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]