Re: [PATCH] Better support for organisation-only records

2011-09-26 Thread Roland Winkler
On Mon Sep 26 2011 Eric Abrahamsen wrote:
 Why not have separate minibuffer prompts for surname and given name?
 
 Many of my records are for Chinese people. Right now I can't be bothered
 separating out the characters for surname and given name, and usually
 they all get lumped into whatever default bbdb picks for names with no
 spaces. Separate prompts for surname and given name would solve this
 (and the surname prompt could say  or organization name, something
 like that).
 
 Or, if a syntax for splitting is introduced, perhaps it could indicate
 which side is the surname and which the given name, to make it easier to
 create records for cultures where surname comes first. I'm not bothered
 that the resulting name is displayed backwards (given name first), but
 it would be great if entry were made easier.
 
 My random suggestion: use { or } for the separator. The surname is
 the part that's inside the bracket. So:
 
 Eric{Abrahamsen
  }  
 {Lucky Star Buffet Restaurant
 Bartók}Béla

 On second thought, if you did it this way, BBDB could learn from the
 parsing the proper display order of the name, and store that as a
 boolean with the name itself. Parsing would be a little more
 complicated, but this would provide for much more flexible
 customization.

Nice thoughts, thank you! 

Being a lazy person when it comes to typing, I'd prefer for myself
to have one prompt for the full name. But this could be made
customizable, such that one can also get two prompts for first and
last name. And if the customizable default for entering names was
full-name, the bracket separator could be used for more
flexibility.

Controlling the display order via the bracket scheme is also a neat
idea. The flag could also be used if first and last name are entered
separately. What would be a convenient way to control the value of
this flag when entering the name in the latter way?

Roland

--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: [PATCH] Better support for organisation-only records

2011-09-26 Thread Stefan Monnier
 Direct editing maybe similar to wdired-mode could be, indeed, a
 great thing. -- Yet as I said: I'll postpone such dreams till BBDB 3
 has been released.

No!  I want it now!
[...starts rolling on the floor screaming...]
Now! now! now! now! now!!


Stefan Damn adults!


--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: [PATCH] Better support for organisation-only records

2011-09-26 Thread Roland Winkler
On Mon Sep 26 2011 Stefan Monnier wrote:
  Direct editing maybe similar to wdired-mode could be, indeed, a
  great thing. -- Yet as I said: I'll postpone such dreams till BBDB 3
  has been released.
 
 No!  I want it now!
 [...starts rolling on the floor screaming...]
 Now! now! now! now! now!!
 
 Stefan Damn adults!

You want it now? Who cares about now??
-- Get it yesterday!

Now that it's been scientifically proven that the speed of light is
no boundary anymore, I could finally complete the missing piece in
the Emacs package elisp-dream.el. This will read your mind and
translate (with twice the speed of light) your deepest dreams
directly into elisp code. Actually, the code goes into yesterday's
backup of your hard drive.

To install elisp-dream.el, just dream about it and it will install
itself automatically. Note that the compiled version elisp-dream.elc
gives you some remarkable speed-ups. It even reads your mind when
your brain is off-line.

Roland

PS: Wait! You say you have dreams that cannot be coded in elisp??

--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: [PATCH] Better support for organisation-only records

2011-09-26 Thread Carson Chittom
Roland Winkler wink...@gnu.org writes:

 PS: Wait! You say you have dreams that cannot be coded in elisp??

I hear some folks get divide-by-zero errors.

-- 
http://www.wistly.net

--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: [PATCH] Better support for organisation-only records

2011-09-25 Thread Leo
On 2011-09-24 03:27 +0800, Roland Winkler wrote:
 When I looked at this once more I thought that this could be
 something more people might like to use so that it could become part
 of the BBDB trunk. Namely:

 There could be an optional note field `name-face' similar to
 `creation-date' and `timestamp'. This note field could either
 directly hold the name of a face that font-lock will use for
 highlighting the name of a record. Or the value of name-face could
 be a key which gets translated to a face via something like
 `bbdb-name-face-alist'. (Even both of these schemes could exist in
 parallel.)

I am fine with anything that allows one to enter organisation-only
records nicely. For example, dividing Lucky Star Buffet Restaurant
into firstname and lastname is not nice. We should get rid of that.

Leo


--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: [PATCH] Better support for organisation-only records

2011-09-25 Thread Roland Winkler
On Sun Sep 25 2011 Leo wrote:
 I am fine with anything that allows one to enter organisation-only
 records nicely. For example, dividing Lucky Star Buffet Restaurant
 into firstname and lastname is not nice. We should get rid of that.

Any suggestions what to do?

It seems that again this is a somewhat separate problem. I mean, by
default BBDB uses bbdb-divide-name to divide a name into first and
last name. If a record already exists, you can call
bbdb-record-edit-name with a prefix arg. This way you can edit the
first and last name separately so that you get for sure what you
want. But this requires that the record already exists. There should
also be a mechanism to do such a thing in the first place when the
record is created. (There will always be unusual names where
bbdb-divide-name is bound to fail.)

If a record is created by hand using bbdb-create, this command is
too complex for a prefix arg. (It's been using a prefix arg, but in
general it's rather confusing which part of the record creation
should be modified because of the prefix arg.)

A simple solution would be that if the user enters a name string
that contains a special character such as % as separator, then
this defines the first and last name. So then you would have to
enter the name as %Lucky Star Buffet Restaurant. Would this be
useful?

A much fancier solution would be to reimplement bbdb-create from
scratch by using something like a form to fill, similar to what
customize is using. This could be done in a much more transparent
way than the current minibuffer-based approach. Yet I do not know
yet how to deal with things like the street part of an address. The
customize approach of adding lines appears a bit clumsy to me if
one wanted to enter more records; but maybe this would be just a
matter of getting used to such a scheme. A similar approach could
also be used for editing records in a more transparent way...

Roland

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: [PATCH] Better support for organisation-only records

2011-09-25 Thread Eric Abrahamsen
On Mon, Sep 26 2011, Roland Winkler wrote:

 On Sun Sep 25 2011 Roland Winkler wrote:
 A much fancier solution would be to reimplement bbdb-create from
 scratch by using something like a form to fill, similar to what
 customize is using.

 I should add: Such a rather substantial change would have rather low
 priority on my current BBDB agenda. Currently, I consider a proper
 BBDB release more important.

 A simple solution would be that if the user enters a name string
 that contains a special character such as % as separator, then
 this defines the first and last name. So then you would have to
 enter the name as %Lucky Star Buffet Restaurant. Would this be
 useful?

 Such a scheme, while not perfect, could provide a reasonable
 solution till someone finds the time to implement a fancier scheme.
 (This scheme would only require a few lines of new code.)

 Yet in any case: suggestions for better schemes are always welcome.

Why not have separate minibuffer prompts for surname and given name?

Many of my records are for Chinese people. Right now I can't be bothered
separating out the characters for surname and given name, and usually
they all get lumped into whatever default bbdb picks for names with no
spaces. Separate prompts for surname and given name would solve this
(and the surname prompt could say …or organization name, something
like that).

Or, if a syntax for splitting is introduced, perhaps it could indicate
which side is the surname and which the given name, to make it easier to
create records for cultures where surname comes first. I'm not bothered
that the resulting name is displayed backwards (given name first), but
it would be great if entry were made easier.

My random suggestion: use { or } for the separator. The surname is
the part that's inside the bracket. So:

Eric{Abrahamsen
王}小波
{Lucky Star Buffet Restaurant
Bartók}Béla

On second thought, if you did it this way, BBDB could learn from the
parsing the proper display order of the name, and store that as a
boolean with the name itself. Parsing would be a little more
complicated, but this would provide for much more flexible
customization.

Two cents,
Eric


--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/

Re: [PATCH] Better support for organisation-only records

2011-09-25 Thread Stefan Monnier
 A much fancier solution would be to reimplement bbdb-create from
 scratch by using something like a form to fill, similar to what
 customize is using.
 I should add: Such a rather substantial change would have rather low
 priority on my current BBDB agenda. Currently, I consider a proper
 BBDB release more important.

Being able to (more or less) directly edit the *BBDB* buffer would
be great.


Stefan


--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: [PATCH] Better support for organisation-only records

2011-09-23 Thread Roland Winkler
On Thu Sep 22 2011 Roland Winkler wrote:
 It seems to me that something like a note field for the predicate
 `person-p' with values natural, artifical, restaurant, bookstore etc
 was more to the point here. Then the only thing you need to
 customize is the function bbdb-display-name-organization.

When I looked at this once more I thought that this could be
something more people might like to use so that it could become part
of the BBDB trunk. Namely:

There could be an optional note field `name-face' similar to
`creation-date' and `timestamp'. This note field could either
directly hold the name of a face that font-lock will use for
highlighting the name of a record. Or the value of name-face could
be a key which gets translated to a face via something like
`bbdb-name-face-alist'. (Even both of these schemes could exist in
parallel.)

Thoughts?

Roland

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: [PATCH] Better support for organisation-only records

2011-09-22 Thread Leo
On 2011-09-21 23:11 +0800, Roland Winkler wrote:
 (bbdb-defstruct record
   firstname lastname affix aka organization organization-p phone address mail
 notes cache)
 
 What do you think?

 Maybe, I am just missing a typical application for myself. How could
 such an extra predicate be used? Where will it make a difference?

It makes a different in displaying records. See:
http://i.imgur.com/0NJt1.png

Another example is one can list all organization-only records easily.

 BTW, I have (setq bbdb-mail-alias-field 'tags) for grouping
 records.

 Maybe I am an old-fashioned person. I have quite a few records
 without an email address. Anyway I consider the organization field a
 rather different thing. It can take multiple words per element,
 whereas an alias is an abbreviation for something else.

Note that the added capability to make organisation-only records does
not stop people from using BBDB in the way you describe.

Leo


--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: [PATCH] Better support for organisation-only records

2011-09-22 Thread Roland Winkler
On Thu Sep 22 2011 Leo wrote:
 It makes a different in displaying records. See:
 http://i.imgur.com/0NJt1.png
 
 Another example is one can list all organization-only records
 easily.

It seems to me that something like a note field for the predicate
`person-p' with values natural, artifical, restaurant, bookstore etc
was more to the point here. Then the only thing you need to
customize is the function bbdb-display-name-organization.

 Note that the added capability to make organisation-only records does
 not stop people from using BBDB in the way you describe.

I found that part of the problem of the old BBDB code was that it
had gained a significant part of its complexity when it implemented
solutions in a way that appeared to me not quite to the point.

Your patch includes modficiations in various places. And I am quite
sure that you'll find more places that need to be patched as time
goes by.

Whenever it's possible, I'd be glad if such extra complexity can be
avoided. Otherwise, in the long run maintenance of BBDB becomes much
more difficult.

Roland

--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: [PATCH] Better support for organisation-only records

2011-09-21 Thread Roland Winkler
On Wed Sep 21 2011 Leo wrote:
 Maybe a cleaner way is to insert a new slot `organisation-p' in the
 definition:
 
 (bbdb-defstruct record
   firstname lastname affix aka organization organization-p phone address mail
 notes cache)
 
 What do you think?

Maybe, I am just missing a typical application for myself. How could
such an extra predicate be used? Where will it make a difference?

 BTW, I have (setq bbdb-mail-alias-field 'tags) for grouping
 records.

Maybe I am an old-fashioned person. I have quite a few records
without an email address. Anyway I consider the organization field a
rather different thing. It can take multiple words per element,
whereas an alias is an abbreviation for something else.

Roland

--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: [PATCH] Better support for organisation-only records

2011-09-20 Thread Roland Winkler
On Tue Sep 20 2011 Leo wrote:
 Better support for organisation-only records. Also fix a bug when
 firstname or lastname are nil. Comments welcome ;)

For those who did not browse Leo's code: 

The current BBDB code assumes that a record should have a name so
that the record can be identified by this name. Leo's code adds the
organization field as an alternative if a record has no name
associated with it.

I guess this is really raising two questions: 

- At least which fields should a record have filled to be a valid
  record?

- What are possible usages of the organization field?

While I can not yet claim I thought about this in all detail, in my
own usage of BBDB I have looked at the organization field as a list
of attributes for grouping records (by means of BBDB's search
functions). This motivated the change to make the organization field
a list (while in BBDB 2 it was a string): So one person might be a
colleague from work, but also a member of this or that other
organization. Then BBDB can make a list of all colleagues from work
or some other organization.

So if I make a BBDB record for something that's not a person, I put
the name of this 'something' into the name field - so that the
organization field is still available as a list of grouping
attributes in much the same way it works for real persons. An
organization with a BBDB record can likewise be part of a larger
network.

Roland

--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/