Copyright (C) 2000-2012 |
GNU Info (bbdb.info)bbdb-srv`bbdb-srv' ---------- `bbdb-srv' provides the ability to initiate the display of BBDB records from outside of Emacs. This allows external programs to cause the BBDB record for a given person to appear in the running Emacs when, for example, mail is recieved from that person. One specific application, described below, is the integration of Netscape and the BBDB, allowing the display of BBDB records corresponding to Mail and/or News messages displayed in Netscape. `bbdb-srv' is composed of two parts - an external Perl script (`utils/bbdb-srv.pl'), and an Emacs Lisp file (`lisp/bbdb-srv.el'). The external portion is used to send commands to the internal portion. NOTE: `bbdb-srv' requires `gnuserv' and `itimer', both included with XEmacs. `gnuserv' must be started with the `gnuserv-start' command before `bbdb-srv' can be used. In it's most basic form, mail or news headers are passed to the Perl script. The Perl script then causes the BBDB record (if any) corresponding to the passed headers to be displayed in the running Emacs. While `bbdb-srv' will operate with just a `From:' field, it works better when passed both `From:' and `To:' headers. When `bbdb-srv' notices that the logged-in user is named in the `From:' header, it will attempt to display the record (if any) for the person named in the `To:' header. If no `To:' header is passed, it falls back on the record (if any) for the logged-in user (the person named in the `From:' header). An example manual invocation of `bbdb-srv' is as follows: % cat |bbdb-srv.pl From: Jamie Zawinski <jwz@netscape.com> To: Matt Simmons <simmonmt@acm.org> <CTRL-D> If the invoking user is Jamie Zawinski, the record for Matt Simmons (if any) will be displayed. If the invoking user is not Jamie Zawinski, the record for Jamie Zawinski (if any) will be displayed. As mentioned above `bbdb-srv' can be used with Netscape Mail and Netscape News. Please note that it can only be used with the UNIX versions 3.0b2 and greater of these applications. To allow Netscape to use `bbdb-srv', set the `NS_MSG_DISPLAY_HOOK' variable to `bbdb-srv.pl'(1) as follows: Bourne Shell (`/bin/sh') and variants: # NS_MSG_DISPLAY_HOOK bbdb-srv.pl # export NS_MSG_DISPLAY_HOOK C-Shell (`/bin/csh') and variants: % setenv NS_MSG_DISPLAY_HOOK bbdb-srv.pl The following variables can be used to customize the behavior of `bbdb-srv': `bbdb/srv-auto-create-p' This variable is similar to `bbdb/news-auto-create-p' and `bbdb/mail-auto-create-p'. That is, when headers are passed in to `bbdb-srv', a new BBDB record can be created if none exists, depending on the value of this variable. Possible values are: `t' Automatically create new BBDB records if the headers passed in do not correspond to an already-existing record. `nil' Do not automatically create new BBDB records. FUNCTION FUNCTION is called. If it returns `t', a record will be created for the person named in the `From:' header. If it returns `nil', no record will be created. A suggested function for use is `bbdb/srv-auto-create-mail-news-dispatcher'. This function will attempt to determine the source of the passed headers - whether they were part of a mail message or of a news article. The action (if any) dictated by the value of either `bbdb/mail-auto-create-p' or `bbdb/news-auto-create-p', based on the determined source of the passed headers. `bbdb/srv/display-delay' `bbdb-srv' pauses between displaying the records corresponding to each passed set of headers. This variable controls the length of time (in seconds) of the delay between the display of different records. Note when setting this variable that only one set of headers can be queued at a time. If three sets of headers are passed to `bbdb-srv' in less than the delay time, only the first and last will be displayed. ---------- Footnotes ---------- (1) Use the full path to `bbdb-srv.pl' if it is not in the default path. automatically generated by info2www version 1.2.2.9 |