Re: xfield with non-string value?

2014-04-25 Thread Roland Winkler
On Fri Apr 25 2014 Eric Abrahamsen wrote:
 It wouldn't be hard to store information about a *single* message: you
 could concatenate message id, subject, group name, and whatever else
 into a single string, if necessary. But to be really useful, I was
 hoping to get a value like:
 
 '(((234234 323423) Message subject 87k3aelq1m@ericabrahamsen.net
 gnus:org-syntax-link)
   ((657465 234232) Other subject 87y4z0l0xi@talktalk.net
 gnus:org-syntax-link))
 
 I've got the easy part done: collecting this information in a notice
 hook and getting ready to do an xfield save -- but that's where it gets
 difficult!

Give me a few days to look into this.  Maybe it is not too difficult
to store such things as is.

Roland

--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: xfield with non-string value?

2014-04-24 Thread Roland Winkler
On Thu Apr 24 2014 Eric Abrahamsen wrote:
 I'm trying to create a custom xfield for records that is a list, not a
 string. So far as I can tell, it's only possible for xfield values to be
 strings. Is that correct? Is it possible to circumvent this at the
 moment?

By default, the values ox xfields should be strings.  Nonetheless,
there are various ways to go beyond that:

- bbdb-record-xfield-intern returns the interned value (i.e., a symbol)
  of an xfield LABEL

- bbdb-record-xfield-split splits the value as a list of strings.
  (See the source code of BBDB for how these functions are used in
  various places.)

- If you want to go beyond the constraint that the stored values of
  an xfield should be strings, this requires more of an effort.
  You need to define functions bbdb-display-XFIELD-LAYOUT and
  bbdb-read-xfield-XFIELD, plus possibly modifications elsewhere.
  I have not tried that myself as I did not find it necessary for
  anything I wanted to do with BBDB.

  The problem is that then your bbdb-file can be handled only if
  your customizations are first properly loaded.  This can make
  debugging more difficult.

Roland

--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: xfield with non-string value?

2014-04-24 Thread Eric Abrahamsen
Roland Winkler wink...@gnu.org writes:

 On Thu Apr 24 2014 Eric Abrahamsen wrote:
 I'm trying to create a custom xfield for records that is a list, not a
 string. So far as I can tell, it's only possible for xfield values to be
 strings. Is that correct? Is it possible to circumvent this at the
 moment?

 By default, the values ox xfields should be strings.  Nonetheless,
 there are various ways to go beyond that:

 - bbdb-record-xfield-intern returns the interned value (i.e., a symbol)
   of an xfield LABEL

 - bbdb-record-xfield-split splits the value as a list of strings.
   (See the source code of BBDB for how these functions are used in
   various places.)

 - If you want to go beyond the constraint that the stored values of
   an xfield should be strings, this requires more of an effort.
   You need to define functions bbdb-display-XFIELD-LAYOUT and
   bbdb-read-xfield-XFIELD, plus possibly modifications elsewhere.
   I have not tried that myself as I did not find it necessary for
   anything I wanted to do with BBDB.

   The problem is that then your bbdb-file can be handled only if
   your customizations are first properly loaded.  This can make
   debugging more difficult.

 Roland

Thanks for this! Very useful starting places. Something I've wanted to
do for a long time is make an xfield that stores pointers to the N most
recently received mails (in Gnus) from the record in question. I don't
necessarily expect it will work, but I wanted to give it a shot.

Thanks again,
Eric


--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: xfield with non-string value?

2014-04-24 Thread Gijs Hillenius
On 24 Apr 2014, Eric Abrahamsen wrote:

 Roland Winkler wink...@gnu.org writes:

 On Thu Apr 24 2014 Eric Abrahamsen wrote:
 I'm trying to create a custom xfield for records that is a list, not
 a string. So far as I can tell, it's only possible for xfield values
 to be strings. Is that correct? Is it possible to circumvent this at
 the moment?

 By default, the values ox xfields should be strings.  Nonetheless,
 there are various ways to go beyond that:

 - bbdb-record-xfield-intern returns the interned value (i.e., a
 symbol) of an xfield LABEL

 - bbdb-record-xfield-split splits the value as a list of strings.
 (See the source code of BBDB for how these functions are used in
 various places.)

 - If you want to go beyond the constraint that the stored values of
 an xfield should be strings, this requires more of an effort.
 You need to define functions bbdb-display-XFIELD-LAYOUT and
 bbdb-read-xfield-XFIELD, plus possibly modifications elsewhere.
 I have not tried that myself as I did not find it necessary for
 anything I wanted to do with BBDB.

 The problem is that then your bbdb-file can be handled only if
 your customizations are first properly loaded.  This can make
 debugging more difficult.

 Roland

 Thanks for this! Very useful starting places. Something I've wanted to
 do for a long time is make an xfield that stores pointers to the N
 most recently received mails (in Gnus) from the record in question. I
 don't necessarily expect it will work, but I wanted to give it a shot.


In BBDB v2 there was a function that allowed the storing of Subject
lines and information about the mail client. I don't yet remember its
name/the names. But that could be a start?



--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: xfield with non-string value?

2014-04-24 Thread Eric Abrahamsen
Gijs Hillenius g...@hillenius.net writes:

 On 24 Apr 2014, Eric Abrahamsen wrote:

 Roland Winkler wink...@gnu.org writes:

 On Thu Apr 24 2014 Eric Abrahamsen wrote:
 I'm trying to create a custom xfield for records that is a list, not
 a string. So far as I can tell, it's only possible for xfield values
 to be strings. Is that correct? Is it possible to circumvent this at
 the moment?

 By default, the values ox xfields should be strings.  Nonetheless,
 there are various ways to go beyond that:

 - bbdb-record-xfield-intern returns the interned value (i.e., a
 symbol) of an xfield LABEL

 - bbdb-record-xfield-split splits the value as a list of strings.
 (See the source code of BBDB for how these functions are used in
 various places.)

 - If you want to go beyond the constraint that the stored values of
 an xfield should be strings, this requires more of an effort.
 You need to define functions bbdb-display-XFIELD-LAYOUT and
 bbdb-read-xfield-XFIELD, plus possibly modifications elsewhere.
 I have not tried that myself as I did not find it necessary for
 anything I wanted to do with BBDB.

 The problem is that then your bbdb-file can be handled only if
 your customizations are first properly loaded.  This can make
 debugging more difficult.

 Roland

 Thanks for this! Very useful starting places. Something I've wanted to
 do for a long time is make an xfield that stores pointers to the N
 most recently received mails (in Gnus) from the record in question. I
 don't necessarily expect it will work, but I wanted to give it a shot.


 In BBDB v2 there was a function that allowed the storing of Subject
 lines and information about the mail client. I don't yet remember its
 name/the names. But that could be a start?

It wouldn't be hard to store information about a *single* message: you
could concatenate message id, subject, group name, and whatever else
into a single string, if necessary. But to be really useful, I was
hoping to get a value like:

'(((234234 323423) Message subject 87k3aelq1m@ericabrahamsen.net 
gnus:org-syntax-link)
  ((657465 234232) Other subject 87y4z0l0xi@talktalk.net 
gnus:org-syntax-link))

I've got the easy part done: collecting this information in a notice
hook and getting ready to do an xfield save -- but that's where it gets
difficult!

Eric


--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/