--- bbdb-2.35.cvs20080316.orig/README +++ bbdb-2.35.cvs20080316/README @@ -1 +1,5 @@ -Read the INSTALL file. +BBDB (The Insidious Big Brother Database) is a rolodex-like database +program for GNU Emacs. BBDB can hook into (insinuate) various Emacs +subsystems (email readers, news readers, etc) to automatically create, +display, and augment relevant entries from its database. Filters are +provided to import/export in a variety of formats. --- bbdb-2.35.cvs20080316.orig/configure +++ bbdb-2.35.cvs20080316/configure @@ -0,0 +1,3620 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.64 for BBDB 2.36 devo. +# +# Report bugs to . +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software +# Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +# +# Copyright (C) 2000-2001 Didier Verna . +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + # We cannot yet assume a decent shell, so we have to provide a + # neutralization value for shells without unset; and this also + # works around shells that cannot unset nonexistent variables. + BASH_ENV=/dev/null + ENV=/dev/null + (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and +$0: bbdb-info@lists.sourceforge.net about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error ERROR [LINENO LOG_FD] +# --------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with status $?, using 1 if that was 0. +as_fn_error () +{ + as_status=$?; test $as_status -eq 0 && as_status=1 + if test "$3"; then + as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + fi + $as_echo "$as_me: error: $1" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='BBDB' +PACKAGE_TARNAME='bbdb' +PACKAGE_VERSION='2.36 devo' +PACKAGE_STRING='BBDB 2.36 devo' +PACKAGE_BUGREPORT='bbdb-info@lists.sourceforge.net' +PACKAGE_URL='' + +ac_unique_file="configure.ac" +ac_subst_vars='LTLIBOBJS +LIBOBJS +GREPCONTEXT +EMACS_FLAVOR +HUSHMAKE +BBDB_SRV +BBDB_REPORTMAIL +BBDB_SC +BBDB_LOADPATH +BBDB_MHE +BBDB_GNUS +BBDB_VM +BBDB_RMAIL +LINKPATH +SYMLINKS +PACKAGEDIR +OTHERDIRS +VMDIR +MHEDIR +GNUSDIR +EMACS_PROG +ETAGS +TEXI2DVI +MAKEINFO +COMPEXT +COMPRESS +TAR +GREP +RM +LN_S +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +SET_MAKE +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +with_emacs +with_gnus_dir +with_mhe_dir +with_vm_dir +enable_vm +enable_rmail +enable_gnus +enable_mhe +enable_developer +with_other_dirs +with_package_dir +with_symlinks +with_linkpath +' + ac_precious_vars='build_alias +host_alias +target_alias' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information." + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures BBDB 2.36 devo to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/bbdb] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of BBDB 2.36 devo:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-vm enable VM hooks (default depends on --with-vm-dir) + --enable-rmail enable RMAIL hooks [no] + --enable-gnus enable GNUS hooks [yes] + --enable-mhe enable MH-E hooks (default depends on + --with-mhe-dir) + --enable-developer enable developer hooks [no] + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-emacs=PROG choose which flavor of Emacs to use + --with-gnus-dir=DIR set the location of Gnus to DIR + --with-mhe-dir=DIR set the location of Mh-E to DIR + --with-vm-dir=DIR set the location of VM to DIR + --with-other-dirs=DIRS set other needed directories (a list of space or + colon separated paths) + --with-package-dir=DIR set the XEmacs package directory to DIR + [/usr/lib/xemacs/site-packages] + --with-symlinks install BBDB by linking instead of copying [no] + --with-linkpath=PATH path to symlink from if `pwd' does not work + +Report bugs to . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +BBDB configure 2.36 devo +generated by GNU Autoconf 2.64 + +Copyright (C) 2009 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. + +Copyright (C) 2000-2001 Didier Verna . +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by BBDB $as_me 2.36 devo, which was +generated by GNU Autoconf 2.64. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------------- ## +## File substitutions. ## +## ------------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + ac_site_file1=$CONFIG_SITE +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + +ac_config_files="$ac_config_files Makefile lisp/Makefile texinfo/Makefile tex/Makefile utils/Makefile" + + +if [ -d testing ] +then + ac_config_files="$ac_config_files testing/Makefile" + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + for ac_t in install-sh install.sh shtool; do + if test -f "$ac_dir/$ac_t"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/$ac_t -c" + break 2 + fi + done +done +if test -z "$ac_aux_dir"; then + as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +# Extract the first word of "rm", so it can be a program name with args. +set dummy rm; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_RM+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $RM in + [\\/]* | ?:[\\/]*) + ac_cv_path_RM="$RM" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_RM="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_RM" && ac_cv_path_RM="/bin/rm" + ;; +esac +fi +RM=$ac_cv_path_RM +if test -n "$RM"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RM" >&5 +$as_echo "$RM" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "grep", so it can be a program name with args. +set dummy grep; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_GREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $GREP in + [\\/]* | ?:[\\/]*) + ac_cv_path_GREP="$GREP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_GREP="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_GREP" && ac_cv_path_GREP="/bin/grep" + ;; +esac +fi +GREP=$ac_cv_path_GREP +if test -n "$GREP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GREP" >&5 +$as_echo "$GREP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for my keys" >&5 +$as_echo_n "checking for my keys... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } +echo "Damn! I'm locked outside :-(" + + for ac_prog in gtar tar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_TAR+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$TAR"; then + ac_cv_prog_TAR="$TAR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_TAR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +TAR=$ac_cv_prog_TAR +if test -n "$TAR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TAR" >&5 +$as_echo "$TAR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$TAR" && break +done + + if test "x${TAR}" = "xtar" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking that tar is GNU tar" >&5 +$as_echo_n "checking that tar is GNU tar... " >&6; } + ${TAR} --version > /dev/null 2>&1 || TAR= + if test "x${TAR}" = "x" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + fi + fi + if test "x${TAR}" = "x" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** No GNU tar program found." >&5 +$as_echo "$as_me: WARNING: *** No GNU tar program found." >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Some targets will be unavailable." >&5 +$as_echo "$as_me: WARNING: *** Some targets will be unavailable." >&2;} + fi + for ac_prog in gzip compress +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_COMPRESS+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$COMPRESS"; then + ac_cv_prog_COMPRESS="$COMPRESS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_COMPRESS="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +COMPRESS=$ac_cv_prog_COMPRESS +if test -n "$COMPRESS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $COMPRESS" >&5 +$as_echo "$COMPRESS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$COMPRESS" && break +done + + + if test "x${COMPRESS}" = "x" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** No compression program found." >&5 +$as_echo "$as_me: WARNING: *** No compression program found." >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Tarballs will not be compressed." >&5 +$as_echo "$as_me: WARNING: *** Tarballs will not be compressed." >&2;} + COMPEXT= + elif test "x${COMPRESS}" = "xgzip" ; then + COMPRESS="gzip --verbose --best" + COMPEXT=gz + else + COMPEXT=Z + fi + # Extract the first word of "makeinfo", so it can be a program name with args. +set dummy makeinfo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_MAKEINFO+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MAKEINFO"; then + ac_cv_prog_MAKEINFO="$MAKEINFO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_MAKEINFO="makeinfo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MAKEINFO=$ac_cv_prog_MAKEINFO +if test -n "$MAKEINFO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKEINFO" >&5 +$as_echo "$MAKEINFO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test "x${MAKEINFO}" = "x" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** No makeinfo program found." >&5 +$as_echo "$as_me: WARNING: *** No makeinfo program found." >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Info files will not be built." >&5 +$as_echo "$as_me: WARNING: *** Info files will not be built." >&2;} + fi + # Extract the first word of "texi2dvi", so it can be a program name with args. +set dummy texi2dvi; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_TEXI2DVI+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$TEXI2DVI"; then + ac_cv_prog_TEXI2DVI="$TEXI2DVI" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_TEXI2DVI="texi2dvi" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +TEXI2DVI=$ac_cv_prog_TEXI2DVI +if test -n "$TEXI2DVI"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEXI2DVI" >&5 +$as_echo "$TEXI2DVI" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test "x${TEXI2DVI}" = "x" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** No texi2dvi program found." >&5 +$as_echo "$as_me: WARNING: *** No texi2dvi program found." >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** DVI and PDF files will not be built." >&5 +$as_echo "$as_me: WARNING: *** DVI and PDF files will not be built." >&2;} + fi + # Extract the first word of "etags", so it can be a program name with args. +set dummy etags; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ETAGS+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ETAGS"; then + ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ETAGS="etags" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ETAGS=$ac_cv_prog_ETAGS +if test -n "$ETAGS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ETAGS" >&5 +$as_echo "$ETAGS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test "x${ETAGS}" = "x" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** No etags program found." >&5 +$as_echo "$as_me: WARNING: *** No etags program found." >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Tags file will not be built." >&5 +$as_echo "$as_me: WARNING: *** Tags file will not be built." >&2;} + fi + +# Check whether --with-emacs was given. +if test "${with_emacs+set}" = set; then : + withval=$with_emacs; EMACS_PROG="${withval}" +else + for ac_prog in emacs xemacs +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_EMACS_PROG+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $EMACS_PROG in + [\\/]* | ?:[\\/]*) + ac_cv_path_EMACS_PROG="$EMACS_PROG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_EMACS_PROG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +EMACS_PROG=$ac_cv_path_EMACS_PROG +if test -n "$EMACS_PROG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $EMACS_PROG" >&5 +$as_echo "$EMACS_PROG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$EMACS_PROG" && break +done + +fi + + if test "x${EMACS_PROG}" = "x" ; then + as_fn_error "*** No Emacs program found." "$LINENO" 5 + fi + if test -x "${EMACS_PROG}"; then + echo "yay" > /dev/null # because I don't know if 'if !' is portable + else + as_fn_error "*** ${EMACS_PROG} isn't executable." "$LINENO" 5 + fi + if test "x`echo $EMACS_PROG | grep \" \"`" != "x"; then + EMACS_PROG=\"$EMACS_PROG\" + fi + + + + + +# Check whether --with-gnus-dir was given. +if test "${with_gnus_dir+set}" = set; then : + withval=$with_gnus_dir; + enable_gnus=gnus + GNUSDIR="${withval}" + +fi + + + + + +# Check whether --with-mhe-dir was given. +if test "${with_mhe_dir+set}" = set; then : + withval=$with_mhe_dir; + enable_mhe=mhe + MHEDIR="${withval}" + +fi + + + + + +# Check whether --with-vm-dir was given. +if test "${with_vm_dir+set}" = set; then : + withval=$with_vm_dir; + enable_vm=vm + VMDIR="${withval}" + +fi + + + +# Various MTAs and other optional bits +# Default Gnus to on +enable_gnus=gnus + +# this seems far messier and more complex than I'd expect from autoconf... +# Check whether --enable-vm was given. +if test "${enable_vm+set}" = set; then : + enableval=$enable_vm; if test "x$enableval" = "xno"; then BBDB_VM=; enable_vm=; else BBDB_VM=vm; fi +fi + + +# Check whether --enable-rmail was given. +if test "${enable_rmail+set}" = set; then : + enableval=$enable_rmail; if test "x$enableval" = "xno"; then BBDB_RMAIL=; enable_rmail=; else BBDB_RMAIL=rmail; fi +else + BBDB_RMAIL= +fi + + +# Check whether --enable-gnus was given. +if test "${enable_gnus+set}" = set; then : + enableval=$enable_gnus; if test "x$enableval" = "xno"; then BBDB_GNUS=; enable_gnus=; else BBDB_GNUS=gnus; fi +else + BBDB_GNUS= +fi + + +# Check whether --enable-mhe was given. +if test "${enable_mhe+set}" = set; then : + enableval=$enable_mhe; if test "x$enableval" = "xno"; then BBDB_MHE=; enable_mhe=; else BBDB_MHE=mhe; fi +else + BBDB_MHE= +fi + + +# Check whether --enable-developer was given. +if test "${enable_developer+set}" = set; then : + enableval=$enable_developer; if test "x$enable" = "xno"; then HUSHMAKE=; fi +else + HUSHMAKE=@ +fi + + + + + +# Check whether --with-other-dirs was given. +if test "${with_other_dirs+set}" = set; then : + withval=$with_other_dirs; + case "$withval" in *:*) + withval="`echo $withval | sed -e 's/:/ /g'`";; + esac + OTHERDIRS="${withval}" + +fi + + + +echo "(setq load-path (append (list " > ${ac_confdir}/loadpath.el +for dir in . "${VMDIR}" "${GNUSDIR}" "${MHEDIR}" "${OTHERDIRS}" +do + if test "x$dir" != "x" + then + echo "(expand-file-name \"$dir\") " >> ${ac_confdir}/loadpath.el + fi +done +echo ") load-path))" >> ${ac_confdir}/loadpath.el + +BBDB_LOADPATH="${ac_confdir}/loadpath.el" + +if test "x$enable_vm" != "x"; then + BBDB_VM=`${EMACS_PROG} --no-site-file --no-init-file -batch -q -l ${BBDB_LOADPATH} -eval "(if (locate-library \"vm-autoload\") (message \"vm\"))" 2>&1` + if test "x$BBDB_VM" = "x"; then + as_fn_error "*** Cannot build VM support without VM's source." "$LINENO" 5 + fi +fi + +BBDB_SC=`${EMACS_PROG} -no-site-file -no-init-file -batch -q -l ${BBDB_LOADPATH} -eval "(if (locate-library \"supercite\") (message \"bbdb-sc.elc\"))" 2>&1` +BBDB_REPORTMAIL=`${EMACS_PROG} -no-site-file -no-init-file -batch -q -l ${BBDB_LOADPATH} -eval "(if (locate-library \"reportmail\") (message \"bbdb-reportmail.elc\"))" 2>&1` +BBDB_SRV=`${EMACS_PROG} -no-site-file -no-init-file -batch -q -l ${BBDB_LOADPATH} -eval "(progn (or (fboundp (quote define-obsolete-variable-alias)) (if (locate-library \"gnuserv-compat\") (load \"gnuserv-compat\" t t))) (if (and (locate-library \"gnuserv\") (locate-library \"itimer\")) (message \"bbdb-srv.el\")))" 2>&1` + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking checking emacs-type of ${EMACS_PROG}" >&5 +$as_echo_n "checking checking emacs-type of ${EMACS_PROG}... " >&6; } +cat > conftest.el <&5 +$as_echo "${EMACS_FLAVOR}" >&6; } + + + + +# Check whether --with-package-dir was given. +if test "${with_package_dir+set}" = set; then : + withval=$with_package_dir; + + PACKAGEDIR="${withval}" + +else + PACKAGEDIR="/usr/lib/xemacs/site-packages" +fi + + + + + + +# Check whether --with-symlinks was given. +if test "${with_symlinks+set}" = set; then : + withval=$with_symlinks; + + SYMLINKS="${withval}" + +else + SYMLINKS="no" +fi + + + + + + +# Check whether --with-linkpath was given. +if test "${with_linkpath+set}" = set; then : + withval=$with_linkpath; + + LINKPATH="${withval}" + +fi + + + +# Switch on some targets + + + + + + + + + + + +if test "${RM}" = "/bin/rm" -o "${RM}" = "/usr/bin/rm"; then + RM="${RM} -f" +fi + +if test "x$enable_developer" != "x"; then + if ${GREP} -C foo configure.ac > /dev/null 2>&1; then + GREPCONTEXT="-C" + else + GREPCONTEXT="-C5" + fi +fi + + + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +ac_script=' +:mline +/\\$/{ + N + s,\\\n,, + b mline +} +t clear +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g +t quote +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g +t quote +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` + + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + +: ${CONFIG_STATUS=./config.status} +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error ERROR [LINENO LOG_FD] +# --------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with status $?, using 1 if that was 0. +as_fn_error () +{ + as_status=$?; test $as_status -eq 0 && as_status=1 + if test "$3"; then + as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + fi + $as_echo "$as_me: error: $1" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by BBDB $as_me 2.36 devo, which was +generated by GNU Autoconf 2.64. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + +Configuration files: +$config_files + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_version="\\ +BBDB config.status 2.36 devo +configured by $0, generated by GNU Autoconf 2.64, + with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2009 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "lisp/Makefile") CONFIG_FILES="$CONFIG_FILES lisp/Makefile" ;; + "texinfo/Makefile") CONFIG_FILES="$CONFIG_FILES texinfo/Makefile" ;; + "tex/Makefile") CONFIG_FILES="$CONFIG_FILES tex/Makefile" ;; + "utils/Makefile") CONFIG_FILES="$CONFIG_FILES utils/Makefile" ;; + "testing/Makefile") CONFIG_FILES="$CONFIG_FILES testing/Makefile" ;; + + *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\).*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\).*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || as_fn_error "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + + +eval set X " :F $CONFIG_FILES " +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin" \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 + ;; + + + + esac + +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit $? +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + + --- bbdb-2.35.cvs20080316.orig/configure.ac +++ bbdb-2.35.cvs20080316/configure.ac @@ -23,10 +23,10 @@ dnl Process this file with autoconf to produce a new configure script -AC_PREREQ([2.50]) +AC_PREREQ(2.64) BBDB_PRE_INIT -AC_INIT([BBDB], [BBDB_VERSION], [bbdb-info@lists.sourceforge.net]) +AC_INIT([BBDB],[BBDB_VERSION],[bbdb-info@lists.sourceforge.net]) AC_COPYRIGHT([Copyright (C) 2000-2001 Didier Verna .]) @@ -83,29 +83,24 @@ # this seems far messier and more complex than I'd expect from autoconf... AC_ARG_ENABLE([vm], - AC_HELP_STRING([--enable-vm], - [enable VM hooks (default depends on --with-vm-dir)]), + AS_HELP_STRING([--enable-vm],[enable VM hooks (default depends on --with-vm-dir)]), [if test "x$enableval" = "xno"; then BBDB_VM=; enable_vm=; else BBDB_VM=vm; fi]) AC_ARG_ENABLE(rmail, - AC_HELP_STRING([--enable-rmail], - [enable RMAIL hooks [[no]]]), + AS_HELP_STRING([--enable-rmail],[enable RMAIL hooks [[no]]]), [if test "x$enableval" = "xno"; then BBDB_RMAIL=; enable_rmail=; else BBDB_RMAIL=rmail; fi], [BBDB_RMAIL=]) AC_ARG_ENABLE(gnus, - AC_HELP_STRING([--enable-gnus], - [enable GNUS hooks [[yes]]]), + AS_HELP_STRING([--enable-gnus],[enable GNUS hooks [[yes]]]), [if test "x$enableval" = "xno"; then BBDB_GNUS=; enable_gnus=; else BBDB_GNUS=gnus; fi], [BBDB_GNUS=]) AC_ARG_ENABLE(mhe, - AC_HELP_STRING([--enable-mhe], - [enable MH-E hooks (default depends on --with-mhe-dir)]), + AS_HELP_STRING([--enable-mhe],[enable MH-E hooks (default depends on --with-mhe-dir)]), [if test "x$enableval" = "xno"; then BBDB_MHE=; enable_mhe=; else BBDB_MHE=mhe; fi], [BBDB_MHE=]) dnl All this does for now is allows you to see the compile commands AC_ARG_ENABLE(developer, - AC_HELP_STRING([--enable-developer], - [enable developer hooks [[no]]]), + AS_HELP_STRING([--enable-developer],[enable developer hooks [[no]]]), [if test "x$enable" = "xno"; then HUSHMAKE=; fi], [HUSHMAKE=@]) BBDB_ARG_SUBST([OTHERDIRS], [other-dirs], [DIRS], --- bbdb-2.35.cvs20080316.orig/ChangeLog +++ bbdb-2.35.cvs20080316/ChangeLog @@ -1,3 +1,10 @@ +2009-11-18 Barak A. Pearlmutter + + * lisp/bbdb-rmail.el (bbdb/rmail-get-header-content): Fix RMAIL + insinuation in GNU Emacs23 by using rmail-get-header when + available, thus avoiding rmail-narrow-to-non-pruned-header, which + no longer exists in GNU Emacs 23. + 2008-01-29 Didier Verna * lisp/bbdb-gnus.el (bbdb/gnus-summary-get-author): Use the proper --- bbdb-2.35.cvs20080316.orig/debian/bbdb.emacsen-remove +++ bbdb-2.35.cvs20080316/debian/bbdb.emacsen-remove @@ -0,0 +1,36 @@ +#!/bin/sh +# /usr/lib/emacsen-common/packages/remove/bbdb + +# I don't think that remove scripts should have -e set, because +# that makes the package unremovable if the script fails. +# set -e + +FLAVOR=$1 +PACKAGE="bbdb" + +if [ "X${FLAVOR}" = "X" ]; then + echo Need argument to determine FLAVOR of emacs; + exit 1 +fi + +if [ "X${PACKAGE}" = "X" ]; then + echo Internal error: need package name; + exit 1; +fi + +ELDIR=/usr/share/emacs/site-lisp/${PACKAGE} +ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE} + +case "${FLAVOR}" in + emacs) + echo "remove/${PACKAGE}: Ignoring Flavor ${FLAVOR} ..." + ;; + *) + echo -n "remove/${PACKAGE}: Handling removal of emacsen flavor ${FLAVOR} ..." + rm -rf ${ELCDIR} + + echo " done." + ;; +esac + +exit 0; --- bbdb-2.35.cvs20080316.orig/debian/bbdb-areacode-split.1 +++ bbdb-2.35.cvs20080316/debian/bbdb-areacode-split.1 @@ -0,0 +1,46 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH BBDB-AREACODE-SPLIT.PL 1 "March 31, 2002" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +bbdb-areacode-split \- Looks for phone numbers in your .bbdb +.SH SYNOPSIS +.B bbdb-areacode-split + [bbdb] +.SH DESCRIPTION +Looks for phone numbers in your .bbdb with a particular area code +and one of a set of exchanges and changes the area code. The old +and new area codes are specified on the command line, as is the +location of a file that contains the exchanges that are being +changed. (The format of that file is very loose. Every three digit +sequence will be used.) + +This manual page was written for the Debian distribution +because the original program does not have a manual page. +Instead, it has documentation in the GNU Info format; see below. +.SH SEE ALSO +.BR bbdb-cid (1), +.BR bbdb-unlazy-lock (1). +.BR bbdb-srv (1). +.br +The bbdb is fully documented by +.IR "The insidious Big Brother Database for mail and news" , +available via the Infonode +.BR bbdb +. +.SH AUTHOR +This manual page was written by Joerg Jaspert (JJ) , +for the Debian GNU/Linux system (but may be used by others). --- bbdb-2.35.cvs20080316.orig/debian/bbdb-cid.1 +++ bbdb-2.35.cvs20080316/debian/bbdb-cid.1 @@ -0,0 +1,45 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH BBDB-CID.PL 1 "March 31, 2002" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +bbdb-cid \- Caller-ID-logger +.SH SYNOPSIS +.B bbdb-cid +.SH DESCRIPTION +Opens the modem and waits for it to print caller-ID data. When it does, +it logs it to a file, parses it, and pops up a window using "xmessage". +If the number is present in your .bbdb file, it shows the name (or company) +associated with it. + +.IR "You have to edit the Skript and change it to fit into your System!" + +This manual page was written for the Debian distribution +because the original program does not have a manual page. +Instead, it has documentation in the GNU Info format; see below. +.SH SEE ALSO +.BR bbdb-areacode-split (1), +.BR bbdb-unlazy-lock (1). +.BR bbdb-srv (1). +.br +The bbdb is fully documented by +.IR "The insidious Big Brother Database for mail and news" , +available via the Infonode +.BR bbdb +. +.SH AUTHOR +This manual page was written by Joerg Jaspert (JJ) , +for the Debian GNU/Linux system (but may be used by others). --- bbdb-2.35.cvs20080316.orig/debian/rules +++ bbdb-2.35.cvs20080316/debian/rules @@ -0,0 +1,44 @@ +#!/usr/bin/make -f + +build clean install binary-arch binary-indep binary: + dh $@ + +.PHONY: build clean install binary-arch binary-indep binary + +## The default upstream build process compiles the .el files, and +## therefore needs a working emacs. The debian packaging process +## leaves this to install time, so at build time we do not actually +## need an emacs. The --with-emacs=/bin/echo prevents the +## configuration process from getting an error on the autobuilders +## when no emacs is installed. + +override_dh_auto_configure: + if [ ! -x configure ]; then chmod +x configure; fi # debian.diff fails to +x + dh_auto_configure -- --with-emacs=/bin/echo + +override_dh_auto_build: bits.tar.gz + $(MAKE) -C texinfo bbdb.info bbdb.pdf + mkdir -p texinfo/bbdb + cd texinfo/bbdb && texi2html -split=chapter ../bbdb.texinfo + if [ -d texinfo/bbdb/bbdb ]; then \ + echo Compensating for old texi2html putting output in subdirectory.; \ + mv texinfo/bbdb/bbdb/* texinfo/bbdb/; \ + rmdir texinfo/bbdb/bbdb; \ + fi + +override_dh_install: + dh_install + @echo Give perl executables to implementation-agnostic filenames + cd debian/bbdb/usr/bin && \ + for f in *.pl; do \ + mv $$f $$(basename $$f .pl); \ + done + @echo Apply Debian patches + for f in $$(find debian/patches -name '*.patch'); do \ + echo applying patch: $$f ; \ + d=debian/bbdb/usr/share/emacs/site-lisp/bbdb ; \ + patch $$d/$$(echo $$f | sed 's|^debian/patches/\(.*\)[.]patch$$|\1|') $$f; \ + done + +bits.tar.gz: + tar -czf bits.tar.gz bits/ --- bbdb-2.35.cvs20080316.orig/debian/bbdb.docs +++ bbdb-2.35.cvs20080316/debian/bbdb.docs @@ -0,0 +1,2 @@ +bits.tar.gz +texinfo/bbdb.pdf --- bbdb-2.35.cvs20080316.orig/debian/bbdb-unlazy-lock.1 +++ bbdb-2.35.cvs20080316/debian/bbdb-unlazy-lock.1 @@ -0,0 +1,41 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH BBDB-UNLAZY-LOCK.PL 1 "March 31, 2002" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +bbdb--unlazy-lock \- Removes crap from lazy-lock from your .bbdb +.SH SYNOPSIS +.B bbdb-unlazy-lock +.SH DESCRIPTION +Lazy-lock-mode has (had) a nasty habit of munging .bbdb files if you +visited them with it on. This script removes the lazy-lock mung + +This manual page was written for the Debian distribution +because the original program does not have a manual page. +Instead, it has documentation in the GNU Info format; see below. +.SH SEE ALSO +.BR bbdb-areacode-split (1), +.BR bbdb-unlazy-lock (1). +.BR bbdb-srv (1). +.br +The bbdb is fully documented by +.IR "The insidious Big Brother Database for mail and news" , +available via the Infonode +.BR bbdb +. +.SH AUTHOR +This manual page was written by Joerg Jaspert (JJ) , +for the Debian GNU/Linux system (but may be used by others). --- bbdb-2.35.cvs20080316.orig/debian/bbdb.install +++ bbdb-2.35.cvs20080316/debian/bbdb.install @@ -0,0 +1,8 @@ +Makefile usr/share/emacs/site-lisp/bbdb +lisp/*.el usr/share/emacs/site-lisp/bbdb/lisp +lisp/Makefile usr/share/emacs/site-lisp/bbdb/lisp +utils/*.el usr/share/emacs/site-lisp/bbdb/utils +debian/bbdb-pilot-jwz.el usr/share/emacs/site-lisp/bbdb +tex/*.tex usr/share/texmf/tex/bbdb +texinfo/bbdb/*.html usr/share/doc/bbdb/html +utils/*.pl usr/bin --- bbdb-2.35.cvs20080316.orig/debian/bbdb-srv.1 +++ bbdb-2.35.cvs20080316/debian/bbdb-srv.1 @@ -0,0 +1,60 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH BBDB-SRV.PL 1 "March 31, 2002" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +bbdb-srv \- Converts Mail-Headers to an Emacs-Lisp String. +.SH SYNOPSIS +.B echo "Some Headers" | bbdb-srv +.SH DESCRIPTION +This script reads a block of message headers on stdin, and converts them +to an emacs-lisp string (quoting all dangerous characters) and then +uses the `gnudoit' program to cause a running Emacs process to invoke +the `bbdb-srv' function with that string. + +This has the effect of causing the running Emacs to display the BBDB +record corresponding to these headers. + +See the Emacs side of things in bbdb-srv.el for more info. + +A trivial application of this is the shell command: + + echo 'From: Jamie Zawinski ' | bbdb-srv.perl + +which will cause the corresponding record to be displayed. +A more interesting application of this is: + + setenv NS_MSG_DISPLAY_HOOK bbdb-srv.perl + +which will hook BBDB up to Mozilla (Unix Netscape Mail and Netscape News +versions 3.0b2 and later only.) + +This manual page was written for the Debian distribution +because the original program does not have a manual page. +Instead, it has documentation in the GNU Info format; see below. +.SH SEE ALSO +.BR bbdb-areacode-split (1), +.BR bbdb-unlazy-lock (1). +.BR bbdb-srv (1). +.br +The bbdb is fully documented by +.IR "The insidious Big Brother Database for mail and news" , +available via the Infonode +.BR bbdb +. +.SH AUTHOR +This manual page was written by Joerg Jaspert (JJ) , +for the Debian GNU/Linux system (but may be used by others). --- bbdb-2.35.cvs20080316.orig/debian/copyright +++ bbdb-2.35.cvs20080316/debian/copyright @@ -0,0 +1,70 @@ +This package was debianized by Frederic Lepied on +Mon, 17 Oct 1997 23:09:25 +0200. + +Actual Maintainer: Joerg Jaspert + +It was downloaded from http://bbdb.sourceforge.net/ + +Authors: Jamie Zawinski, Ronan Waide (Waider), Todd Kaufmann, + Boris Goldowsky, Christopher Kline, John Heidemann, + Roland McGrath + +Current Upstream: Ronan Waide + +Copyright: + +Copyright subsets of 1991-2001, subsets of Jamie Zawinski, Ronan Waide (Waider), + Todd Kaufmann, Boris Goldowsky, Christopher Kline, John Heidemann, + Roland McGrath + lisp/* + texinfo/* + tex/* + utils/* + +Copyright (c) 1997-1999 Matt Simmons + texinfo/bbdb.texinfo + +Copyright (c) 2000 Alex Schroeder + misc/bbdb-unmigrate-stuff.el + +Copyright 1995 Neda Communications, Inc. + bits/bbdb-filters/doc/main.texinfo + bits/bbdb-filters/bbdb-filters-0.2.sh + +Copyright (C) 1998 Ivar Rummelhoff + bits/bbdb-anniv.el + +Copyright (C) 1999, 2000, 2001 Shenghuo ZHU + bits/bbdb-edit.el + +Copyright (C) 1998,2000 by Niels Elgaard Larsen + bits/bbdb-ldif.el + +Copyright (C) 2001 Colin Rafferty + bits/bbdb-obsolete.el + +Copyright (C) 1997,1999 Kevin Davidson + bits/bbdb-pgp.el + bits/bbdb-signature.el + +Copyright (C) 1997 Kevin Davidson +Copyright (C) 1985, 1986, 1992 Free Software Foundation, Inc + bits/bbdb-signature.el + +;;; The Insidious Big Brother Database is free software; you can redistribute +;;; it and/or modify it under the terms of the GNU General Public License as +;;; published by the Free Software Foundation; either version 2, or (at your +;;; option) any later version. +;;; +;;; BBDB is distributed in the hope that it will be useful, but WITHOUT ANY +;;; WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +;;; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +;;; details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Emacs; see the file COPYING. If not, write to +;;; the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +;;; MA 02110-1301, USA. + +On Debian systems, the complete text of the GNU General Public License +version 2 can be found in /usr/share/common-licenses/GPL-2 file. --- bbdb-2.35.cvs20080316.orig/debian/bbdb.manpages +++ bbdb-2.35.cvs20080316/debian/bbdb.manpages @@ -0,0 +1,4 @@ +debian/bbdb-areacode-split.1 +debian/bbdb-cid.1 +debian/bbdb-srv.1 +debian/bbdb-unlazy-lock.1 --- bbdb-2.35.cvs20080316.orig/debian/bbdb.info +++ bbdb-2.35.cvs20080316/debian/bbdb.info @@ -0,0 +1 @@ +texinfo/bbdb.info --- bbdb-2.35.cvs20080316.orig/debian/README.Debian +++ bbdb-2.35.cvs20080316/debian/README.Debian @@ -0,0 +1,69 @@ +To enable bbdb support add a call to bbdb-initialize in your .emacs: + +bbdb-initialize is a compiled Lisp function in `bbdb'. +(bbdb-initialize &rest TO-INSINUATE) + +*Initialize the BBDB. One or more of the following symbols can be +passed as arguments to initiate the appropriate insinuations. + + Initialization of mail/news readers: + + Gnus Initialize BBDB support for the Gnus version 3.14 or + older. + gnus Initialize BBDB support for the Gnus mail/news reader + version 3.15 or newer. If you pass the `gnus' symbol, + you should probably also pass the `message' symbol. + mh-e Initialize BBDB support for the MH-E mail reader. + rmail Initialize BBDB support for the RMAIL mail reader. + sendmail Initialize BBDB support for sendmail (M-x mail). + vm Initialize BBDB support for the VM mail reader. + NOTE: For the VM insinuation to work properly, you must + either call `bbdb-initialize' with the `vm' symbol from + within your VM initialization file ("~/.vm") or you + must call `bbdb-insinuate-vm' manually from within your + VM initialization file. + + Initialization of miscellaneous package: + + message Initialize BBDB support for Message mode. + reportmail Initialize BBDB support for the Reportmail mail + notification package. + sc Initialize BBDB support for the Supercite message + citation package. + w3 Initialize BBDB support for Web browsers. + +---+++--- + +In bits.tar.gz is the bits/ Subdir of the bbdb-Source packaged. +The README there states this: + +This is the collection of bits and pieces located on the net or mailed to me +by various folk that may or may not wind up in BBDB proper. They shouldn't +be considered part of the bbdb as-is, nor should you complain to me about +their failure to work. + +Look at it if you find something useful. If there is enough demand for some of the +files i can install them with bbdb. Just ask me. :) + +---------------------------------------------------------------- + +Trying to bring up-to-date, and make compatible with Emacs23 RMAIL. + +Imported via: + git cvsimport -v -C bbdb -s -k -u -a bbdb -d :pserver:anonymous@bbdb.cvs.sourceforge.net:/cvsroot/bbdb +on 17-Nov-2009 + +(the -s -k was a bug, as it substitutes "-k" for "/" in tags, oops, +thus disabling the -k, double oops.) + +Manually merged Debian patches and tagged Debian releases. + +Note that the upstream CVS repo did not contain the ./configure file, +while the upstream .orig tarballs do. I have left these out. + +To do an incremental update with upstream changes: + cd src/git/bbdb + git cvsimport -v -i -r origin -k -u -a -d :pserver:anonymous@bbdb.cvs.sourceforge.net:/cvsroot/bbdb bbdb + gitk --all; git merge origin/origin + + -- Barak A. Pearlmutter , Thu, 7 Jan 2010 19:03:03 +0100 --- bbdb-2.35.cvs20080316.orig/debian/bbdb.emacsen-install +++ bbdb-2.35.cvs20080316/debian/bbdb.emacsen-install @@ -0,0 +1,120 @@ +#!/bin/sh +# /usr/lib/emacsen-common/packages/install/bbdb + +FLAVOR=$1 +PACKAGE="bbdb" + +if [ "X${FLAVOR}" = "X" ]; then + echo Need argument to determine FLAVOR of emacs; + exit 1 +fi + +if [ "X${PACKAGE}" = "X" ]; then + echo Internal error: need package name; + exit 1; +fi + +ELDIR=/usr/share/emacs/site-lisp/${PACKAGE} +ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE} + +COMPILE="-q -batch -f batch-byte-compile" + +case "${FLAVOR}" in + emacs) + echo "install/${PACKAGE}: Ignoring Flavor ${FLAVOR} ..." + ;; + *) + + echo "install/${PACKAGE}: Byte-compiling for ${FLAVOR} ..." + + rm -rf ${ELCDIR} + cd ${ELDIR} + TARGETS="rmail mhe gnus bbdb" + + if [ -d /usr/share/${FLAVOR}/site-lisp/vm ]; then + TARGETS="$TARGETS vm" + elif [ ${FLAVOR} = xemacs20 -o ${FLAVOR} = xemacs21 ]; then + TARGETS="$TARGETS vm" + fi + + if [ ${FLAVOR} = emacs19 -o ${FLAVOR} = mule2 ]; then + MHEDIR=/usr/share/${FLAVOR}/site-lisp/../lisp + elif [ ${FLAVOR} = xemacs20 -o ${FLAVOR} = xemacs21 ]; then + MHEDIR=/usr/share/${FLAVOR}/site-lisp/../lisp/mh-e + else # emacs20 + MHEDIR=/usr/share/${FLAVOR}/site-lisp/../lisp/mail + fi + + ## for Gnus + if [ -d /usr/share/${FLAVOR}/site-lisp/gnus ]; then + GNUSDIR=/usr/share/${FLAVOR}/site-lisp/gnus + elif [ -d /usr/share/${FLAVOR}/site-lisp/semi-gnus ]; then + GNUSDIR=/usr/share/${FLAVOR}/site-lisp/semi-gnus + elif [ -d /usr/share/${FLAVOR}/site-lisp/t-gnus ]; then + GNUSDIR=/usr/share/${FLAVOR}/site-lisp/t-gnus + elif [ -d /usr/share/${FLAVOR}/site-lisp/chaos ]; then + GNUSDIR=/usr/share/${FLAVOR}/site-lisp/chaos + fi + + if [ -z ${GNUSDIR} ]; then + if [ ${FLAVOR} = emacs19 -o ${FLAVOR} = mule2 ]; then + GNUSDIR=/usr/share/emacs/19.34/lisp + elif [ ${FLAVOR} = xemacs20 ]; then + GNUSDIR=/usr/lib/xemacs-20.4/lisp/gnus + elif [ ${FLAVOR} = xemacs21 ]; then + GNUSDIR=/usr/share/xemacs21/packages/lisp/gnus + else + GNUSDIR=/usr/share/${FLAVOR}/site-lisp/../lisp/gnus + fi + fi + + LOG=`tempfile` + + rm -rf ${ELCDIR} && cp -a ${ELDIR} ${ELCDIR} + + # at ELCDIR + ( cd ${ELCDIR} + echo "Generating bbdb-autoloads..." + echo "Generating bbdb-autoloads" >> $LOG + make autoloads >> $LOG 2>&1 + if [ $FLAVOR != xemacs20 -a $FLAVOR != xemacs21 ]; then + echo "(provide 'bbdb-autoloads)" >> lisp/bbdb-autoloads.el + fi + echo "Byte-compiling bbdb. This takes looooooong..." + make $TARGETS EMACS_PROG=${FLAVOR} VMDIR=/usr/share/${FLAVOR}/site-lisp/vm GNUSDIR=${GNUSDIR} MHEDIR=${MHEDIR} >> $LOG 2>&1 + mv lisp/*.elc utils/*.el . + rm -rf tex utils lisp Makefile + ${FLAVOR} ${COMPILE} *.el >> $LOG 2>&1 + ) + cat > ${ELCDIR}/load-path.el <> $LOG + echo "install -m 644 ${ELDIR}/lisp/bbdb-gnus.el ${ELCDIR}" >> $LOG + install -m 644 ${ELDIR}/lisp/bbdb-gnus.el ${ELCDIR} + fi + + # a hack to fix #179821, #210248, #233904 + # If bbdb gets installed before vm then the bbdb doesnt have the bbdb-vm compiled.... + install -m 644 ${ELDIR}/lisp/bbdb-vm.el ${ELCDIR} + + # make -k clean >> $LOG + mv $LOG ${ELCDIR}/CompilationLog + gzip -9 ${ELCDIR}/CompilationLog + chmod 644 ${ELCDIR}/CompilationLog.gz + + # make symlinks for source files that were not copied over to ELCDIR + # this makes find-function and find-library work properly + cd ${ELDIR}/lisp + for f in *.el; do + if [ -e ${ELCDIR}/${f}c ] && [ ! -e ${ELCDIR}/${f} ]; then + ln -sf ${ELDIR}/lisp/${f} ${ELCDIR}/${f} + fi + done + + echo " done." + ;; +esac + --- bbdb-2.35.cvs20080316.orig/debian/bbdb-pilot-jwz.el +++ bbdb-2.35.cvs20080316/debian/bbdb-pilot-jwz.el @@ -0,0 +1,584 @@ +;;; bbdb-pilot-jwz.el --- bbdb to palmos address book conduit + +;; Copyright (C) 1999 Jamie Zawinski , all rights reserved. + +;; Maintainer: Noah Friedman +;; Created: 2000-01-21 + +;; $Id: bbdb-pilot-jwz.el,v 1.8 2001/06/19 03:45:37 friedman Exp $ + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with this program; if not, you can either send email to this +;; program's maintainer or write to: The Free Software Foundation, +;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. + +;;; Commentary: + +;; pilot-addresses expects a file with the following 19 fields: +;; +;; Last Name +;; First Name +;; Title +;; Company +;; Named Field 1 (default: Work) +;; Named Field 2 (default: Home) +;; Named Field 3 (default: Fax) +;; Named Field 4 (default: Other) +;; Named Field 5 (default: E-mail) +;; Address +;; City +;; State +;; Zip +;; Country +;; Custom 1 +;; Custom 2 +;; Custom 3 +;; Custom 4 +;; Note +;; +;; The "named fields" are the ones that have a field title that can be set +;; with a popup menu. The available titles are: +;; +;; Work +;; Home +;; Fax +;; Other +;; E-mail +;; Main +;; Pager +;; Mobile +;; +;; A record in the file consists of 19 fields followed by a newline. +;; Field values are enclosed in double-quotes and are separated by commas. +;; The "named" fields may also be preceeded by the field name and a +;; semicolon, e.g.: +;; "Home";"(415) 555-1212", +;; +;; Strings may contain newlines, and are read with backslash-decoding +;; (for \n, \t and so on.) +;; +;; Embedded quotes are double-quoted in csv output, e.g. " -> "" + +;;; Code: + +(require 'bbdb) +(require 'cl) + +(defconst bbdb-pilot-field-names + '["Work" "Home" "Fax" "Other" "E-mail" "Main" "Pager" "Mobile"]) + +;; `title' is in this list since, if present, it is handled specially and +;; we do not want to duplicate it in the notes section of each entry. +;; But it's still a user-defined "notes" field as far as bbdb is concerned. +(defconst bbdb-pilot-ignored-notes + '(mail-name mail-alias face mark-char title creation-date timestamp)) + + +(bbdb-defstruct bbdb-pilot- + lastname ; 1 + firstname ; 2 + title ; 3 + company ; 4 + name-1 value-1 ; 5 + name-2 value-2 ; 6 + name-3 value-3 ; 7 + name-4 value-4 ; 8 + name-5 value-5 ; 9 + address ; 10 + city ; 11 + state ; 12 + zip ; 13 + country ; 14 + custom-1 ; 15 + custom-2 ; 16 + custom-3 ; 17 + custom-4 ; 18 + note ; 19 + ) + + +(defun bbdb-pilot-format (pilot) + "Inserts a `pilot-addresses'-compatible description of the `pilot' struct +into the current buffer." + (let ((print-escape-newlines nil) + (print-escape-nonascii nil) + (standard-output (current-buffer))) + (save-restriction + (narrow-to-region (point) (point)) + (prin1 (or (bbdb-pilot-lastname pilot) "")) (insert ",") + (prin1 (or (bbdb-pilot-firstname pilot) "")) (insert ",") + (prin1 (or (bbdb-pilot-title pilot) "")) (insert ",") + (prin1 (or (bbdb-pilot-company pilot) "")) (insert ",") + + (prin1 (or (bbdb-pilot-name-1 pilot) "Other")) (insert ";") + (prin1 (or (bbdb-pilot-value-1 pilot) "")) (insert ",") + + (prin1 (or (bbdb-pilot-name-2 pilot) "Other")) (insert ";") + (prin1 (or (bbdb-pilot-value-2 pilot) "")) (insert ",") + + (prin1 (or (bbdb-pilot-name-3 pilot) "Other")) (insert ";") + (prin1 (or (bbdb-pilot-value-3 pilot) "")) (insert ",") + + (prin1 (or (bbdb-pilot-name-4 pilot) "Other")) (insert ";") + (prin1 (or (bbdb-pilot-value-4 pilot) "")) (insert ",") + + (prin1 (or (bbdb-pilot-name-5 pilot) "Other")) (insert ";") + (prin1 (or (bbdb-pilot-value-5 pilot) "")) (insert ",") + + (prin1 (or (bbdb-pilot-address pilot) "")) (insert ",") + (prin1 (or (bbdb-pilot-city pilot) "")) (insert ",") + (prin1 (or (bbdb-pilot-state pilot) "")) (insert ",") + (prin1 (or (bbdb-pilot-zip pilot) "")) (insert ",") + (prin1 (or (bbdb-pilot-country pilot) "")) (insert ",") + (prin1 (or (bbdb-pilot-custom-1 pilot) "")) (insert ",") + (prin1 (or (bbdb-pilot-custom-2 pilot) "")) (insert ",") + (prin1 (or (bbdb-pilot-custom-3 pilot) "")) (insert ",") + (prin1 (or (bbdb-pilot-custom-4 pilot) "")) (insert ",") + (prin1 (or (bbdb-pilot-note pilot) "")) (insert "\n") + + ;; Replace escaped double quotes (\") with "". + (goto-char (point-min)) + (while (re-search-forward "\\\\\"" nil t) + (replace-match "\"\"" nil t)) + (goto-char (point-max)))) + nil) + + +(defun bbdb-pilot-pretty-print (pilot) + ;; for debugging + (let ((i 0) + (names '["lastname" "firstname" "title" "company" + "name-1" "value-1" "name-2" "value-2" "name-3" "value-3" + "name-4" "value-4" "name-5" "value-5" "address" "city" + "state" "zip" "country" "custom-1" "custom-2" "custom-3" + "custom-4" "note"])) + (while (< i bbdb-pilot-length) + (insert (format "%12s: " (aref names i))) + (let ((s (aref pilot i)) + (print-escape-newlines t)) + (if (null s) (setq s "")) + (insert (format "%S\n" s))) + (setq i (1+ i)))) + nil) + + +(defun bbdb-record-to-pilot-record (record) + "Converts a BBDB record to a Pilot record." + (let ((pilot (make-vector bbdb-pilot-length nil)) + (phones (bbdb-record-phones record)) + (notes (bbdb-record-raw-notes record))) + + (if (stringp notes) + (setq notes (list (cons 'notes notes))) + ;; may be destructively modified later + (setq notes (copy-alist notes))) + + (if (bbdb-record-aka record) + (setq notes + (append notes + (list (cons 'AKA + (mapconcat 'identity + (bbdb-record-aka record) + ",\n")))))) + + ;; These fields are easy... + ;; + (bbdb-pilot-set-lastname pilot (bbdb-record-lastname record)) + (bbdb-pilot-set-firstname pilot (bbdb-record-firstname record)) + (bbdb-pilot-set-title pilot (bbdb-record-getprop record 'title)) + (bbdb-pilot-set-company pilot (bbdb-record-company record)) + + ;; Now do the phone numbers... + ;; + (let ((pilot-phones '())) + (while phones + (let ((loc (bbdb-phone-location (car phones))) + (num (bbdb-phone-string (car phones))) + field) + (cond ((string-match "\\b\\(work\\|office\\)" loc) + (setq field "Work")) + ((string-match "\\b\\(home\\)" loc) + (setq field "Home")) + ((string-match "\\b\\(fax\\|facs?imile\\)" loc) + (setq field "Fax")) + ((string-match "\\b\\(pager?\\|beeper\\)" loc) + (setq field "Pager")) + ((string-match "\\b\\(cell\\|mobile\\)" loc) + (setq field "Mobile")) + ((string-match "\\b\\(voice\\|main\\|phone\\)\\b" loc) + (setq field "Main")) + (t + ;; If we don't recognise the phone label, then call it + ;; "Other" but preserve the original label in the field + ;; itself. + (setq field "Other" + num (concat loc ": " num)))) + + ;; If this phone number is the same type as one previously seen + ;; (e.g. there are two pager numbers), append with a newline to + ;; the existing entry. This makes it possible to group multiple + ;; numbers in the same pilot field and make room for more numbers + ;; of different loc types. + (let ((seen (assoc field pilot-phones))) + (if seen + (setcdr seen (concat (cdr seen) "\n" num)) + (setq pilot-phones (cons (cons field num) pilot-phones)))) + (setq phones (cdr phones)))) + (setq pilot-phones (nreverse pilot-phones)) + + ;; The email field goes last in the list of phone fields + (if (bbdb-record-net record) + (let ((c (cons "E-mail" (car (bbdb-record-net record))))) + (setq pilot-phones (nconc pilot-phones (list c))))) + + (if (cdr (bbdb-record-net record)) + (setq notes + (cons (cons 'other-email + (mapconcat 'identity + (cdr (bbdb-record-net record)) + ",\n")) + notes))) + + (let (pp) + (setq pp (pop pilot-phones)) + (bbdb-pilot-set-name-1 pilot (car pp)) + (bbdb-pilot-set-value-1 pilot (cdr pp)) + + (setq pp (pop pilot-phones)) + (bbdb-pilot-set-name-2 pilot (car pp)) + (bbdb-pilot-set-value-2 pilot (cdr pp)) + + (setq pp (pop pilot-phones)) + (bbdb-pilot-set-name-3 pilot (car pp)) + (bbdb-pilot-set-value-3 pilot (cdr pp)) + + ;; We've filled in three phone-number fields. + ;; If there are more than 2 phone numbers left (not counting the + ;; email field), put remaining numbers in 4th field (with their + ;; headings) and put the email address in the 5th field. + (cond ((< (length pilot-phones) 3) + (setq pp (pop pilot-phones)) + (bbdb-pilot-set-name-4 pilot (car pp)) + (bbdb-pilot-set-value-4 pilot (cdr pp)) + + (setq pp (pop pilot-phones)) + (bbdb-pilot-set-name-5 pilot (car pp)) + (bbdb-pilot-set-value-5 pilot (cdr pp))) + (t + (let* ((email (assoc "E-mail" pilot-phones)) + (val + (mapconcat + #'(lambda (pp) + (let ((p 0) s) + ;; If there are newlines in the data, make sure + ;; each new line begins with the field name + ;; since this record is heterogenous. + (while (string-match "\n" (cdr pp) p) + (setq s (concat "\n" (car pp) ": ")) + (setq p (+ (match-end 0) (length s))) + (setcdr pp (replace-match s t t (cdr pp))))) + (concat (car pp) ": " (cdr pp))) + (delq email pilot-phones) "\n"))) + (bbdb-pilot-set-name-4 pilot "Other") + (bbdb-pilot-set-value-4 pilot val) + + (bbdb-pilot-set-name-5 pilot (car email)) + (bbdb-pilot-set-value-5 pilot (cdr email))))))) + + ;; Now do the addresses... + ;; Put the first address in the address field, and the others + ;; in the "custom" fields. + ;; + (let* ((addrs (bbdb-record-addresses record)) + (addr1 (pop addrs))) + (cond + (addr1 + (let (st) + (cond ((>= bbdb-file-format 6) + (setq st (bbdb-join (bbdb-address-streets addr1) "\n"))) + (t + (setq st (bbdb-address-street1 addr1)) + (if (> (length (bbdb-address-street2 addr1)) 0) + (setq st (concat st "\n" (bbdb-address-street2 addr1)))) + (if (> (length (bbdb-address-street3 addr1)) 0) + (setq st (concat st "\n" (bbdb-address-street3 addr1)))))) + + (setq st (concat (bbdb-address-location addr1) ":\n" st)) + + (bbdb-pilot-set-address pilot st) + (bbdb-pilot-set-city pilot (bbdb-address-city addr1)) + (bbdb-pilot-set-state pilot (bbdb-address-state addr1)) + (bbdb-pilot-set-zip pilot (bbdb-address-zip-string addr1)) + (bbdb-pilot-set-country pilot nil)))) + + (cond + (addrs + (let ((indent-tabs-mode nil) + (formatted '()) + addr c s) + (while addrs + (setq addr (car addrs)) + (save-excursion + (set-buffer (get-buffer-create "*bbdb-tmp*")) + (erase-buffer) + (insert (bbdb-address-location addr) ":\n") + (cond + ((>= bbdb-file-format 6) + (let ((sts (bbdb-address-streets addr))) + (while sts + (indent-to 8) + (insert (car sts) "\n") + (setq sts (cdr sts))))) + (t + (if (= 0 (length (setq s (bbdb-address-street1 addr)))) nil + (indent-to 8) (insert s "\n")) + (if (= 0 (length (setq s (bbdb-address-street2 addr)))) nil + (indent-to 8) (insert s "\n")) + (if (= 0 (length (setq s (bbdb-address-street3 addr)))) nil + (indent-to 8) (insert s "\n")))) + (indent-to 8) + (insert (setq c (bbdb-address-city addr))) + (setq s (bbdb-address-state addr)) + (if (and (> (length c) 0) (> (length s) 0)) (insert ", ")) + (insert s " ") + (insert (bbdb-address-zip-string addr)) + + (setq formatted (cons (buffer-string) formatted)) + (setq addrs (cdr addrs)))) + (setq formatted (nreverse formatted)) + + (bbdb-pilot-set-custom-1 pilot (pop formatted)) + (bbdb-pilot-set-custom-2 pilot (pop formatted)) + (bbdb-pilot-set-custom-3 pilot (pop formatted)) + (if (null (cdr formatted)) + (bbdb-pilot-set-custom-4 pilot (pop formatted)) + (bbdb-pilot-set-custom-4 pilot + (mapconcat 'identity formatted "\n")))))) + ) + + ;; Now handle the notes... + ;; + (let ((losers bbdb-pilot-ignored-notes)) + (while losers + (let ((c (assq (car losers) notes))) + (if c (setq notes (delete c notes)))) + (setq losers (cdr losers)))) + + (bbdb-pilot-set-note pilot + (mapconcat + #'(lambda (cons) + (save-excursion + (set-buffer (get-buffer-create "*bbdb-tmp*")) + (erase-buffer) + (insert (format "%s:\n%s" (car cons) (cdr cons))) + (goto-char (point-min)) + (while (search-forward "\n" nil t) + (replace-match "\n " t t)) + (goto-char (point-max)) + (skip-chars-backward "\n\t ") + (buffer-substring (point-min) (point)))) + notes + "\n\n")) + + pilot)) + + +(defun bbdb-pilot-make-phone (location phone-string) + (let* ((num (make-vector + (if bbdb-north-american-phone-numbers-p + bbdb-phone-length + 2) + nil)) + (p (bbdb-parse-phone-number phone-string))) + (bbdb-phone-set-location num location) + (bbdb-phone-set-area num (nth 0 p)) ; euronumbers too. + (if (= (length num) 2) + nil + (bbdb-phone-set-exchange num (nth 1 p)) + (bbdb-phone-set-suffix num (nth 2 p)) + (bbdb-phone-set-extension num (or (nth 3 p) 0))) + num)) + + +(defun pilot-record-to-bbdb-record (pilot) + "Converts a Pilot record to a BBDB record." + (let ((firstname (bbdb-pilot-firstname pilot)) + (lastname (bbdb-pilot-lastname pilot)) + (company (bbdb-pilot-company pilot)) + (title (bbdb-pilot-title pilot)) ; #### + ;; #### AKA + (net nil) + (addrs '()) + (phones '()) + (pphones '()) + (notes '()) + ) + (if (equal company "") (setq company nil)) + (if (equal title "") (setq title nil)) + (if (equal notes "") (setq notes nil)) + + ;; Process the phone numbers and primary net address... + ;; + (setq pphones (list (cons (bbdb-pilot-name-1 pilot) + (bbdb-pilot-value-1 pilot)) + (cons (bbdb-pilot-name-2 pilot) + (bbdb-pilot-value-2 pilot)) + (cons (bbdb-pilot-name-3 pilot) + (bbdb-pilot-value-3 pilot)) + (cons (bbdb-pilot-name-4 pilot) + (bbdb-pilot-value-4 pilot)) + (cons (bbdb-pilot-name-5 pilot) + (bbdb-pilot-value-5 pilot)))) + (while pphones + (cond ((equal (car (car pphones)) "E-mail") + (setq net (list (cdr (car pphones))))) + ((and (equal (car (car pphones)) "Other") + (string-match "^\\([^ \t\n:]+\\):[ \t]*" + (cdr (car pphones)))) + (let ((a (substring (cdr (car pphones)) + (match-beginning 1) (match-end 1))) + (b (substring (cdr (car pphones)) (match-end 0)))) + (setq phones (cons (bbdb-pilot-make-phone a b) + phones)))) + ((> (length (cdr (car pphones))) 0) + (setq phones (cons (bbdb-pilot-make-phone (car (car pphones)) + (cdr (car pphones))) + phones)))) + (setq pphones (cdr pphones))) + (setq phones (nreverse phones)) + + ;; Now parse the primary address... + ;; + (cond ((> (length (bbdb-pilot-address pilot)) 0) + (let ((addr (make-vector bbdb-address-length nil)) + loc sts st1 st2 st3 + (street (bbdb-pilot-address pilot)) + (cty (bbdb-pilot-city pilot)) + (ste (bbdb-pilot-state pilot)) + (zip (bbdb-pilot-zip pilot)) + ) + (if (equal cty "") (setq cty nil)) + (if (equal ste "") (setq ste nil)) + (if (equal zip "") (setq zip nil)) + (if zip (setq zip (bbdb-parse-zip-string zip))) + + (if (string-match "^\\([^ \t\n:]+\\):[ \t\n]*" street) + (setq loc (substring street 0 (match-end 1)) + street (substring street (match-end 0)))) + + (bbdb-address-set-location addr loc) + + (cond + ((>= bbdb-file-format 6) + (while (string-match "^\\([^\n]+\\)\\(\n\\|$\\)" street) + (setq sts (append + sts + (list (substring street 0 (match-end 1)))) + street (substring street (match-end 0)))) + (bbdb-address-set-streets addr sts)) + (t + (if (string-match "^\\([^\n]+\\)\\(\n\\|$\\)" street) + (setq st1 (substring street 0 (match-end 1)) + street (substring street (match-end 0)))) + (if (string-match "^\\([^\n]+\\)\\(\n\\|$\\)" street) + (setq st2 (substring street 0 (match-end 1)) + street (substring street (match-end 0)))) + (if (string-match "^\\([^\n]+\\)\\(\n\\|$\\)" street) + (setq st3 (substring street 0 (match-end 1)) + street (substring street (match-end 0)))) + (bbdb-address-set-street1 addr (or st1 "")) + (bbdb-address-set-street2 addr (or st2 "")) + (bbdb-address-set-street3 addr (or st3 "")))) + + (bbdb-address-set-city addr (or cty "")) + (bbdb-address-set-state addr (or ste "")) + (bbdb-address-set-zip addr zip) + (setq addrs (list addr)) + ))) + + ;; Now parse the secondary addresses... + ;; + (let ((paddrs (list (bbdb-pilot-custom-1 pilot) + (bbdb-pilot-custom-2 pilot) + (bbdb-pilot-custom-3 pilot) + (bbdb-pilot-custom-4 pilot)))) + (while paddrs + (cond + ((car paddrs) + ;; #### parse text to address. fmh. + )) + (setq paddrs (cdr paddrs)))) + + ;; Now parse the notes field. + ;; + ;; #### + + (let ((record + (vector firstname lastname nil company phones addrs net notes + (make-vector bbdb-cache-length nil)))) + record))) + + +;;;###autoload +(defun bbdb-to-pilot-file (filename &optional records) + (interactive "FWrite pilot-addresses file: ") + (or records (setq records (bbdb-records))) + (save-excursion + (set-buffer (find-file-noselect filename)) + (erase-buffer) + (let ((len (length records)) + (i 0)) + (while records + (message "%d%%..." (/ (* 100 i) len)) + (bbdb-pilot-format (bbdb-record-to-pilot-record (car records))) + (setq records (cdr records) + i (1+ i)))) + (save-buffer) + (kill-buffer (current-buffer))) + filename) + + +(defun bbdb-to-pilot () + "Push the current contents of BBDB out to the Pilot." +; (interactive) + (bbdb-records) ; load bbdb + (message "Selecting records...") + (let ((records + (remove-if-not + #'(lambda (record) + (and (or (bbdb-record-name record) + (bbdb-record-company record)) + (let ((phones-p nil) + (phones (bbdb-record-phones record))) + (while phones + (let ((loc (bbdb-phone-location (car phones)))) + (if (and (not (string-match "cid" loc)) + (not (string-match "[?]" loc))) + (setq phones-p t))) + (setq phones (cdr phones))) + phones-p))) + (bbdb-records))) + + (file (format "/tmp/pilot-bbdb-%s-%d-%s" + (user-login-name) (emacs-pid) (float-time)))) + + (bbdb-to-pilot-file file records) + (shell-command (concat "pilot-addresses -p /dev/pilot " + "-d BBDB -c BBDB -r " file + ;;"; rm " file + " &")) + )) + +(provide 'bbdb-pilot-jwz) + +;;; bbdb-pilot-jwz.el ends here --- bbdb-2.35.cvs20080316.orig/debian/control +++ bbdb-2.35.cvs20080316/debian/control @@ -0,0 +1,20 @@ +Source: bbdb +Section: mail +Priority: optional +Maintainer: Joerg Jaspert +Uploaders: Barak A. Pearlmutter +Build-Depends: debhelper (>= 7.2.5) +Build-Depends-Indep: texinfo, ghostscript, texi2html, texlive-base +Standards-Version: 3.8.4 +Vcs-Git: git://github.com/barak/BBDB.git +Vcs-Browser: http://github.com/barak/BBDB +Homepage: http://bbdb.sourceforge.net/ + +Package: bbdb +Architecture: all +Depends: make, emacs23 | emacsen, ${misc:Depends}, ${perl:Depends} +Suggests: vm, w3-el-e21, gnuserv, gnus|t-gnus, perl +Description: The Insidious Big Brother Database (email rolodex) for Emacs + BBDB is a rolodex-like database program for GNU Emacs. BBDB stands + for Insidious Big Brother Database, and is not, repeat, *not* an + obscure reference to the Buck Rogers TV series. --- bbdb-2.35.cvs20080316.orig/debian/changelog +++ bbdb-2.35.cvs20080316/debian/changelog @@ -0,0 +1,424 @@ +bbdb (2.35.cvs20080316-4) unstable; urgency=low + + * prevent debian build-time error when emacs not installed (closes: #571434) + * rev deb std + + -- Barak A. Pearlmutter Fri, 26 Feb 2010 09:04:09 +0000 + +bbdb (2.35.cvs20080316-3) unstable; urgency=low + + * chmod +x configure patch, thanks to Kumar Appaiah (closes: #567197) + + -- Barak A. Pearlmutter Wed, 03 Feb 2010 13:43:30 +0000 + +bbdb (2.35.cvs20080316-2) unstable; urgency=low + + * Misc additional files in bits/ + * Minor packaging tweaks + * Build dependency for /usr/bin/tex (closes: #560582) + + -- Barak A. Pearlmutter Sun, 27 Dec 2009 20:26:22 -0500 + +bbdb (2.35.cvs20080316-1) unstable; urgency=low + + * Merge ongoing changes from upstream. (Closes: #440191) + - Includes menu commands (Closes: #96300) + - Fixes lisp/Makefile.in target extras mixing .el .elc (Closes: #366059) + * Bring into GIT. + * Regenerate debian/Makepatch to accommodate upstream changes. + * Fix RMAIL insinuation in Emacs 23. (Closes: #556993) + * Apply bbdb startup patch from Peter S Galbraith. (Closes: #353937) + * Correct typo. (Closes: #488729) + * Update backquote style in file lisp/bbdb-com.el. (Closes: #475600) + * Update Debian packaging. + - Avoiding double-installing bbdb-pilot-jwz.el file. (Closes: #557356) + - Avoiding double-installing .tex files. + - dh 7. + - rev deb std. + - debian/copyright updates: FSF address, common license location, expand. + - Misc housekeeping and tracking policy. + - Give debian patch files consistent names and locations. + * Switch scripts from /usr/bin/bbdb-FOO.pl to /usr/bin/bbdb-FOO. + * Merge Ununtu patch that symlinks some .el files at emacsen-install time. + * Include PDF documentation. + * Add Barak A. Pearlmutter as co-maintainer. + + -- Barak A. Pearlmutter Tue, 01 Dec 2009 22:10:39 -0500 + +bbdb (2.35.cvs20060204-1.2) unstable; urgency=low + + * NMU with the permission of the maintainer to adjust the dependencies + to accommodate the removal of emacs21. Change the emacs21 dependency + to emacs23 and the emacs21 build dependency to emacs22 or emacs23. + Thanks to Sven Joachim . (Closes: #478799) + + -- Rob Browning Sat, 01 Aug 2009 12:16:02 -0700 + +bbdb (2.35.cvs20060204-1.1) unstable; urgency=low + + * NMU with the permission of the maintainer. + * Set coding system when writing .bbdb file to prevent data corruption. + (Closes: #351778) + + -- Hubert Chan Thu, 13 Apr 2006 15:42:40 +0200 + +bbdb (2.35.cvs20060204-1) unstable; urgency=low + + * New CVS co + - Bug fix: "bbdb-news-auto-create-p with 'prompt doesn't work" (Closes: #296577). + * Bug fix: "bbdb: File error: "Cannot open load file", + 'bbdb-autoloads'" (Closes: #344032, #345186, #345297, #350449, #308336, #279920). + * Bug fix: "bbdb does not work with gnus-5.10", (works for me [TM]) (Closes: #192904). + + -- Joerg Jaspert Sat, 4 Feb 2006 16:32:31 +0100 + +bbdb (2.35.cvs20040528-1) unstable; urgency=low + + * CVS co - last changes there are from 28.05.2004 + * Bug fix: "fails to load : missing bbdb-vm.el". (Closes: #179821, #180024, #210248, #233904). + * Removed | emacs20 from Depends. (Closes: #232731) + * Removed old w3-el-e{20|19} Suggests. + * Bug fix: "bbdb: Include /usr/share/emacs/site-lisp/bbdb/tex/", thanks + to Mario Lang (Closes: #243211). + + -- Joerg Jaspert Wed, 11 Aug 2004 23:12:05 +0200 + +bbdb (2.35.cvs20030801-1) unstable; urgency=low + + * CVS from 01 August 2003. + + -- Joerg Jaspert Sun, 24 Aug 2003 14:51:51 +0200 + +bbdb (2.34.cvs20030503-1) unstable; urgency=low + + * CVS from 03 Mai 2003. + * Removed a suggestion about charsets in .bbdb. It should work without + that (closes: #177625) + + -- Joerg Jaspert Sat, 3 May 2003 20:16:15 +0200 + +bbdb (2.34.cvs20030102-1) unstable; urgency=low + + * CVS checkout from 02 Januar 2003. + * A note in README.Debian about charsets and .bbdb. + (closes: #174006,173817) + * This patch for encoding issues is included upstream (closes: #159339) + * Standards 3.5.8 + + -- Joerg Jaspert Sun, 5 Jan 2003 15:38:42 +0100 + +bbdb (2.34.cvs20021102-1) unstable; urgency=low + + * Newest CVS Checkout. Well, new.... + + -- Joerg Jaspert Wed, 13 Nov 2002 21:02:25 +0100 + +bbdb (2.34.cvs20021027-1) unstable; urgency=low + + * Newest CVS checkout. This is really 2.35 :) + * Standards-Version: 3.5.7 + * Removed mk-binary from debian/ dir, it is not used. + + -- Joerg Jaspert Sun, 27 Oct 2002 16:09:56 +0100 + +bbdb (2.34.cvs20020819-1) unstable; urgency=low + + * Newest CVS checkout. + + -- Joerg Jaspert Tue, 20 Aug 2002 22:20:26 +0200 + +bbdb (2.34.cvs20020703-1) unstable; urgency=low + + * Newest cvs checkout. + * (require 'bbdb-autloads) in startup file (closes: #152435) + + -- Joerg Jaspert Wed, 10 Jul 2002 12:03:34 +0200 + +bbdb (2.34.cvs20020418-3) unstable; urgency=low + + * Added bbdb-pilot-jwz.el as suggested in (closes: #144465) + I dont have a handheld, so i cant test it. (Hint :) ) + + -- Joerg Jaspert Fri, 26 Apr 2002 00:13:03 +0200 + +bbdb (2.34.cvs20020418-2) unstable; urgency=high + + * Urgency=high because the Bugfix for #143463 should really go into + woody. I have not made any other changes in the emacsen-install files, + and there are no Bug Reports since my last Upload, so i think this is OK. + * I now generate some html Pages from the texinfo Source and install the + doc-base things. So you can read the bbdb documentation from your + Webbrowser if you want that. + + -- Joerg Jaspert Sun, 21 Apr 2002 20:02:31 +0200 + +bbdb (2.34.cvs20020418-1) unstable; urgency=low + + * New Upstream release. This fixes bbdb-gui which (closes: #143463) + * Changed my Email Address. + + -- Joerg Jaspert Thu, 18 Apr 2002 20:53:56 +0200 + +bbdb (2.34.cvs20020404-2) unstable; urgency=low + + * Changed emacsen-install: + Hide make autoloads output for the user and redirect it to the Compile-Log + Tell the User that the Byte-Compile of bbdb could be a long-running process. + + -- Joerg Jaspert (JJ) Mon, 8 Apr 2002 15:42:46 +0200 + +bbdb (2.34.cvs20020404-1) unstable; urgency=low + + * If a Variable in Makefile changes between two releases it is very + helpful to change it in the calling installscript too. Thx to + James LewisMoss for this. This (closes: #141207) + * New CVS checkout. bbdb-merge.el changed. + * I now package the bits/ subdir with bbdb. It is *not* official part + of bbdb. So i only make a .tar.gz of it and place it into + /usr/share/doc/bbdb. Have a look at it and see if you find some + things useful. If there is enough demand for one thing i can install it with + bbdb (if License is clear). + + -- Joerg Jaspert (JJ) Thu, 4 Apr 2002 23:48:32 +0200 + +bbdb (2.34.cvs20020330-4) unstable; urgency=low + + * Im so stupid blind. bbdb needs bbdb-autoloads.el. I must generate it before i compile + the package at install-time. If not we have a not existing bbdb-autoloads.el so bbdb + cant load anything and crashes. Argh, i hate me. I shold read INSTALL full. Next time... + I now generate bbdb-autoloads.el and bbdb works again. Sorry for this stupidity. + It (closes: #140968) + + -- Joerg Jaspert (JJ) Wed, 3 Apr 2002 19:45:36 +0200 + +bbdb (2.34.cvs20020330-3) unstable; urgency=low + + * Hmm, i should look if I really remove all installed files between my tests. I left some + crap and all worked fine. So i cant see that Makefile.in is neccessary. + Added it again. + * Apply a patch to the Makefile in /usr/share/emacs/site-lisp which really should remove + checking for configure.ac. This two should (closes: #140868) + + -- Joerg Jaspert (JJ) Tue, 2 Apr 2002 12:38:53 +0200 + +bbdb (2.34.cvs20020330-2) unstable; urgency=low + + * It now works to look at the bbdb info files with emacs, so this + should (closes: #111769) + * It should also (closes: #139287) + * Argh. If i want to install the info files without dh_installinfo i + have to copy them to the Packagedir. + * Suggest tetex-base. + * Install the .tex files for bbdb-print in /usr/share/texmf/tex/bbdb so + one can use bbdb-print without any extra work required. This two + changes are for this: (closes: #101282) + * -1 was not uploaded. So i just close the bug here again. + New Maintainer. (closes: #140041) + * gzip -9 for Readme.Debain + * Remove unneccessary Makefile.in from bbdb/lisp dir. + + -- Joerg Jaspert (JJ) Mon, 1 Apr 2002 13:44:19 +0200 + +bbdb (2.34.cvs20020330-1) unstable; urgency=low + + * New Maintainer. (closes: #140041) + * My first Emacs-addon Package. Hope it works. + * New Version. Used CVS from 30 March 2002 + * Added w3-el-e21 to Suggests. + * Changed URL in debian/copyright to point to right Site. + * Changed Path for License to /usr/share/common-license + * Disabled dh_installinfo in debian/rules. We do it manually so we dont need + to double it. + * Dont install Upstream README. Its just four words: Read the INSTALL file. We + dont need this for a Debian Package. :) + * Remove Files generated by configure or build-process which are not removed by + Upstream Makefiles clean target. + * Changed Depends to emacs21 | emacsen to make Lintian happy. + * Wrote manpages for the 4 Perlskripts. Better than a link to dh_undocumented. + * Use sed to change the Target all in the Makefiles so emacs-install could work. + We dont want to check for configure there so we dont check for it. :) + + -- Joerg Jaspert (JJ) Sun, 31 Mar 2002 20:15:42 +0200 + +bbdb (2.32-2) unstable; urgency=low + + * don't install FLAVOR/etc/bbdb (closes: #123612) + tex be isntalled into document directory + utils/*.el be installed into site-lisp/bbdb with byte-compile + utils/*.pl be installed into /usr/bin/ + * install /etc/emacs/site-start.d/50bbdb.el as conffile + * Build-Depends: debhelper (>> 3.0.0) + * Standards-Version: 3.5.2 + * DH_COMPAT=3 + + -- Takuo KITAME Thu, 13 Dec 2001 00:45:23 +0900 + +bbdb (2.32-1) unstable; urgency=low + + * New upstream release + * fixed bashizm of emacsen-install (closes: Bug#98574) + * remove (require 'message) from init.el (closes: Bug#109062) + + -- Takuo KITAME Sat, 25 Aug 2001 11:23:09 +0900 + +bbdb (2.3-2) unstable; urgency=low + + * debian/emacsen-install: insert (provide 'bbdb-autoloads) if not xemacs20 or xemacs21. (closes: Bug#88471) + + -- Takuo KITAME Mon, 5 Mar 2001 00:24:20 +0900 + +bbdb (2.3-1) unstable; urgency=low + + * New upstream release + * some upstream bug ware fixed (closes: Bug#86816,Bug#83920,Bug#83601) + * fix #85283: bbdb doesn't load bbdb-autoload (closes: Bug#85283) + * fix #82338: bbdb: upgrade leaves files behind (closes: Bug#82338) + * fix #85019: bbdb complains about nonexistent directory (closes: Bug#85019) + * fix #78721: calls switch-to-buffer(-1) on exit, xemacs doesn't like this (closes: Bug#78721) + + -- Takuo KITAME Sun, 4 Mar 2001 02:51:34 +0900 + +bbdb (2.2-1) unstable; urgency=low + + * New upstream release + * cloese: #82338: bbdb: upgrade leaves files behind + * closes: #81653: bbdb-complete-name fails, + * closes: #78564: bbdb breaks gnus + * closes: #80838: bbdb: perl scripts broken + + -- Takuo KITAME Fri, 26 Jan 2001 11:57:09 +0900 + +bbdb (2.00.06.20001116cvs-1) unstable; urgency=low + + * New upstream release + + -- Takuo KITAME Wed, 29 Nov 2000 08:22:33 +0900 + +bbdb (2.00.06.20001015cvs-3) unstable; urgency=low + + * Support xemacs21 (clsoes: Bug#76254) + + -- Takuo KITAME Mon, 13 Nov 2000 10:21:54 +0900 + +bbdb (2.00.06.20001015cvs-2) unstable; urgency=low + + * install info + * debian/bbdb-init.el: + (require 'bbdb) + (bbdb-initialize) + * lisp/bbdb.el: at defun bbdb-insinuate-message, + (if (not (boundp 'message-mode-map)) + (require 'message)) + (closes: Bug#74998) + + -- Takuo KITAME Wed, 18 Oct 2000 11:04:30 +0900 + +bbdb (2.00.06.20001015cvs-1) unstable; urgency=low + + * New upstream release (CVS snapshot) + * closes: Bug#72315 bbdb 2.00 is known not to work with Emacs 20. + * debian/control: Suggests: w3-el-e20|w3-el-e19 instead of w3-el. + (closes: Bug#74194) + * put perl script. (closes: Bug#72481) + * from lisp/bbdb-hooks.el, + ;; Revision 1.58 2000/04/05 17:09:06 bbdb-writer + ;; * Autoload cookie for bbdb-header-start + It seems Bug#69182 was fixed. (closes: Bug#69182) + * (setq bbdb-electric-p t) is worked. I think it was fixed by Upstream. + (closes: Bug#52453) + * applied view-mode -1 patch. (closes: Bug#48805) + + -- Takuo KITAME Tue, 17 Oct 2000 16:06:12 +0900 + +bbdb (2.00.06-1) unstable; urgency=low + + * New upstream release (closes: Bug#48316, Bug#19262) + * Work well on XEmacs (closes: Bug#12086) + * removing usr/share/xemacs20/etc/bbdb when package remove. + It was fixed in previous release. (closes: Bug#52527) + * install.log will be created as mode 644. (closes: Bug#55433) + + -- Takuo KITAME Wed, 29 Mar 2000 03:09:33 +0900 + +bbdb (2.00-6) frozen unstable; urgency=high + + * Maintainer was changed. + * Fixed install script for bbdb-gnus.el (closes: Bug#59177) + + -- Takuo KITAME Tue, 28 Mar 2000 13:30:34 +0900 + +bbdb (2.00-5) unstable frozen; urgency=high + + * ignore xemacs21 in the install stage. Closes: Bug#55432. + + -- Frederic Lepied Thu, 24 Feb 2000 09:36:47 +0100 + +bbdb (2.00-4) unstable; urgency=low + + * applied documentation fixes from . Closes: Bug#36225. + * (bbdb-print.el): corrected invalid condition-case. Closes: Bug#36846, Bug#44355, Bug#44364. + * removed itimer Suggests:. + * really install README.debian. Closes: Bug#26687. + * (bbdb-print.el): hard code the location of TeX files. CLoses: Bug#36844. + * (bbdb-print.tex): applied patch from Mattia Monga to correct the + size of tt fonts. Closes: Bug#41268. + * avoid aborting the install when a file failed to compile. Closes: Bug#37373, Bug#40379. + + -- Frederic Lepied Tue, 14 Sep 1999 21:57:24 +0200 + +bbdb (2.00-3) frozen unstable; urgency=low + + * (install): added vm target for xemacs19 and xemacs20. Fixes Bug#21940. + * (install): corrected echo placement. Fixes Bug#21496. + * (install): suppressed duplicate. Fixes Bug#21497. + * (README.debian): new file to explain how to initialize bbdb. Fixes Bug#21497. + + -- Frederic Lepied Mon, 4 May 1998 05:56:21 +0200 + +bbdb (2.00-2) frozen unstable; urgency=low + + * (control): added a dependency on make. + * (control): priority optional. + * (control): suggests vm, w3-el, gnuserv and itimer. + * (install): byte compile with -no-site-file. + + -- Frederic Lepied Sun, 19 Apr 1998 08:11:15 +0200 + +bbdb (2.00-1) unstable; urgency=low + + * new upstream version. + + -- Frederic Lepied Wed, 18 Mar 1998 21:45:28 +0100 + +bbdb (1.55unoff-1.1) unstable; urgency=low + + * Non-maintainer release. + + * Updated for new emacsen requirements. + + * Removed empty README.Debian file. + + * Removed debmake dependencies--made it easier to fix everything else. + + * Updated to standards 2.4.0.0. + + -- Ben Pfaff Thu, 5 Mar 1998 11:48:24 -0500 + +bbdb (1.55unoff-1) unstable; urgency=low + + * upstream release. + * removed gnus-bbdb.el for lack of copyright and integration into + upstream bbdb-gnus. + + -- Frederic Lepied Sun, 26 Oct 1997 11:34:06 +0100 + +bbdb (1.54unoff-1) unstable; urgency=low + + * new maintainer. + * new upstream release. + * Added the missing P binding for bbdb-print in bbdb.el. + * Added gnus-bbdb.el to work with newer version of gnus. + + -- Frederic Lepied Fri, 17 Oct 1997 22:54:11 +0200 + + --- bbdb-2.35.cvs20080316.orig/debian/compat +++ bbdb-2.35.cvs20080316/debian/compat @@ -0,0 +1 @@ +7 --- bbdb-2.35.cvs20080316.orig/debian/bbdb.doc-base +++ bbdb-2.35.cvs20080316/debian/bbdb.doc-base @@ -0,0 +1,14 @@ +Document: bbdb +Title: Insidious Big Brother Database User Manual +Author: Jamie Zawinski, Matt Simmons and the BBDB Development Team +Abstract: BBDB is a rolodex-like database program for GNU Emacs and + XEmacs. BBDB stands for Insidious Big Brother Database, and is not, + repeat, not an obscure reference to the Buck Rogers TV series. +Section: Editors + +Format: HTML +Index: /usr/share/doc/bbdb/html/bbdb.html +Files: /usr/share/doc/bbdb/html/*.html + +Format: PDF +Files: /usr/share/doc/bbdb/bbdb.pdf.gz --- bbdb-2.35.cvs20080316.orig/debian/bbdb.emacsen-startup +++ bbdb-2.35.cvs20080316/debian/bbdb.emacsen-startup @@ -0,0 +1,29 @@ +;; bbdb startup file for Debian. + +;; Modified by Peter S Galbraith to skip loading when +;; bbdb is not fully installed, as this file still exists when the +;; package is removed but not purged. + +(cond + ((not (file-exists-p "/usr/share/emacs/site-lisp/bbdb")) + (message "Package bbdb removed but not purged. Skipping setup.")) + ((not (file-exists-p (concat "/usr/share/" + (symbol-name debian-emacs-flavor) + "/site-lisp/bbdb/bbdb-autoloads.elc"))) + (message "Package bbdb not fully installed. Skipping setup.")) + (t + + (debian-pkg-add-load-path-item + (concat "/usr/share/" (symbol-name debian-emacs-flavor) "/site-lisp/bbdb")) + + ;; (require 'message) + + ;; http://bugs.debian.org/85019 + (setq bbdb-sound-files nil) + (setq bbdb-sound-player nil) + (setq bbdb-sounds-directory nil) + + ;; (require 'bbdb) + ;; (bbdb-initialize) + + (require 'bbdb-autoloads))) --- bbdb-2.35.cvs20080316.orig/debian/patches/Makefile.patch +++ bbdb-2.35.cvs20080316/debian/patches/Makefile.patch @@ -0,0 +1,22 @@ +--- Makefile.orig 2009-11-17 16:13:19.000000000 -0500 ++++ Makefile 2009-11-17 16:16:25.000000000 -0500 +@@ -16,18 +16,7 @@ + aclocal.m4 configure configure.ac install-sh Makefile.in \ + bits lisp misc tex texinfo utils + +-all: Makefile bbdb info gnus +- +-Makefile:: Makefile.in +- ./config.status +- +-Makefile:: configure +- @echo "Configure has changed, you may need to rerun configure!" +- exit 1 +- +-configure: configure.ac +- @echo "configure.ac has changed. Please rerun autoconf!" +- exit 1 ++all: bbdb info gnus + + bbdb: + cd lisp; $(MAKE) bbdb --- bbdb-2.35.cvs20080316.orig/debian/patches/lisp/Makefile.patch +++ bbdb-2.35.cvs20080316/debian/patches/lisp/Makefile.patch @@ -0,0 +1,14 @@ +*** lisp/Makefile 2009-11-21 19:43:53.000000000 -0500 +--- debian/bbdb/usr/share/emacs/site-lisp/bbdb/lisp/Makefile 2009-11-21 20:27:35.000000000 -0500 +*************** +*** 56,64 **** + + all: Makefile gnus bbdb autoloadsc + +- Makefile: Makefile.in +- cd ..; ./config.status +- + install-pkg: uninstall-pkg bbdb autoloadsc + @if test "x$(SYMLINKS)" = "xno" ; then \ + mkdir -p -m 0755 $(PACKAGEDIR)/lisp/bbdb; \ +--- 56,61 ---- --- bbdb-2.35.cvs20080316.orig/lisp/bbdb-gui.el +++ bbdb-2.35.cvs20080316/lisp/bbdb-gui.el @@ -203,12 +203,12 @@ (if (< start (point-min)) (setq start (point-min))) (if (> end (point-max)) (setq end (point-max))) - (mapcar (function (lambda(o) - (if (and o - (eq (bbdb-extent-property o 'data) - 'bbdb)) - (bbdb-delete-extent o)))) - (bbdb-extents-in start end)) + (mapc (function (lambda(o) + (if (and o + (eq (bbdb-extent-property o 'data) + 'bbdb)) + (bbdb-delete-extent o)))) + (bbdb-extents-in start end)) (setq extent (bbdb-make-extent start end)) (bbdb-set-extent-property extent 'highlight t) --- bbdb-2.35.cvs20080316.orig/lisp/Makefile.in +++ bbdb-2.35.cvs20080316/lisp/Makefile.in @@ -30,7 +30,14 @@ MHE = -eval '(if (> (length "$(MHEDIR)") 0) \ (setq load-path (cons "$(MHEDIR)" load-path)))' -PUSHPATH=-l @top_srcdir@/@BBDB_LOADPATH@ +PUSHPATH= -eval "`\ + dir=\". $(OTHERDIRS)\"; \ + echo \(setq load-path \(append \(list ; \ + for i in $$dir ; do \ + echo \(expand-file-name \\"$$i\\"\)\ ; \ + done ;\ + echo \) load-path\)\) ; \ + `" .SUFFIXES: .elc .el .tar .Z .gz .uu @@ -88,7 +95,7 @@ @echo " (defmacro define-widget (&rest args)" >> $@; @echo " nil)))" >> $@; @echo " " >> $@; - @HUSHMAKE@$(EMACS_PROG) -batch -q -l autoload \ + $(EMACS_PROG) -batch -q -l autoload \ --eval '(setq generated-autoload-file "'`pwd`'/$@")' \ --eval "(if (featurep 'xemacs) (delete-file generated-autoload-file))" \ --eval '(setq make-backup-files nil)' \ @@ -96,7 +103,7 @@ -f batch-update-autoloads `pwd` bbdb-autoloads.elc: bbdb-autoloads.el - @HUSHMAKE@$(EMACS_PROG) -batch -q -f batch-byte-compile ./$^ + $(EMACS_PROG) -batch -q -f batch-byte-compile ./$^ bbdb.elc: bbdb.el bbdb-com.elc: bbdb.elc bbdb-com.el @@ -111,38 +118,41 @@ bbdb-xemacs.elc: bbdb.elc bbdb-xemacs.el .el.elc: - @HUSHMAKE@$(EMACS_PROG) -batch -q $(PUSHPATH) -l ./bbdb.elc -f batch-byte-compile $< + $(EMACS_PROG) -batch -q $(PUSHPATH) -l ./bbdb.elc -f batch-byte-compile $< bbdb.elc: bbdb.el - @HUSHMAKE@$(EMACS_PROG) -batch -q -f batch-byte-compile ./bbdb.el + $(EMACS_PROG) -batch -q -f batch-byte-compile ./bbdb.el bbdb-gnus.elc: bbdb.elc bbdb-gnus.el - @HUSHMAKE@$(EMACS_PROG) -batch -q $(PUSHPATH) -l ./bbdb.elc $(GNUS) \ + $(EMACS_PROG) -batch -q $(PUSHPATH) -l ./bbdb.elc $(GNUS) \ -f batch-byte-compile $(@:.elc=.el) bbdb-mhe.elc: bbdb.elc bbdb-mhe.el - @HUSHMAKE@$(EMACS_PROG) -batch -q $(PUSHPATH) -l ./bbdb.elc $(MHE) \ + $(EMACS_PROG) -batch -q $(PUSHPATH) -l ./bbdb.elc $(MHE) \ -f batch-byte-compile $(@:.elc=.el) bbdb-rmail.elc: bbdb.elc bbdb-rmail.el - @HUSHMAKE@$(EMACS_PROG) -batch -q $(PUSHPATH) -l ./bbdb.elc $(RMAIL) \ + $(EMACS_PROG) -batch -q $(PUSHPATH) -l ./bbdb.elc $(RMAIL) \ -f batch-byte-compile $(@:.elc=.el) bbdb-vm.elc: bbdb.elc bbdb-vm.el - @HUSHMAKE@$(EMACS_PROG) -batch -q $(PUSHPATH) -l ./bbdb.elc $(VM) \ + $(EMACS_PROG) -batch -q $(PUSHPATH) -l ./bbdb.elc $(VM) \ -f batch-byte-compile $(@:.elc=.el) bbdb-srv.elc: bbdb.elc bbdb-srv.el - @HUSHMAKE@$(EMACS_PROG) -batch -q $(PUSHPATH) -l ./bbdb.elc -eval '(progn (or (fboundp (quote define-obsolete-variable-alias)) (if (locate-library "gnuserv-compat") (load "gnuserv-compat" t t))) (if (and (locate-library "gnuserv") (locate-library "itimer")) (byte-compile-file "bbdb-srv.el") (message "Optional package bbdb-srv skipped - gnuserv not found")))' + $(EMACS_PROG) -batch -q $(PUSHPATH) -l ./bbdb.elc -eval '(progn (or (fboundp (quote define-obsolete-variable-alias)) (if (locate-library "gnuserv-compat") (load "gnuserv-compat" t t))) (if (and (locate-library "gnuserv") (locate-library "itimer")) (byte-compile-file "bbdb-srv.el") (message "Optional package bbdb-srv skipped - gnuserv not found")))' bbdb-reportmail.elc: bbdb.elc bbdb-reportmail.el - @HUSHMAKE@$(EMACS_PROG) -batch -q $(PUSHPATH) -l ./bbdb.elc -eval '(if (locate-library "reportmail") (byte-compile-file "bbdb-reportmail.el") (message "Optional package bbdb-reportmail skipped - reportmail not found"))' + $(EMACS_PROG) -batch -q $(PUSHPATH) -l ./bbdb.elc -eval '(if (locate-library "reportmail") (byte-compile-file "bbdb-reportmail.el") (message "Optional package bbdb-reportmail skipped - reportmail not found"))' bbdb-sc.elc: bbdb.elc bbdb-sc.el - @HUSHMAKE@$(EMACS_PROG) -batch -q $(PUSHPATH) -l ./bbdb.elc -eval '(if (locate-library "supercite") (byte-compile-file "bbdb-sc.el") (message "Optional package bbdb-sc skipped - supercite not found"))' + $(EMACS_PROG) -batch -q $(PUSHPATH) -l ./bbdb.elc -eval '(if (locate-library "supercite") (byte-compile-file "bbdb-sc.el") (message "Optional package bbdb-sc skipped - supercite not found"))' # bbdb-hooks uses VM macros if it can find VM. bbdb-hooks.elc: bbdb.elc bbdb-hooks.el - @HUSHMAKE@$(EMACS_PROG) -batch -q $(PUSHPATH) -l ./bbdb.elc \ - -eval '(and (not (string= "$(VMDIR)" "")) (setq load-path (cons "$(VMDIR)" load-path)) (load "vm" t t) (load "vm-vars" t t))' \ + $(EMACS_PROG) -batch -q $(PUSHPATH) -l ./bbdb.elc \ + -eval "(and (not (string= \"$(VMDIR)\" \"\")) \ + (setq load-path (cons \"$(VMDIR)\" load-path)) \ + (load \"vm\" t t) \ + (load \"vm-vars\" t t))" \ -f batch-byte-compile $(@:.elc=.el) autoloads: bbdb-autoloads.el --- bbdb-2.35.cvs20080316.orig/lisp/bbdb-com.el +++ bbdb-2.35.cvs20080316/lisp/bbdb-com.el @@ -121,19 +121,19 @@ (if phone (setq clauses (cons - (` (let ((rest-of-phones (bbdb-record-phones record)) - (done nil)) - (if rest-of-phones - (while (and rest-of-phones (not done)) - (setq done (string-match (, phone) - ;; way way wasteful... - (bbdb-phone-string - (car rest-of-phones))) - rest-of-phones (cdr rest-of-phones))) - ;; so that "^$" can be used to find entries that - ;; have no phones - (setq done (string-match (, phone) ""))) - done)) + `(let ((rest-of-phones (bbdb-record-phones record)) + (done nil)) + (if rest-of-phones + (while (and rest-of-phones (not done)) + (setq done (string-match ,phone + ;; way way wasteful... + (bbdb-phone-string + (car rest-of-phones))) + rest-of-phones (cdr rest-of-phones))) + ;; so that "^$" can be used to find entries that + ;; have no phones + (setq done (string-match ,phone ""))) + done) clauses))) (if notes (setq clauses @@ -3066,7 +3066,7 @@ a pause in the dial sequence." (interactive "sDial number: ") (let ((dialed "")) - (mapcar + (mapc (lambda(d) (if bbdb-modem-dial (setq dialed @@ -3458,8 +3458,8 @@ ;;; If Sebastian Kremer's minibuffer history package is around, use it. (if (and (fboundp 'gmhist-make-magic) (string-lessp emacs-version "19")) ; v19 has history built in - (mapcar 'gmhist-make-magic - '(bbdb bbdb-name bbdb-company bbdb-net bbdb-changed))) + (mapc 'gmhist-make-magic + '(bbdb bbdb-name bbdb-company bbdb-net bbdb-changed))) ;;;###autoload (defcustom bbdb-update-records-mode 'annotating --- bbdb-2.35.cvs20080316.orig/lisp/bbdb-rmail.el +++ bbdb-2.35.cvs20080316/lisp/bbdb-rmail.el @@ -37,11 +37,13 @@ be extracted." (save-excursion (set-buffer buf) - (save-restriction - (rmail-narrow-to-non-pruned-header) - (let ((headers (mail-header-extract)) - (header (intern-soft (downcase header-field)))) - (mail-header header headers))))) + (if (fboundp 'rmail-get-header) ; Emacs 23 + (rmail-get-header header-field) + (save-restriction + (rmail-narrow-to-non-pruned-header) + (let ((headers (mail-header-extract)) + (header (intern-soft (downcase header-field)))) + (mail-header header headers)))))) (defun bbdb/rmail-new-flag( buf ) "Returns t if the current message in buffer BUF is new." --- bbdb-2.35.cvs20080316.orig/lisp/bbdb-whois.el +++ bbdb-2.35.cvs20080316/lisp/bbdb-whois.el @@ -25,10 +25,10 @@ (defmacro bbdb-add-to-field (record field text) (let ((get (intern (concat "bbdb-record-" (symbol-name field)))) (set (intern (concat "bbdb-record-set-" (symbol-name field))))) - (` (let ((old ((, get) (, record))) - (text (, text))) - (or (member text old) - ((, set) (, record) (nconc old (list text)))))))) + `(let ((old (,get ,record)) + (text ,text)) + (or (member text old) + (,set ,record (nconc old (list text))))))) (defcustom bbdb-whois-server (or (and (boundp 'whois-server) whois-server) "whois.geektools.com") @@ -150,15 +150,15 @@ ;; now add each member of the list to the bbdb record ;; it'd be nice if we could be smarter about this. - (mapcar (function - (lambda(p) - (if (not (bbdb-find-phone - p (bbdb-record-phones rec))) - (let ((p-n - (vector (format "nic-phone-%d" n) p))) - (bbdb-add-to-field rec phones p-n) - (setq n (+ 1 n)))))) - phone-numbers) + (mapc (function + (lambda(p) + (if (not (bbdb-find-phone + p (bbdb-record-phones rec))) + (let ((p-n + (vector (format "nic-phone-%d" n) p))) + (bbdb-add-to-field rec phones p-n) + (setq n (+ 1 n)))))) + phone-numbers) ;; throw away phones line from what we've snarfed (setq lines (cdr lines)))) --- bbdb-2.35.cvs20080316.orig/lisp/bbdb-merge.el +++ bbdb-2.35.cvs20080316/lisp/bbdb-merge.el @@ -212,12 +212,12 @@ (bbdb-refile-notes-default-merge-function 'bbdb-merge-strings)) ;; merge everything - (mapcar (lambda(rec) - (bbdb-merge-record rec - (and match-fun - (funcall match-fun rec)) - override)) - new-records)) + (mapc (lambda(rec) + (bbdb-merge-record rec + (and match-fun + (funcall match-fun rec)) + override)) + new-records)) ;; hack (setq bbdb-buffer (or (get-file-buffer bbdb-file) nil))) --- bbdb-2.35.cvs20080316.orig/bits/bbdb-vcard-export.el +++ bbdb-2.35.cvs20080316/bits/bbdb-vcard-export.el @@ -0,0 +1,239 @@ +;;; bbdb-vcard-export.el -- export BBDB as vCard files +;; +;; Copyright (c) 2002 Jim Hourihan +;; Copyright (c) 2005 Alex Schroeder +;; +;; bbdb-vcard-export.el is free software you can redistribute it and/or +;; modify it under the terms of the GNU General Public License as +;; published by the Free Software Foundation; either version 2, or (at +;; your option) any later version. +;; +;; This software is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to +;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +;; +;; Author: Jim Hourihan +;; Created: 2002-08-08 +;; Version: $Id: bbdb-vcard-export.el,v 1.3 2006/03/14 00:00:00 malcolmp Exp $ +;; Keywords: vcard ipod + +;;; Commentary + +;; I use this code to sync my ipod with bbdb under OS X. To do so: +;; +;; M-x bbdb-vcard-export-update-all +;; +;; and enter `/Volumes/IPOD_NAME/Contacts/' at the prompt +;; +;; vCard documentated in RFC 2426 +;; Value types documented in RFC 2425 + +;; The coding system used for writing the files is UTF-16 by default. +;; To use anything else, use a prefix argument: C-u M-x +;; bbdb-vcard-export-update-all. You will be prompted for another +;; coding system to use. Latin-1 is probably a good choice. +;; bbdb-file-coding-system's default value is iso-2022-7bit, which is +;; probably useless for vCard exports. + +;;; Code: + +(require 'bbdb) + +; XEmacs prior to 21.5 is not dumped with replace-regexp-in-string. In those +; cases it can be found in the xemacs-base package. +(eval-and-compile + (if (and (not (fboundp 'replace-regexp-in-string)) (featurep 'xemacs)) + (require 'easy-mmode))) + +(defvar bbdb-translation-table + '(("Mobile" . "Cell")) + "Translations of text items, typically for labels.") + +(defun bbdb-translate (str) + "Translate STR into some other string based on `bbdb-translation-table'." + (let ((translation (assoc str bbdb-translation-table))) + (if translation + (cdr translation) + str))) + +;; 2.3 Predefined VALUE Type Usage + +;; The predefined data type values specified in [MIME-DIR] MUST NOT be +;; repeated in COMMA separated value lists except within the N, +;; NICKNAME, ADR and CATEGORIES value types. + +;; The text value type defined in [MIME-DIR] is further restricted such +;; that any SEMI-COLON character (ASCII decimal 59) in the value MUST be +;; escaped with the BACKSLASH character (ASCII decimal 92). + +(defun bbdb-vcard-export-escape (str) + "Return a copy of STR with ; , and newlines escaped." + (setq str (bbdb-translate str) + str (or str ""); get rid of nil values + str (replace-regexp-in-string "\\(;\\|,\\|\\\\\\)" "\\\\\\1" str) + str (replace-regexp-in-string "\n" "\\\\n" str))) + +;; (insert (bbdb-vcard-export-escape "this is, not \\ or \n true")) + +(defun bbdb-vcard-export-several (list) + "Return a comma-separated list of escaped unique elements in LIST." + (let ((hash (make-hash-table :test 'equal)) + result) + (dolist (item list) + (puthash (bbdb-vcard-export-escape item) t hash)) + (maphash (lambda (key val) + (setq result (cons key result))) + hash) + (bbdb-join result ","))) + +;; The component values MUST be specified in +;; their corresponding position. The structured type value corresponds, +;; in sequence, to the post office box; the extended address; the street +;; address; the locality (e.g., city); the region (e.g., state or +;; province); the postal code; the country name. When a component value +;; is missing, the associated component separator MUST still be +;; specified. + +;; The text components are separated by the SEMI-COLON character (ASCII +;; decimal 59). Where it makes semantic sense, individual text +;; components can include multiple text values (e.g., a "street" +;; component with multiple lines) separated by the COMMA character +;; (ASCII decimal 44). +(defun bbdb-vcard-export-address-string (address) + "Return the address string" + (let ((streets (bbdb-address-streets address)) + (city (bbdb-address-city address)) + (state (bbdb-address-state address)) + (country (bbdb-address-country address)) + (zip (bbdb-address-zip address))) + (concat + "adr;type=" (bbdb-vcard-export-escape (bbdb-address-location address)) ":" + ";;" ;; no post office box, no extended address + (bbdb-vcard-export-several streets) ";" + (bbdb-vcard-export-escape city) ";" + (bbdb-vcard-export-escape state) ";" + (bbdb-vcard-export-escape zip) ";" + (bbdb-vcard-export-escape country)))) + +(defun bbdb-vcard-export-record-insert-vcard (record) + "Insert a vcard formatted version of RECORD into the current buffer" + (let ((name (bbdb-record-name record)) + (first-name (bbdb-record-firstname record)) + (last-name (bbdb-record-lastname record)) + (aka (bbdb-record-aka record)) + (company (bbdb-record-company record)) + (notes (bbdb-record-notes record)) + (phones (bbdb-record-phones record)) + (addresses (bbdb-record-addresses record)) + (net (bbdb-record-net record)) + (categories (bbdb-record-getprop + record + bbdb-define-all-aliases-field))) + (insert "begin:vcard\n" + "version:3.0\n") + ;; Specify the formatted text corresponding to the name of the + ;; object the vCard represents. The property MUST be present in + ;; the vCard object. + (insert "fn:" (bbdb-vcard-export-escape name) "\n") + ;; Family Name, Given Name, Additional Names, Honorific + ;; Prefixes, and Honorific Suffixes + (when (or last-name first-name) + (insert "n:" + (bbdb-vcard-export-escape last-name) ";" + (bbdb-vcard-export-escape first-name) ";;;\n")) + ;; Nickname of the object the vCard represents. One or more text + ;; values separated by a COMMA character (ASCII decimal 44). + (when aka + (insert "nickname:" (bbdb-vcard-export-several aka) "\n")) + ;; FIXME: use face attribute for this one. + ;; PHOTO;ENCODING=b;TYPE=JPEG:MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcN + ;; AQEEBQAwdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENvbW11bm + ;; ljYXRpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0 + + ;; FIXME: use birthday attribute if there is one. + ;; BDAY:1996-04-15 + ;; BDAY:1953-10-15T23:10:00Z + ;; BDAY:1987-09-27T08:30:00-06:00 + + ;; A single structured text value consisting of components + ;; separated the SEMI-COLON character (ASCII decimal 59). But + ;; BBDB doesn't use this. So there's just one level: + (when company + (insert "org:" (bbdb-vcard-export-escape company) "\n")) + (when notes + (insert "note:" (bbdb-vcard-export-escape notes) "\n")) + (dolist (phone phones) + (insert "tel;type=" (bbdb-vcard-export-escape (bbdb-phone-location phone)) ":" + (bbdb-vcard-export-escape (bbdb-phone-string phone)) "\n")) + (dolist (address addresses) + (insert (bbdb-vcard-export-address-string address) "\n")) + (dolist (mail net) + (insert "email;type=internet:" (bbdb-vcard-export-escape mail) "\n")) + ;; Use CATEGORIES based on mail-alias. One or more text values + ;; separated by a COMMA character (ASCII decimal 44). + (when categories + (insert "categories:" + (bbdb-join (mapcar 'bbdb-vcard-export-escape + (bbdb-split categories ",")) ",") "\n")) + (insert "end:vcard\n"))) + +(defun bbdb-vcard-export-vcard-name-from-record (record) + "Come up with a vcard name given a record" + (let ((name (bbdb-record-name record)) + (first-name (elt record 0)) + (last-name (elt record 1))) + (concat first-name "_" last-name ".vcf"))) + +(defun bbdb-vcard-export-make-vcard (record vcard-name) + "Make a record buffer and write it" + (let ((buffer (get-buffer-create "*bbdb-vcard-export*"))) + (save-excursion + (set-buffer buffer) + (kill-region (point-min) (point-max)) + (bbdb-vcard-export-record-insert-vcard record) + (write-region (point-min) (point-max) vcard-name)) + (kill-buffer buffer))) + +(defun bbdb-vcard-do-record (record output-dir coding-system) + "Update the vcard of one bbdb record" + (setq coding-system (or coding-system 'utf-16)) + (let ((coding-system-for-write coding-system)) + (message "Updating %s" (bbdb-record-name record)) + (bbdb-vcard-export-make-vcard + record + (concat output-dir + (bbdb-vcard-export-vcard-name-from-record record))))) + +(defun bbdb-vcard-export-update-all (output-dir coding-system) + "Update the vcard Contacts directory from the bbdb database" + (interactive "DDirectory to update: \nZCoding system: ") + (bbdb ".*" nil) + (dolist (record (bbdb-records)) + (bbdb-vcard-do-record record output-dir coding-system))) + +(defun bbdb-vcard-export (regexp output-dir coding-system) + "Update the vcard Contacts directory from records matching REGEXP" + (interactive "sExport records matching: \nDDirectory to update: \nZCoding system: ") + (bbdb regexp nil) + (let ((notes (cons '* regexp))) + (dolist (record (bbdb-search (bbdb-records) regexp regexp regexp notes nil)) + (message "Updating %s" (bbdb-record-name record)) + (bbdb-vcard-do-record record output-dir coding-system)))) + +(defun bbdb-vcard-export-current (output-dir coding-system) + "Update the vcard of the current record" + (interactive "DDirectory to update: \nZCoding system: ") + (let ((record (bbdb-current-record nil))) + (bbdb-vcard-do-record record output-dir coding-system))) + +(define-key bbdb-mode-map [(v)] 'bbdb-vcard-export-current) + + +(provide 'bbdb-vcard-export) + +;;; bbdb-vcard-export.el ends here --- bbdb-2.35.cvs20080316.orig/bits/bbdbpalm.el +++ bbdb-2.35.cvs20080316/bits/bbdbpalm.el @@ -0,0 +1,501 @@ +;;; bbdbpalm.el -- BBDBpalm exporter of BBDB database to Palm(R) address book + +;; Copyright (C) 1999,2002,2006 Neil W. Van Dyke + +;; Author: Neil W. Van Dyke +;; Version: 0.3 +;; X-URL: http://www.neilvandyke.org/bbdbpalm/ +;; X-CVS: $Id: bbdbpalm.el,v 1.26 2006-11-12 04:46:58 neil Exp $ + +;; This is free software; you can redistribute it and/or modify it under the +;; terms of the GNU General Public License as published by the Free Software +;; Foundation; either version 2, or (at your option) any later version. This +;; is distributed in the hope that it will be useful, but without any warranty; +;; without even the implied warranty of merchantability or fitness for a +;; particular purpose. See the GNU General Public License for more details. +;; You should have received a copy of the GNU General Public License along with +;; Emacs; see the file `COPYING'. If not, write to the Free Software +;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.") + +;;; Commentary: + +;; ABOUT: +;; +;; BBDBpalm exports your BBDB address database to your Palm/USR/3Com +;; Pilot/PalmPilot/Palm-Connected-Organizer (hereinafter simply "Palm"). +;; BBDB is a sort of electronic address book written by Jamie Zawinsky +;; that integrates nicely with Emacs-based E-mail and Usenet +;; clients. BBDBpalm lets you bring that address book with you if you +;; don't have the luxury of 24/7 network access to a remote Emacs session +;; from your Palm. +;; +;; The Web page is `http://www.neilvandyke.org/bbdbpalm/'. +;; +;; This package is no longer being maintained. + +;; REQUIREMENTS: +;; +;; BBDBpalm was developed with BBDB 1.51, which is available at +;; `http://www.jwz.org/bbdb/' if you don't already have it. It has also +;; been reported to work with BBDB 2.00.02. +;; +;; BBDBpalm uses the `pilot-addresses' program, which is part of the +;; Pilot-Link package. Pilot-Link is freely available on the 'net, and is +;; included with some GNU/Linux distributions. The master sources are +;; available at `ftp://ryeham.ee.ryerson.ca/pub/PalmOS/', although you may +;; wish to instead find a pre-compiled distribution for your operating +;; system. BBDBpalm was tested with version 0.9.0. +;; +;; BBDBpalm was developed under GNU Emacs 20.3 running atop the GNU/Linux +;; platform. It will probably work with Emacs 19 and has been reported to +;; work under XEmacs 21.2b17. It will probably work under Emacs on other +;; Unix variants. Please let me know if you encounter any problems with +;; other Emacsen or Unixen. + +;; INSTALLATION: +;; +;; If you're Emacs-savvy enough to be using BBDB, then you probably don't +;; need much install instructions. The only three non-obvious things you +;; need to do are: +;; +;; 1. On your Palm, add an Address List category called "BBDB", in all +;; caps. (Reason: Unfortunately, `pilot-addresses' does not presently +;; create categories on your Palm, or overwrite duplicate entries. +;; So, every time we upload to the Palm, we blast everything in the +;; "BBDB" category and put all the BBDB-exported records into that +;; category.) If you change entries on the Palm side of things, +;; change their category so that you remember to manually propagate +;; the change to BBDB. +;; +;; 2. If you don't want to export everything in your BBDB to the Palm, +;; then do both of: +;; +;; a. Put the following your `.emacs' file or wherever you put your +;; Emacs customizations: +;; +;; (setq bbdbpalm-export-all-p nil) +;; +;; b. Add a field called `palm' to each BBDB record that you wish to +;; export (by pressing `C-o' in the `*BBDB*' buffer with the +;; point on the desired record). Give each `palm' field a value +;; of `yes' for now. Note that a later version of BBDBpalm might +;; put something else in that field. +;; +;; 3. If you wish to have titles for people be exported to the Palm, add +;; a field called `title' to BBDB and use it. + +;; ALTERNATIVES: +;; +;; Tom Fawcett wrote `bbdb-pilot', which is available +;; at `ftp://ftp.croftj.net/usr/fawcett/bbdb-pilot.el'. The version I +;; found, dated 1998, didn't seem to do what I wanted (I'm so picky) but +;; you may prefer it. +;; +;; Neale Picket hacked up a small convertor in +;; Feb-1998. See `http://acm.rpi.edu/~albert/pilot/Feb98/0039.html'. + +;; THINGS TO DO: +;; +;; * Add support for custom fields. +;; +;; * Add special support for `Web' custom field. +;; +;; * Maybe someday do bidirectional sync-ing. For now, users should just +;; keep all the BBDB-exported records in the `BBDB' category on their +;; Palm, and manually change those records on the BBDB end rather than on +;; the Palm end. +;; +;; * Maybe I should make it fix certain family names that BBDB has +;; mis-parsed, such as, well... I dunno... how about... "Van Dyke"? +;; Better yet, I should move to BBDB 2.x and make sure it's fixed there. +;; +;; * Make it be smarter about which address it picks if there are multiple +;; ones. +;; +;; * Add BBDB extension so that it prompts you for `palm' field. +;; +;; * Make it reformat phone numbers. +;; +;; * Add completion-percentage indicator for file-exporting and uploading. +;; +;; * Check for error from `pilot-addresses' and maybe do something with it. +;; +;; * ``I think it would be nice if the order of phone numbers as they +;; appear in the BBDB was preserved in the Pilot. Same thing for multiple +;; email addresses; they are now listed in reverse order.'' [Mark Moll +;; , 24-Jun-1999] +;; +;; * ``Maybe it's a good idea to put in a message "Please press the HotSync +;; button" at the appropiate time.'' [Mark Moll , +;; 24-Jun-1999] + +;;; Change Log: + +;; [Version 0.3, 2006-11-12] Made `bbdbpalm-format-record' work with newer BBDB +;; versions by use of `bbdb-address-streets'. Thanks to Christoph Conrad for +;; the patch. Note that I do not have access to a Palm and cannot test this +;; myself. +;; +;; [Version 0.2, 2002-10-15] I no longer have access to a Palm, so I am not +;; maintaining this package. This release is a snapshot of my last modified +;; version, which fixes a typo in jwz's name (writes one observant BBDBpalm +;; user: ``jwz's spelling of his last name differs a bit from yours. If +;; "Zawinksy" an in-joke, it's probably funny.''), and updates my email +;; address. +;; +;; [Version 0.1, 1999-06-23] Initial release. + +;;; Code: + +(defconst bbdbpalm-name "BBDBpalm") +(defconst bbdbpalm-version "0.3") + +;; Package Dependencies: + +(require 'bbdb) +(require 'cl) + +;; Options: + +(defvar bbdbpalm-category + "BBDB" + "*Name of the category under which the exported address records are to be +filed. Note that all addresses in this category will be removed from the Palm +when the new addresses are uploaded by `pilot-addresses'.") + +(defvar bbdbpalm-export-all-p + t + "*If non-nil, export all records, rather than exporting only those records +that that have a `palm' field.") + +(defvar bbdbpalm-export-file + (expand-file-name ".bbdbpalm-export" "~") + "*Filename of the file into which BBDB-Palm puts the exported address data +for `pilot-addresses'.") + +(defvar bbdbpalm-leave-work-field-p + t + "*If non-nil, never put anything in the first contact field (which defaults +to the Work phone number) except Work.") + +(defvar bbdbpalm-pilot-addresses-program + "pilot-addresses" + "*Command to invoke the `pilot-addresses' program. The program should either +be in the executable search path, or this variable should be set to a +fully-qualified pathname to the program file.") + +;; Constants: + +(defconst bbdbpalm-contactcode-strings + '((email . "E-Mail") + (fax . "Fax") + (home . "Home") + (mail . "Main") + (mobile . "Mobile") + (other . "Other") + (pager . "Pager") + (work . "Work"))) + +(defconst bbdbpalm-octal-700 448) + +;; Macros: + +(defmacro bbdbpalm-assq-del (key alist) + (assert (symbolp alist)) + (let ((cell (gensym)) + (eval-key (gensym)) + (head (gensym)) + (lasthead (gensym))) + `(let ((,eval-key ,key) + (,cell nil) + (,head ,alist) + (,lasthead nil)) + (while (and ,head (not ,cell)) + (setq ,cell (car ,head)) + (if (eq (car ,cell) ,eval-key) + (if ,lasthead + (setcdr ,lasthead (cdr ,head)) + (setq ,alist (cdr ,head))) + (setq ,cell nil) + (setq ,lasthead ,head) + (setq ,head (cdr ,head)))) + ,cell))) + +(defmacro bbdbpalm-log-activity (what &rest body) + ;; Note: This function was adapted from `jomtool-log-activity' in Neil's + ;; Jomtool package. + (let ((eval-what (gensym))) + `(let ((,eval-what ,what)) + (bbdbpalm-log (concat ,eval-what "...")) + (prog1 (progn ,@body) + (bbdbpalm-log (concat ,eval-what "...done")))))) + +;; Functions: + +(defun bbdbpalm () + (interactive) + (bbdbpalm-log-activity + "Exporting BBDB data to the Palm" + (bbdbpalm-export-to-file bbdbpalm-export-file) + (bbdbpalm-upload-export-file bbdbpalm-export-file))) + +(defun bbdbpalm-contactcode-string (contactcode) + (cdr (assq contactcode bbdbpalm-contactcode-strings))) + +(defun bbdbpalm-export-to-file (export-file) + (let (buf + old-default-file-modes + record) + (bbdbpalm-log-activity + (format "Exporting to file \"%s\"" export-file) + (unwind-protect + (progn + ;; Make sure created files are only readable by user. + (setq old-default-file-modes (default-file-modes)) + (set-default-file-modes bbdbpalm-octal-700) + ;; Find the file and empty it. + (setq buf (find-file-noselect export-file)) + (set-buffer buf) + (goto-char (point-min)) + (delete-region (point-min) (point-max)) + ;; Write the records. + (mapc (function + (lambda (record) + (let ((notes (bbdb-record-raw-notes record))) + (if (or bbdbpalm-export-all-p + (and (listp notes) (assq 'palm notes))) + (insert (bbdbpalm-format-record record)))))) + (bbdb-records)) + ;; Save the file and get rid of the buffer. + (save-buffer buf) + (kill-buffer buf)) + ;; unwind-protect cleanup: Restore default-file-modes. + (set-default-file-modes old-default-file-modes))))) + +(defun bbdbpalm-format-contact-field (contact-field) + (if contact-field + (list (bbdbpalm-contactcode-string (car contact-field)) + (cdr contact-field)) + nil)) + +(defun bbdbpalm-format-field (field) + (cond ((null field) "\"\"") + ((stringp field) (bbdbpalm-format-field-string field)) + ((listp field) (mapconcat 'bbdbpalm-format-field-string + field + ";")) + (t (error "Can't handle type of this field: " + field)))) + +(defun bbdbpalm-format-field-list (list) + (concat (mapconcat 'bbdbpalm-format-field + list + ",") + "\n")) + +(defun bbdbpalm-format-field-string (field) + (if field + ;; Note: This is a grossly slow way to do it. + (concat "\"" + (mapconcat (function + (lambda (c) + (cond ((= c 34) "\"\"") + ((and (> c 31) (< c 128)) (char-to-string c)) + ((= c 9) "\\t") + ((= c 10) "\\n") + (t "")))) + field + "") + "\"") + "\"\"")) + +(defun bbdbpalm-format-record (record) + (let ((city nil) + (contact-fields nil) + (country nil) + (custom-1 nil) + (custom-2 nil) + (custom-3 nil) + (custom-4 nil) + (group nil) + (show-field nil) + (state nil) + (street nil) + (title nil) + (zip nil)) + + ;; Prepare the contact fields. + (let ((contact-cands '())) + + ;; Add phone numbers to contact-cands. + (mapcar + (function + (lambda (phone) + (let ((code (bbdbpalm-location-to-contactcode + (bbdb-phone-location phone)))) + (if code + (setq contact-cands + (nconc contact-cands + (list (cons code + (bbdb-phone-string phone))))))))) + (bbdb-record-phones record)) + + ;; Add E-mail addresses to contact-cands (note that we want these + ;; added after the phone numbers, so that phone numbers get higher + ;; priority when we're filling up extra contact fields). + (mapcar (function (lambda (net) + (setq contact-cands + (nconc contact-cands + (list (cons 'email net)))))) + (bbdb-record-net record)) + + ;; Set the contact fields, giving preference to one of each and to the + ;; Palm default ordering. Fill the remaining empty contact fields with + ;; other contact info. + (setq contact-fields (list (bbdbpalm-assq-del 'work contact-cands) + (bbdbpalm-assq-del 'home contact-cands) + (bbdbpalm-assq-del 'fax contact-cands) + (bbdbpalm-assq-del 'other contact-cands) + (bbdbpalm-assq-del 'email contact-cands))) + (let ((probe contact-fields)) + (if bbdbpalm-leave-work-field-p + (setq probe (cdr probe))) + (while (and probe contact-cands) + (if (not (car probe)) + (progn + (setcar probe (car contact-cands)) + (setq contact-cands (cdr contact-cands)))) + (setq probe (cdr probe)))) + + ;; Set show-field. + (setq show-field (if (and (not (assq 'work contact-fields)) + (assq 'home contact-fields)) + "Home" + "Work"))) + + ;; Prepare address fields. + (let ((addr nil) + (addrs (bbdb-record-addresses record))) + (setq addr (car addrs)) + (if addr + (setq street (mapconcat + 'identity + (delq nil + (mapcar (function + (lambda (s) + (if (= (length s) 0) nil s))) + (bbdb-address-streets addr) + ;; Note: Old code. Replaced by above + ;; line for newer BBDB. + ;; + ;; (list (bbdb-address-street1 addr) + ;; (bbdb-address-street2 addr) + ;; (bbdb-address-street3 addr)) + )) + ", ") + city (bbdb-address-city addr) + state (bbdb-address-state addr) + zip (bbdb-address-zip-string addr) + country nil))) + + ;; Get information from the raw notes fields. + (mapcar (function (lambda (field) + (if (consp field) + (case (car field) + ('title (setq title (cdr field))) + ('group (setq group (cdr field))))))) + (bbdb-record-raw-notes record)) + + ;; Return the formatted record. + (bbdbpalm-format-field-list + (list + ;; 1. SEMI SEMI + ;; "Unfiled";"Fax";"ALastName", + (list bbdbpalm-category show-field (bbdb-record-lastname record)) + ;; 2. + ;; "AFirstName", + (bbdb-record-firstname record) + ;; 3. + ;; "ATitle", + title + ;; 3. <Company> + ;; "ACompany", + (bbdb-record-company record) + ;; 4-8. ( <ContactAttr> SEMI <ContactValue> ) | ( <emptystring> ) + ;; "","","Fax";"zFax","Other";"zOther, with ""quotes""", + ;; "E-mail";"zEmail", + (bbdbpalm-format-contact-field (nth 0 contact-fields)) + (bbdbpalm-format-contact-field (nth 1 contact-fields)) + (bbdbpalm-format-contact-field (nth 2 contact-fields)) + (bbdbpalm-format-contact-field (nth 3 contact-fields)) + (bbdbpalm-format-contact-field (nth 4 contact-fields)) + ;; 9. <Street> + ;; "zAddress", + street + ;; 10. <City> + ;; "zCity", + city + ;; 11. "zState", + state + ;; 12. "zZip", + zip + ;; 13. "zCountry", + country + ;; 14. "zGroup", + custom-1 + ;; 15. "zWeb", + custom-2 + ;; 16. "zIrc", + custom-3 + ;; 17. "zC4", + custom-4 + ;; 18. <Notes> + ;; "", + (bbdb-record-notes record) + ;; 19. <Unknown2> + ;; "0" + "0")))) + +(defun bbdbpalm-location-to-contactcode (loc) + (let ((s (assoc (downcase loc) + '(("cell" . mobile) + ("fax" . fax) + ("home" . home) + ("main" . main) + ("mobile" . mobile) + ("office" . work) + ("pad" . home) + ("work" . work))))) + (if s (cdr s) 'other))) + +(defun bbdbpalm-log (format &rest args) + (apply 'message (concat bbdbpalm-name ": " format) args)) + +(defun bbdbpalm-upload-export-file (export-file) + (bbdbpalm-log-activity + (format "Uploading file \"%s\" to Palm" export-file) + (save-excursion + (save-window-excursion + (let ((buf (get-buffer-create "*BBDBpalm*"))) + (set-buffer buf) + (setq buffer-read-only nil) + (delete-region (point-min) (point-max)) + (insert bbdbpalm-name + " will now run \"" + bbdbpalm-pilot-addresses-program + "\" to upload the data to your Palm.\n\n") + (or (getenv "PILOTRATE") + (insert "You may be able to speed up uploads by setting your" + " \"PILOTRATE\" environment\n" + "variable. See your Pilot-Link documentation for" + " details.\n\n")) + (pop-to-buffer buf) + (call-process bbdbpalm-pilot-addresses-program + nil buf t + "-d" bbdbpalm-category + "-r" bbdbpalm-export-file) + (setq buffer-read-only t)))))) + +(provide 'bbdbpalm) + +;;; bbdbpalm.el ends here --- bbdb-2.35.cvs20080316.orig/bits/vcard.el +++ bbdb-2.35.cvs20080316/bits/vcard.el @@ -0,0 +1,704 @@ +;;; vcard.el --- vcard parsing and display routines + +;; Copyright (C) 1997, 1999, 2000 Noah S. Friedman + +;; Author: Noah Friedman <friedman@splode.com> +;; Maintainer: friedman@splode.com +;; Keywords: vcard, mail, news +;; Created: 1997-09-27 + +;; $Id: vcard.el,v 1.11 2000/06/29 17:07:55 friedman Exp $ + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with this program; if not, you can either send email to this +;; program's maintainer or write to: The Free Software Foundation, +;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. + +;;; Commentary: + +;; Unformatted vcards are just plain ugly. But if you live in the MIME +;; world, they are a better way of exchanging contact information than +;; freeform signatures since the former can be automatically parsed and +;; stored in a searchable index. +;; +;; This library of routines provides the back end necessary for parsing +;; vcards so that they can eventually go into an address book like BBDB +;; (although this library does not implement that itself). Also included +;; is a sample pretty-printer which MUAs can use which do not provide their +;; own vcard formatters. + +;; This library does not interface directly with any mail user agents. For +;; an example of bindings for the VM MUA, see vm-vcard.el available from +;; +;; http://www.splode.com/~friedman/software/emacs-lisp/index.html#mail +;; +;; Updates to vcard.el should be available there too. + +;; The main entry point to this package is `vcard-pretty-print' although +;; any documented variable or function is considered part of the API for +;; operating on vcard data. + +;; The vcard 2.1 format is defined by the versit consortium. +;; See http://www.imc.org/pdi/vcard-21.ps +;; +;; RFC 2426 defines the vcard 3.0 format. +;; See ftp://ftp.rfc-editor.org/in-notes/rfc2426.txt + +;; A parsed vcard is a list of attributes of the form +;; +;; (proplist value1 value2 ...) +;; +;; Where proplist is a list of property names and parameters, e.g. +;; +;; (property1 (property2 . parameter2) ...) +;; +;; Each property has an associated implicit or explicit parameter value +;; (not to be confused with attribute values; in general this API uses +;; `parameter' to refer to property values and `value' to refer to attribute +;; values to avoid confusion). If a property has no explicit parameter value, +;; the parameter value is considered to be `t'. Any property which does not +;; exist for an attribute is considered to have a nil parameter. + +;; TODO: +;; * Finish supporting the 3.0 extensions. +;; Currently, only the 2.1 standard is supported. +;; * Handle nested vcards and grouped attributes? +;; (I've never actually seen one of these in use.) +;; * Handle multibyte charsets. +;; * Inverse of vcard-parse-string: write .VCF files from alist +;; * Implement a vcard address book? Or is using BBDB preferable? +;; * Improve the sample formatter. + +;;; Code: + +(defgroup vcard nil + "Support for the vCard electronic business card format." + :group 'vcard + :group 'mail + :group 'news) + +;;;###autoload +(defcustom vcard-pretty-print-function 'vcard-format-sample-box + "*Formatting function used by `vcard-pretty-print'." + :type 'function + :group 'vcard) + +;;;###autoload +(defcustom vcard-standard-filters + '(vcard-filter-html + vcard-filter-adr-newlines + vcard-filter-tel-normalize + vcard-filter-textprop-cr) + "*Standard list of filters to apply to parsed vcard data. +These filters are applied sequentially to vcard attributes when +the function `vcard-standard-filter' is supplied as the second argument to +`vcard-parse'." + :type 'hook + :group 'vcard) + + +;;; No user-settable options below. + +;; XEmacs 21 ints and chars are disjoint types. +;; For all else, treat them as the same. +(defalias 'vcard-char-to-int + (if (fboundp 'char-to-int) 'char-to-int 'identity)) + +;; This is just the version number for this package; it does not refer to +;; the vcard format specification. Currently, this package does not yet +;; support the full vcard 3.0 specification. +;; +;; Whenever any part of the API defined in this package change in a way +;; that is not backward-compatible, the major version number here should be +;; incremented. Backward-compatible additions to the API should be +;; indicated by increasing the minor version number. +(defconst vcard-api-version "2.0") + +;; The vcard standards allow specifying the encoding for an attribute using +;; these values as immediate property names, rather than parameters of the +;; `encoding' property. If these are encountered while parsing, associate +;; them as parameters of the `encoding' property in the returned structure. +(defvar vcard-encoding-tags + '("quoted-printable" "base64" "8bit" "7bit")) + +;; The vcard parser will auto-decode these encodings when they are +;; encountered. These methods are invoked via vcard-parse-region-value. +(defvar vcard-region-decoder-methods + '(("quoted-printable" . vcard-region-decode-quoted-printable) + ("base64" . vcard-region-decode-base64))) + +;; This is used by vcard-region-decode-base64 +(defvar vcard-region-decode-base64-table + (let* ((a "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/") + (len (length a)) + (tbl (make-vector 123 nil)) + (i 0)) + (while (< i len) + (aset tbl (vcard-char-to-int (aref a i)) i) + (setq i (1+ i))) + tbl)) + + +;;; This function can be used generically by applications to obtain +;;; a printable representation of a vcard. + +;;;###autoload +(defun vcard-pretty-print (vcard) + "Format VCARD into a string suitable for display to user. +VCARD can be an unparsed string containing raw VCF vcard data +or a parsed vcard alist as returned by `vcard-parse-string'. + +The result is a string with formatted vcard information suitable for +insertion into a mime presentation buffer. + +The function specified by the variable `vcard-pretty-print-function' +actually performs the formatting. That function will always receive a +parsed vcard alist." + (and (stringp vcard) + (setq vcard (vcard-parse-string vcard))) + (funcall vcard-pretty-print-function vcard)) + + +;;; Parsing routines + +;;;###autoload +(defun vcard-parse-string (raw &optional filter) + "Parse RAW vcard data as a string, and return an alist representing data. + +If the optional function FILTER is specified, apply that filter to each +attribute. If no filter is specified, `vcard-standard-filter' is used. + +Filters should accept two arguments: the property list and the value list. +Modifying in place the property or value list will affect the resulting +attribute in the vcard alist. + +Vcard data is normally in the form + + begin: vcard + prop1a: value1a + prop2a;prop2b;prop2c=param2c: value2a + prop3a;prop3b: value3a;value3b;value3c + end: vcard + +\(Whitespace around the `:' separating properties and values is optional.\) +If supplied to this function an alist of the form + + \(\(\(\"prop1a\"\) \"value1a\"\) + \(\(\"prop2a\" \"prop2b\" \(\"prop2c\" . \"param2c\"\)\) \"value2a\"\) + \(\(\"prop3a\" \"prop3b\"\) \"value3a\" \"value3b\" \"value3c\"\)\) + +would be returned." + (let ((vcard nil) + (buf (generate-new-buffer " *vcard parser work*"))) + (unwind-protect + (save-excursion + (set-buffer buf) + ;; Make sure last line is newline-terminated. + ;; An extra trailing newline is harmless. + (insert raw "\n") + (setq vcard (vcard-parse-region (point-min) (point-max) filter))) + (kill-buffer buf)) + vcard)) + +;;;###autoload +(defun vcard-parse-region (beg end &optional filter) + "Parse the raw vcard data in region, and return an alist representing data. +This function is just like `vcard-parse-string' except that it operates on +a region of the current buffer rather than taking a string as an argument. + +Note: this function modifies the buffer!" + (or filter + (setq filter 'vcard-standard-filter)) + (let ((case-fold-search t) + (vcard-data nil) + (pos (make-marker)) + (newpos (make-marker)) + properties value) + (save-restriction + (narrow-to-region beg end) + (save-match-data + ;; Unfold folded lines and delete naked carriage returns + (goto-char (point-min)) + (while (re-search-forward "\r$\\|\n[ \t]" nil t) + (goto-char (match-beginning 0)) + (delete-char 1)) + + (goto-char (point-min)) + (re-search-forward "^begin:[ \t]*vcard[ \t]*\n") + (set-marker pos (point)) + (while (and (not (looking-at "^end[ \t]*:[ \t]*vcard[ \t]*$")) + (re-search-forward ":[ \t]*" nil t)) + (set-marker newpos (match-end 0)) + (setq properties + (vcard-parse-region-properties pos (match-beginning 0))) + (set-marker pos (marker-position newpos)) + (re-search-forward "[ \t]*\n") + (set-marker newpos (match-end 0)) + (setq value + (vcard-parse-region-value properties pos (match-beginning 0))) + (set-marker pos (marker-position newpos)) + (goto-char pos) + (funcall filter properties value) + (setq vcard-data (cons (cons properties value) vcard-data))))) + (nreverse vcard-data))) + +(defun vcard-parse-region-properties (beg end) + (downcase-region beg end) + (let* ((proplist (vcard-split-string (buffer-substring beg end) ";")) + (props proplist) + split) + (save-match-data + (while props + (cond ((string-match "=" (car props)) + (setq split (vcard-split-string (car props) "=" 2)) + (setcar props (cons (car split) (car (cdr split))))) + ((member (car props) vcard-encoding-tags) + (setcar props (cons "encoding" (car props))))) + (setq props (cdr props)))) + proplist)) + +(defun vcard-parse-region-value (proplist beg end) + (let* ((encoding (vcard-get-property proplist "encoding")) + (decoder (cdr (assoc encoding vcard-region-decoder-methods))) + result pos match-beg match-end) + (save-restriction + (narrow-to-region beg end) + (cond (decoder + ;; Each `;'-separated field needs to be decoded and saved + ;; separately; if the entire region were decoded at once, we + ;; would not be able to distinguish between the original `;' + ;; chars and those which were encoded in order to quote them + ;; against being treated as field separators. + (goto-char beg) + (setq pos (set-marker (make-marker) (point))) + (setq match-beg (make-marker)) + (setq match-end (make-marker)) + (save-match-data + (while (< pos (point-max)) + (cond ((search-forward ";" nil t) + (set-marker match-beg (match-beginning 0)) + (set-marker match-end (match-end 0))) + (t + (set-marker match-beg (point-max)) + (set-marker match-end (point-max)))) + (funcall decoder pos match-beg) + (setq result (cons (buffer-substring pos match-beg) result)) + (set-marker pos (marker-position match-end)))) + (setq result (nreverse result)) + (vcard-set-property proplist "encoding" nil)) + (t + (setq result (vcard-split-string (buffer-string) ";"))))) + (goto-char (point-max)) + result)) + + +;;; Functions for retrieving property or value information from parsed +;;; vcard attributes. + +(defun vcard-values (vcard have-props &optional non-props limit) + "Return the values in VCARD. +This function is like `vcard-ref' and takes the same arguments, but return +only the values, not the associated property lists." + (mapcar 'cdr (vcard-ref vcard have-props non-props limit))) + +(defun vcard-ref (vcard have-props &optional non-props limit) + "Return the attributes in VCARD with HAVE-PROPS properties. +Optional arg NON-PROPS is a list of properties which candidate attributes +must not have. +Optional arg LIMIT means return no more than that many attributes. + +The attributes in VCARD which have all properties specified by HAVE-PROPS +but not having any specified by NON-PROPS are returned. The first element +of each attribute is the actual property list; the remaining elements are +the values. + +If a specific property has an associated parameter \(e.g. an encoding\), +use the syntax \(\"property\" . \"parameter\"\) to specify it. If property +parameter is not important or it has no specific parameter, just specify +the property name as a string." + (let ((attrs vcard) + (result nil) + (count 0)) + (while (and attrs (or (null limit) (< count limit))) + (and (vcard-proplist-all-properties (car (car attrs)) have-props) + (not (vcard-proplist-any-properties (car (car attrs)) non-props)) + (setq result (cons (car attrs) result) + count (1+ count))) + (setq attrs (cdr attrs))) + (nreverse result))) + +(defun vcard-proplist-all-properties (proplist props) + "Returns nil unless PROPLIST contains all properties specified in PROPS." + (let ((result t)) + (while (and result props) + (or (vcard-get-property proplist (car props)) + (setq result nil)) + (setq props (cdr props))) + result)) + +(defun vcard-proplist-any-properties (proplist props) + "Returns `t' if PROPLIST contains any of the properties specified in PROPS." + (let ((result nil)) + (while (and (not result) props) + (and (vcard-get-property proplist (car props)) + (setq result t)) + (setq props (cdr props))) + result)) + +(defun vcard-get-property (proplist property) + "Return the value from PROPLIST of PROPERTY. +PROPLIST is a vcard attribute property list, which is normally the first +element of each attribute entry in a vcard." + (or (and (member property proplist) t) + (cdr (assoc property proplist)))) + +(defun vcard-set-property (proplist property value) + "In PROPLIST, set PROPERTY to VALUE. +PROPLIST is a vcard attribute property list. +If VALUE is nil, PROPERTY is deleted." + (let (elt) + (cond ((null value) + (vcard-delete-property proplist property)) + ((setq elt (member property proplist)) + (and value (not (eq value t)) + (setcar elt (cons property value)))) + ((setq elt (assoc property proplist)) + (cond ((eq value t) + (setq elt (memq elt proplist)) + (setcar elt property)) + (t + (setcdr elt value)))) + ((eq value t) + (nconc proplist (cons property nil))) + (t + (nconc proplist (cons (cons property value) nil)))))) + +(defun vcard-delete-property (proplist property) + "Delete from PROPLIST the specified property PROPERTY. +This will not succeed in deleting the first member of the proplist, but +that element should never be deleted since it is the primary key." + (let (elt) + (cond ((setq elt (member property proplist)) + (delq (car elt) proplist)) + ((setq elt (assoc property proplist)) + (delq (car (memq elt proplist)) proplist))))) + + +;;; Vcard data filters. +;;; +;;; Filters receive both the property list and value list and may modify +;;; either in-place. The return value from the filters are ignored. +;;; +;;; These filters can be used for purposes such as removing HTML tags or +;;; normalizing phone numbers into a standard form. + +(defun vcard-standard-filter (proplist values) + "Apply filters in `vcard-standard-filters' to attributes." + (vcard-filter-apply-filter-list vcard-standard-filters proplist values)) + +;; This function could be used to dispatch other filter lists. +(defun vcard-filter-apply-filter-list (filter-list proplist values) + (while filter-list + (funcall (car filter-list) proplist values) + (setq filter-list (cdr filter-list)))) + +;; Some lusers put HTML (or even javascript!) in their vcards under the +;; misguided notion that it's a standard feature of vcards just because +;; Netscape supports this feature. That is wrong; the vcard specification +;; does not define any html content semantics and most MUAs cannot do +;; anything with html text except display them unparsed, which is ugly. +;; +;; Thank Netscape for abusing the standard and damned near rendering it +;; useless for interoperability between MUAs. +;; +;; This filter does a very rudimentary job. +(defun vcard-filter-html (proplist values) + "Remove HTML tags from attribute values." + (save-match-data + (while values + (while (string-match "<[^<>\n]+>" (car values)) + (setcar values (replace-match "" t t (car values)))) + (setq values (cdr values))))) + +(defun vcard-filter-adr-newlines (proplist values) + "Replace newlines with \"; \" in `adr' values." + (and (vcard-get-property proplist "adr") + (save-match-data + (while values + (while (string-match "[\r\n]+" (car values)) + (setcar values (replace-match "; " t t (car values)))) + (setq values (cdr values)))))) + +(defun vcard-filter-tel-normalize (proplist values) + "Normalize telephone numbers in `tel' values. +Spaces and hyphens are replaced with `.'. +US domestic telephone numbers are replaced with international format." + (and (vcard-get-property proplist "tel") + (save-match-data + (while values + (while (string-match "[\t._-]+" (car values)) + (setcar values (replace-match " " t t (car values)))) + (and (string-match "^(?\\(\\S-\\S-\\S-\\))? ?\ +\\(\\S-\\S-\\S- \\S-\\S-\\S-\\S-\\)" + (car values)) + (setcar values + (replace-match "+1 \\1 \\2" t nil (car values)))) + (setq values (cdr values)))))) + +(defun vcard-filter-textprop-cr (proplist values) + "Strip carriage returns from text values." + (and (vcard-proplist-any-properties + proplist '("adr" "email" "fn" "label" "n" "org" "tel" "title" "url")) + (save-match-data + (while values + (while (string-match "\r+" (car values)) + (setcar values (replace-match "" t t (car values)))) + (setq values (cdr values)))))) + + +;;; Decoding methods. + +(defmacro vcard-hexstring-to-ascii (s) + (if (string-lessp emacs-version "20") + `(format "%c" (car (read-from-string (format "?\\x%s" ,s)))) + `(format "%c" (string-to-number ,s 16)))) + +(defun vcard-region-decode-quoted-printable (&optional beg end) + (save-excursion + (save-restriction + (save-match-data + (narrow-to-region (or beg (point-min)) (or end (point-max))) + (goto-char (point-min)) + (while (re-search-forward "=\n" nil t) + (delete-region (match-beginning 0) (match-end 0))) + (goto-char (point-min)) + (while (re-search-forward "=[0-9A-Za-z][0-9A-Za-z]" nil t) + (let ((s (buffer-substring (1+ (match-beginning 0)) (match-end 0)))) + (replace-match (vcard-hexstring-to-ascii s) t t))))))) + +(defun vcard-region-decode-base64 (&optional beg end) + (save-restriction + (narrow-to-region (or beg (point-min)) (or end (point-max))) + (save-match-data + (goto-char (point-min)) + (while (re-search-forward "[ \t\r\n]+" nil t) + (delete-region (match-beginning 0) (match-end 0)))) + (goto-char (point-min)) + (let ((count 0) + (n 0) + (c nil)) + (while (not (eobp)) + (setq c (char-after (point))) + (delete-char 1) + (cond ((char-equal c ?=) + (if (= count 2) + (insert (lsh n -10)) + ;; count must be 3 + (insert (lsh n -16) (logand 255 (lsh n -8)))) + (delete-region (point) (point-max))) + (t + (setq n (+ n (aref vcard-region-decode-base64-table + (vcard-char-to-int c)))) + (setq count (1+ count)) + (cond ((= count 4) + (insert (logand 255 (lsh n -16)) + (logand 255 (lsh n -8)) + (logand 255 n)) + (setq n 0 count 0)) + (t + (setq n (lsh n 6)))))))))) + + +(defun vcard-split-string (string &optional separator limit) + "Split STRING at occurences of SEPARATOR. Return a list of substrings. +Optional argument SEPARATOR can be any regexp, but anything matching the + separator will never appear in any of the returned substrings. + If not specified, SEPARATOR defaults to \"[ \\f\\t\\n\\r\\v]+\". +If optional arg LIMIT is specified, split into no more than that many + fields \(though it may split into fewer\)." + (or separator (setq separator "[ \f\t\n\r\v]+")) + (let ((string-list nil) + (len (length string)) + (pos 0) + (splits 0) + str) + (save-match-data + (while (<= pos len) + (setq splits (1+ splits)) + (cond ((and limit + (>= splits limit)) + (setq str (substring string pos)) + (setq pos (1+ len))) + ((string-match separator string pos) + (setq str (substring string pos (match-beginning 0))) + (setq pos (match-end 0))) + (t + (setq str (substring string pos)) + (setq pos (1+ len)))) + (setq string-list (cons str string-list)))) + (nreverse string-list))) + +(defun vcard-copy-tree (tree) + "Make a deep copy of nested conses." + (cond + ((consp tree) + (cons (vcard-copy-tree (car tree)) + (vcard-copy-tree (cdr tree)))) + (t tree))) + +(defun vcard-flatten (l) + (if (consp l) + (apply 'nconc (mapcar 'vcard-flatten l)) + (list l))) + + +;;; Sample formatting routines. + +(defun vcard-format-sample-box (vcard) + "Like `vcard-format-sample-string', but put an ascii box around text." + (let* ((lines (vcard-format-sample-lines vcard)) + (len (vcard-format-sample-max-length lines)) + (edge (concat "\n+" (make-string (+ len 2) ?-) "+\n")) + (line-fmt (format "| %%-%ds |" len)) + (formatted-lines + (mapconcat (function (lambda (s) (format line-fmt s))) lines "\n"))) + (if (string= formatted-lines "") + formatted-lines + (concat edge formatted-lines edge)))) + +(defun vcard-format-sample-string (vcard) + "Format VCARD into a string suitable for display to user. +VCARD should be a parsed vcard alist. The result is a string +with formatted vcard information which can be inserted into a mime +presentation buffer." + (mapconcat 'identity (vcard-format-sample-lines vcard) "\n")) + +(defun vcard-format-sample-lines (vcard) + (let* ((name (vcard-format-sample-get-name vcard)) + (title (vcard-format-sample-values-concat vcard '("title") 1 "; ")) + (org (vcard-format-sample-values-concat vcard '("org") 1 "; ")) + (addr (vcard-format-sample-get-address vcard)) + (tel (vcard-format-sample-get-telephone vcard)) + (lines (delete nil (vcard-flatten (list name title org addr)))) + (col-template (format "%%-%ds%%s" + (vcard-format-sample-offset lines tel))) + (l lines)) + (while tel + (setcar l (format col-template (car l) (car tel))) + ;; If we stripped away too many nil slots from l, add empty strings + ;; back in so setcar above will work on next iteration. + (and (cdr tel) + (null (cdr l)) + (setcdr l (cons "" nil))) + (setq l (cdr l)) + (setq tel (cdr tel))) + lines)) + +(defun vcard-format-sample-get-name (vcard) + (let ((name (car (car (vcard-values vcard '("fn") nil 1)))) + (email (car (vcard-format-sample-values + vcard '((("email" "pref")) + (("email" "internet")) + (("email"))) 1)))) + (cond ((and name email) + (format "%s <%s>" name email)) + (email) + (name) + ("")))) + +(defun vcard-format-sample-get-telephone (vcard) + (let ((fields '(("Work: " + (("tel" "work" "pref") . ("fax" "pager" "cell")) + (("tel" "work" "voice") . ("fax" "pager" "cell")) + (("tel" "work") . ("fax" "pager" "cell"))) + ("Home: " + (("tel" "home" "pref") . ("fax" "pager" "cell")) + (("tel" "home" "voice") . ("fax" "pager" "cell")) + (("tel" "home") . ("fax" "pager" "cell")) + (("tel") . ("fax" "pager" "cell" "work"))) + ("Cell: " + (("tel" "cell" "pref")) + (("tel" "cell"))) + ("Fax: " + (("tel" "pref" "fax")) + (("tel" "work" "fax")) + (("tel" "home" "fax")) + (("tel" "fax"))))) + (phones nil) + result) + (while fields + (setq result (vcard-format-sample-values vcard (cdr (car fields)))) + (while result + (setq phones + (cons (concat (car (car fields)) (car (car result))) phones)) + (setq result (cdr result))) + (setq fields (cdr fields))) + (nreverse phones))) + +(defun vcard-format-sample-get-address (vcard) + (let* ((addr (vcard-format-sample-values vcard '((("adr" "pref" "work")) + (("adr" "pref")) + (("adr" "work")) + (("adr"))) 1)) + (street (delete "" (list (nth 0 addr) (nth 1 addr) (nth 2 addr)))) + (city-list (delete "" (nthcdr 3 addr))) + (city (cond ((null (car city-list)) nil) + ((cdr city-list) + (format "%s, %s" + (car city-list) + (mapconcat 'identity (cdr city-list) " "))) + (t (car city-list))))) + (delete nil (if city + (append street (list city)) + street)))) + +(defun vcard-format-sample-values-concat (vcard have-props limit sep) + (let ((l (car (vcard-values vcard have-props nil limit)))) + (and l (mapconcat 'identity (delete "" (vcard-copy-tree l)) sep)))) + +(defun vcard-format-sample-values (vcard proplists &optional limit) + (let ((result (vcard-format-sample-ref vcard proplists limit))) + (if (equal limit 1) + (cdr result) + (mapcar 'cdr result)))) + +(defun vcard-format-sample-ref (vcard proplists &optional limit) + (let ((result nil)) + (while (and (null result) proplists) + (setq result (vcard-ref vcard + (car (car proplists)) + (cdr (car proplists)) + limit)) + (setq proplists (cdr proplists))) + (if (equal limit 1) + (vcard-copy-tree (car result)) + (vcard-copy-tree result)))) + +(defun vcard-format-sample-offset (row1 row2 &optional maxwidth) + (or maxwidth (setq maxwidth (frame-width))) + (let ((max1 (vcard-format-sample-max-length row1)) + (max2 (vcard-format-sample-max-length row2))) + (if (zerop max1) + 0 + (+ max1 (min 5 (max 1 (- maxwidth (+ max1 max2)))))))) + +(defun vcard-format-sample-max-length (strings) + (let ((maxlen 0)) + (while strings + (setq maxlen (max maxlen (length (car strings)))) + (setq strings (cdr strings))) + maxlen)) + +(provide 'vcard) + +;;; vcard.el ends here. --- bbdb-2.35.cvs20080316.orig/bits/bbdb-mew.el +++ bbdb-2.35.cvs20080316/bits/bbdb-mew.el @@ -0,0 +1,248 @@ +;;; bbdb-mew.el --- BBDB interface to Mew + +;; Copyright (C) 1991, 1992 Jamie Zawinski +;; Copyright (C) 1996 Shuhei KOBAYASHI +;; Copyright (C) 1996 Daisuke Kanda +;; Copyright (C) 1999 Mitsuo Nishizawa + +;; Author: Jamie Zawinski <jwz@netscape.com> +;; Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp> +;; Daisuke Kanda <small@first.tsukuba.ac.jp> +;; Mitsuo Nishizawa <mitsuo@phys2.med.osaka-u.ac.jp> +;; Maintenance: Chris Beggy +;; Created: 1996/11/04 +;; Version: $Id: bbdb-mew.el,v 1.5 2001/12/29 16:12:20 chrisb Exp $ + +;; Keywords: mail, BBDB + +;; This file is not part of BBDB (Insidious Big Brother Database). + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Commentary: +;; +;; 2002-12-28 checked and edited for bbdb CVS version + mew 3.0.51 + emacs 21.1 + +;; Installation: +;; +;; Put bbdb-mew.el in your load path, so that emacs can find it. +;; +;; Run a patched bbdb-com.el to allow mew to be the mailer bbdb +;; uses if bbdb-send-mail-style is set to 'mew +;; +;; Insert the following lines in your ~/.emacs: +;; (other BBDB stuff comes here) +;; : +;; (autoload 'bbdb-insinuate-mew "bbdb-mew" "Hook BBDB into Mew") +;; (add-hook 'mew-init-hook 'bbdb-insinuate-mew) +;; (setq bbdb-send-mail-style 'mew) +;; +;; To use BBDB name at From: field of header in citation, please set +;; (setq mew-cite-bbdb-header t) +;; +;; Chris Beggy started doing some maintenance. + +;;; Codes: + +(require 'bbdb) +(require 'mew) + +(defvar mew-cite-bbdb-header nil) +(defvar mew-cite-bbdb-enable nil) + +(or (fboundp 'mew-header-get-value) + (fset 'mew-header-get-value (symbol-function 'mew-field-get-value)) + ) + +(defun bbdb/mew-update-record (&optional offer-to-create) + "Returns the record corresponding to the current mew message, +creating or modifying it as necessary. A record will be created if +bbdb/mail-auto-create-p is non-nil, or if OFFER-TO-CREATE is true and +the user confirms the creation." + (save-excursion + (set-buffer (mew-buffer-message)) + (if bbdb-use-pop-up + (bbdb/mew-pop-up-bbdb-buffer offer-to-create) + (let* ((from (mew-header-get-value mew-from:)) + (addr (and from + (car (cdr (mail-extract-address-components from)))))) + (if (or (null from) + (null addr) + (string-match (bbdb-user-mail-names) addr)) + (setq from (or (mew-header-get-value mew-to:) from))) + (if from + (bbdb-annotate-message-sender + from t + (or (bbdb-invoke-hook-for-value + bbdb/mail-auto-create-p) + offer-to-create) + offer-to-create)))))) + +(defun bbdb/mew-annotate-sender (string) + "Add a line to the end of the Notes field of the BBDB record +corresponding to the sender of this message." + (interactive + (list (if bbdb-readonly-p + (error "The Insidious Big Brother Database is read-only.") + (read-string "Comments: ")))) + (bbdb-annotate-notes (bbdb/mew-update-record t) string)) + +(defun bbdb/mew-edit-notes (&optional arg) + "Edit the notes field or (with a prefix arg) a user-defined field +of the BBDB record corresponding to the sender of this message." + (interactive "P") + (let ((record (or (bbdb/mew-update-record t) (error "")))) + (bbdb-display-records (list record)) + (if arg + (bbdb-record-edit-property record nil t) + (bbdb-record-edit-notes record t)))) + +(defun bbdb/mew-show-sender () + "Display the contents of the BBDB for the sender of this message. +This buffer will be in bbdb-mode, with associated keybindings." + (interactive) + (let ((record (bbdb/mew-update-record t))) + (if record + (bbdb-display-records (list record)) + (error "unperson")))) + +(defun bbdb/mew-pop-up-bbdb-buffer (&optional offer-to-create) + "Make the *BBDB* buffer be displayed along with the mew windows, +displaying the record corresponding to the sender of the current message." + (let ((framepop (eq temp-buffer-show-function 'framepop-display-buffer))) + (or framepop + (bbdb-pop-up-bbdb-buffer + (function + (lambda (w) + (let ((b (current-buffer))) + (set-buffer (window-buffer w)) + (prog1 (eq major-mode 'mew-message-mode) + (set-buffer b))))))) + (let ((bbdb-gag-messages t) + (bbdb-use-pop-up nil) + (bbdb-electric-p nil)) + (let ((record (bbdb/mew-update-record offer-to-create)) + (bbdb-display-layout bbdb-pop-up-display-layout) + (b (current-buffer))) + (if framepop + (if record + (bbdb-display-records (list record)) + (framepop-banish)) + (bbdb-display-records (if record (list record) nil))) + (set-buffer b) + record)))) + +;;; Utilities +;;; + +(defun bbdb-record-field (record field) + (cond + ((eq field 'firstname) (bbdb-record-firstname record)) + ((eq field 'lastname) (bbdb-record-lastname record)) + ((eq field 'aka) (bbdb-record-aka record)) + ((eq field 'company) (bbdb-record-company record)) + ((eq field 'phones) (bbdb-record-phones record)) + ((eq field 'addresses) (bbdb-record-addresses record)) + ((eq field 'net) (bbdb-record-net record)) + ((eq field 'raw-notes) (bbdb-record-raw-notes record)) + ((eq field 'cache) (bbdb-record-cache record)) + (t + (and (consp (bbdb-record-raw-notes record)) + (cdr (assq field (bbdb-record-raw-notes record))) + )))) + +(defun bbdb-record-fields (record fields) + (let (value) + (while (and fields (null value)) + (setq value (bbdb-record-field record (car fields))) + (setq fields (cdr fields))) + value)) + +;;; Register citation attribution in BBDB +;;; + +(defvar mew-cite-bbdb-fields '(attribution lastname firstname)) + +(defun mew-cite-prefix-bbdb () + (if mew-cite-bbdb-enable + (let (from petname prefix) + (setq from (mew-header-get-bbdb-name)) + (if (and mew-use-petname mew-petname-alist + (setq petname + (cdr (mew-assoc-case-equal from mew-petname-alist 0)))) + (setq prefix petname) + (setq prefix (mew-addrstr-extract-user from))) + (if mew-ask-cite-prefix + (setq prefix (read-string "Citation prefix: " prefix))) + (format "%s> " prefix) + ))) + +(defun mew-header-get-bbdb-name () + (if mew-cite-bbdb-enable + (let* ((from (mew-header-parse-address mew-from:)) + (addr from) + (name nil) + (net addr) + (record (and addr + (bbdb-search-simple name + (if (and net bbdb-canonicalize-net-hook) + (bbdb-canonicalize-address net) + net))))) + (or (and record + (bbdb-record-fields record mew-cite-bbdb-fields)) + net)))) + +(or (fboundp 'bbdb:mew-cite-strings) + (fset 'bbdb:mew-cite-strings (symbol-function 'mew-cite-strings))) + +(defun mew-cite-strings-bbdb () + (if mew-cite-bbdb-enable + (let (fields) + (if mew-cite-bbdb-header + (setq fields + (mapcar + (function + (lambda (x) + (or (if (string= x mew-from:) + (mew-header-get-bbdb-name) + (mew-header-get-value x)) + ""))) + mew-cite-fields)) + (setq fields + (mapcar (function mew-header-get-value) mew-cite-fields))) + (setq fields (mapcar (lambda (x) (or x "")) fields)) + (if mew-use-petname + (setq fields (mew-cite-strings-with-petname fields mew-cite-fields)) + ) + (if mew-use-bbdb + (apply (function format) mew-cite-format fields) + (bbdb:mew-cite-strings))))) + +;;; Installation +;;; + +(defun bbdb-insinuate-mew () + "Call this function to hook BBDB into Mew." + (if (string-match "2.3" (bbdb-version)) + (add-hook 'mew-message-hook 'bbdb/mew-update-record) + (bbdb-add-hook 'mew-message-hook 'bbdb/mew-update-record)) + (define-key mew-summary-mode-map ":" 'bbdb/mew-show-sender) + (define-key mew-summary-mode-map ";" 'bbdb/mew-edit-notes) + ) + +(provide 'bbdb-mew) + +;;; bbdb-mew.el ends here. --- bbdb-2.35.cvs20080316.orig/bits/bbdb-sort-mailrc.el +++ bbdb-2.35.cvs20080316/bits/bbdb-sort-mailrc.el @@ -1,21 +1,20 @@ ->>>>> Ronan Waide writes: +;;; >>>>> Ronan Waide writes: ->> * birthdays/anniversaries - -RW> This /is/ venturing into calendar land. Still, go to yer bbdb buffer -RW> and create a field with C-o. Again, I prefer not to add baggage to the -RW> file format unless it's absolutely necessary. Also, you should be able -RW> to attach bbdb to calendar.el using the bbdb record-dinking hooks so -RW> that it auto-fills your calendar with goop for you. And maybe get -RW> working on calendar-pilot.el... - -Well, this isn't really release-ready -- but since someone asks, it -could be a good starting point for someone. Feel free to -redistribute, or chop up and use the useful bits. - -Bng +;;; >> * birthdays/anniversaries +;;; RW> This /is/ venturing into calendar land. Still, go to yer bbdb buffer +;;; RW> and create a field with C-o. Again, I prefer not to add baggage to the +;;; RW> file format unless it's absolutely necessary. Also, you should be able +;;; RW> to attach bbdb to calendar.el using the bbdb record-dinking hooks so +;;; RW> that it auto-fills your calendar with goop for you. And maybe get +;;; RW> working on calendar-pilot.el... + +;;; Well, this isn't really release-ready -- but since someone asks, it +;;; could be a good starting point for someone. Feel free to +;;; redistribute, or chop up and use the useful bits. +;;; Bng + ;;; BBDB-BNG ;;; Various functions I have added to enhance the big brother database. ;;; Boris Goldowsky, <boris@cs.rochester.edu> --- bbdb-2.35.cvs20080316.orig/bits/bbdb-vcard-import.el +++ bbdb-2.35.cvs20080316/bits/bbdb-vcard-import.el @@ -0,0 +1,199 @@ +;;; bbdb-vcard-import.el -- import vCards into BBDB +;; +;; Copyright (c) 2008 Marcus Crestani +;; +;; bbdb-vcard-import.el is free software you can redistribute it and/or +;; modify it under the terms of the GNU General Public License as +;; published by the Free Software Foundation; either version 2, or (at +;; your option) any later version. +;; +;; This software is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to +;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +;; +;; Author: Marcus Crestani <crestani@informatik.uni-tuebingen.de> +;; Created: 2008-01-03 +;; Version: $Id: bbdb-vcard-import.el,v 1.6 2008/01/31 16:19:15 cvs Exp $ +;; Keywords: vcard bbdb +;; +;; This requires vcard.el by NoahFriedman for the importer to work. +;; +;; http://www.splode.com/~friedman/software/emacs-lisp/src/vcard.el +;; +;; The implementation is based on Christopher Smiths very simple +;; version of `bbdb-vcard-snarf-buffer': +;; +;; http://www.emacswiki.org/cgi-bin/wiki/BbdbImporters#toc3 +;; + +;;; Commentary + +;; +;; To import all vCards that are in the file ~/vCards.vcf do: +;; +;; M-x bbdb-vcard-import RET ~/vCards.vcf RET +;; + +;;; Todo + +;; +;; STREET ADDRESSES and PHONE NUMBERS are not yet imported. See +;; comment in `bbdb-vcard-merge'. +;; + +;;; ChangeLog + +;; +;; 2008-01-31 Marcus Crestani <crestani@informatik.uni-tuebingen.de> +;; - Do not enforce (type . "internet") for email addresses. +;; +;; 2008-01-03 Marcus Crestani <crestani@informatik.uni-tuebingen.de> +;; - Initial version. +;; + +;;; Code: + +(require 'vcard) +(require 'bbdb) + +(defvar bbdb-vcard-merged-records nil) + +(defun bbdb-vcard-filter-empty-values (values) + "Filter out empty values." + (if (consp values) + (if (string= "" (car values)) + (bbdb-vcard-filter-empty-values (cdr values)) + (cons (car values) (bbdb-vcard-filter-empty-values (cdr values)))))) + +(defun bbdb-vcard-values (record field) + "Return the values of an RECORD's FIELD; empty string entries are filtered out." + (let ((values (vcard-values record (list field)))) + (if values + (mapconcat 'identity + (bbdb-vcard-filter-empty-values (car values)) + ", ") + ""))) + +(defun bbdb-vcard-get-emails (record) + "Return a list of email addresses." + (let ((pref (vcard-ref record '("email" ("type" . "pref")))) + (rest (vcard-ref record '("email") '(("type" . "pref"))))) + (mapcar (lambda (entry) (car (cdr entry))) + (if pref + (cons (car pref) rest) + rest)))) + +(defun bbdb-vcard-get-phones (record) + "Return a list of phone number objects." + (let ((pref (vcard-ref record '("tel" ("type" . "pref")))) + (rest (vcard-ref record '("tel") '(("type" . "pref"))))) + (mapcar (lambda (entry) + (let ((proplist (car entry)) + (phone (car (cdr entry)))) + (vector + (vcard-get-property proplist "type") + phone))) + (if pref + (cons (car pref) rest) + rest)))) + +(defun bbdb-vcard-get-addresses (record) + "Return a list of adress objects." + (let ((pref (vcard-ref record '("adr" ("type" . "pref")))) + (rest (vcard-ref record '("adr") '(("type" . "pref"))))) + (mapcar (lambda (entry) + (let ((proplist (car entry)) + (phone (car (cdr entry)))) + (vector + (vcard-get-property proplist "type") + phone))) + (if pref + (cons (car pref) rest) + rest)))) + +(defun bbdb-vcard-merge-interactively (name company nets addrs phones notes) + "Interactively add a new record; see \\[bbdb-merge-interactively]." + (let* + ((f-l-name (bbdb-divide-name name)) + (firstname (car f-l-name)) + (lastname (nth 1 f-l-name)) + (aka nil) + (new-record + (vector firstname lastname aka company phones addrs + (if (listp nets) nets (list nets)) notes + (make-vector bbdb-cache-length nil))) + (old-record (bbdb-search-simple name nets))) + (if old-record + (progn + (setq new-record (bbdb-merge-internally old-record new-record)) + (bbdb-delete-record-internal old-record))) + ;; create new record + (bbdb-invoke-hook 'bbdb-create-hook new-record) + (bbdb-change-record new-record t) + (bbdb-hash-record new-record) + new-record)) + +(defun bbdb-vcard-merge (record) + "Merge data from vcard interactively into bbdb." + (let* ((name (bbdb-vcard-values record "fn")) + (company (bbdb-vcard-values record "org")) + (net (bbdb-vcard-get-emails record)) + (addrs (bbdb-vcard-get-addresses record)) + (phones (bbdb-vcard-get-phones record)) + (categories (bbdb-vcard-values record "categories")) + (notes (and (not (string= "" categories)) + (list (cons 'categories categories)))) + ;; TODO: addrs and phones are not yet imported. To do this + ;; right, figure out a way to map the several labels to + ;; `bbdb-default-label-list'. Also, some phone number + ;; conversion may break the format of numbers. + (new-record (bbdb-vcard-merge-interactively name company net nil nil notes))) + (setq bbdb-vcard-merged-records (append bbdb-vcard-merged-records + (list new-record))))) + +(defun bbdb-vcard-snarf-region (begin end) + "Bbdb-snarf each match." + (let ((record (vcard-parse-region begin end))) + (bbdb-vcard-merge record))) + +(defun bbdb-vcard-snarf-buffer (buf) + "Traverse BUF via regex. Bbdb-snarf against each match." + (setq bbdb-vcard-merged-records nil) + (let ((bbdb-current-buffer (current-buffer)) + (bbdb-current-point (point-min)) + (bbdb-next-point (point-min))) + (switch-to-buffer buf) + (goto-char bbdb-current-point) + (while (re-search-forward "END:VCARD" nil (message "%s done" buf)) + (setq bbdb-next-point (point)) + (bbdb-vcard-snarf-region bbdb-current-point (point)) + (switch-to-buffer buf) + (goto-char bbdb-next-point) + (setq bbdb-current-point (point))) + (switch-to-buffer bbdb-current-buffer) + (bbdb-display-records bbdb-vcard-merged-records))) + +(defun bbdb-vcard-snarf-current-buffer () + "Snarf the vcards in the current buffer." + (interactive) + (bbdb-vcard-snarf-buffer (current-buffer))) + +(defun bbdb-vcard-import-current-buffer () + "Import the vcards in the current buffer into your bbdb." + (interactive) + (bbdb-vcard-snarf-current-buffer)) + +(defun bbdb-vcard-import (file) + "Import the vcards in FILE into your bbdb." + (interactive "FvCard file to read from: ") + (let ((buffer (find-file file))) + (bbdb-vcard-snarf-buffer buffer) + (revert-buffer buffer) + (kill-buffer buffer))) + +(provide 'bbdb-vcard-import) --- bbdb-2.35.cvs20080316.orig/bits/bbdb-mail-folders.el +++ bbdb-2.35.cvs20080316/bits/bbdb-mail-folders.el @@ -1,38 +1,39 @@ -From: Geoffroy Ville <ville@isr.umd.edu> -Subject: bbdb/mail-folders -Date: 20 Nov 1998 00:00:00 GMT -Message-ID: <6azlnl56h9v.fsf@einstein.isr.umd.edu> -Sender: ville@einstein.isr.umd.edu -Organization: University of Maryland, College Park -X-Url: http://www.cenaath.cena.dgac.fr/~ville/ -Newsgroups: gnu.emacs.sources,gnu.emacs.vm.info - - -Just thought I would repost this piece of code after today's -improvement. Cengiz told me he does not use it hence does not maintain it -anymore. - -I do not remember where I got it from originally, thus this post in sources -and vm.info. - -For BBDB users, this code allows you to have several mail-folder by default -for a given author. Saving one mail creates automaically the entry if none, or -allows you to select which among the existing one you want, or add a new one. -Very useful when several people you know are involved in many different -projects. After a while, a typical entry would look like this: - - mail-folders: ("~/Mail/project1" "~/Mail/project2" "~/Mail/personal") - -My 2 cts addition is an expand file-name to get rid of possible duplicate -paths to the same file and a file-name-abbrevation to keep it ~/Mail for -example (very useful for me because I changed sites twice in the recent years -and had different home directories). - -I'm just *sharing* the code and will not have time to maintain it further. But -if it's buggy or outdated by some new feature of I_do_not_know_what, please -tell me :-) +;;; From: Geoffroy Ville <ville@isr.umd.edu> +;;; Subject: bbdb/mail-folders +;;; Date: 20 Nov 1998 00:00:00 GMT +;;; Message-ID: <6azlnl56h9v.fsf@einstein.isr.umd.edu> +;;; Sender: ville@einstein.isr.umd.edu +;;; Organization: University of Maryland, College Park +;;; X-Url: http://www.cenaath.cena.dgac.fr/~ville/ +;;; Newsgroups: gnu.emacs.sources,gnu.emacs.vm.info + + +;;; Just thought I would repost this piece of code after today's +;;; improvement. Cengiz told me he does not use it hence does not maintain it +;;; anymore. + +;;; I do not remember where I got it from originally, thus this post in sources +;;; and vm.info. + +;;; For BBDB users, this code allows you to have several mail-folder by default +;;; for a given author. Saving one mail creates automaically the entry if none, or +;;; allows you to select which among the existing one you want, or add a new one. +;;; Very useful when several people you know are involved in many different +;;; projects. After a while, a typical entry would look like this: + +;;; mail-folders: ("~/Mail/project1" "~/Mail/project2" "~/Mail/personal") + +;;; My 2 cts addition is an expand file-name to get rid of possible duplicate +;;; paths to the same file and a file-name-abbrevation to keep it ~/Mail for +;;; example (very useful for me because I changed sites twice in the recent years +;;; and had different home directories). + +;;; I'm just *sharing* the code and will not have time to maintain it further. But +;;; if it's buggy or outdated by some new feature of I_do_not_know_what, please +;;; tell me :-) ---- bbdb-mail-folders.el --- +;;; --- bbdb-mail-folders.el --- + ;A while back Roland posted advices to enable a mail-folder ;property. This property was used as the default folder name while ;saving messages in vm. @@ -113,9 +114,9 @@ ) (provide 'bbdb-mail-folders) + +;;; --- end --- ---- end --- +;;; Enjoy, -Enjoy, - --- Geoffroy +;;; -- Geoffroy --- bbdb-2.35.cvs20080316.orig/bits/bbdb-canonicalize-lt.el +++ bbdb-2.35.cvs20080316/bits/bbdb-canonicalize-lt.el @@ -0,0 +1,41 @@ +;;; As per email to bbdb-info list from Len Trigg <len@netvalue.net> +;;; http://sourceforge.net/mailarchive/message.php?msg_name=hbr60bfmvt.wl%25len@netvalue.net.nz + +;;; Useful name canonicalizer; consider inclusion in main package. + +(defun bbdb-canonicalize-name-hook-lt (name) + "Function used to canonicalize the full names of bbdb entries." + ;; (message (format "canonicalize name %s" name)) + (cond + ;; strip extra quotes (Some MS mailer likes "'full name'") + ((string-match "\\`[`'\"]\\(.*\\)[`'\"]\\'" name) + (bbdb-match-substring name 1)) + ;; replace multiple whitespace with single + ((string-match "[ \f\t\n\r\v]\\{2,\\}" name) + (replace-match " " nil t name)) + ;; remove anything in round brackets, e.g.: "Firstname Surname (E-mail)" + ((string-match "[ ]+(.*)" name) + (replace-match "" nil t name)) + ;; strip leading whitespace (this is a bug in std11 libs?) + ((string-match "\\`[ \t]+\\(.*\\)" name) + (bbdb-match-substring name 1)) + ;; strip trailing whitespace + ((string-match "\\(.*\\)[ ]+\\'" name) + (bbdb-match-substring name 1)) + ;; strip Dr pronoun + ((string-match "\\`Dr\\.? \\(.*\\)" name) + (bbdb-match-substring name 1)) + ;; person and person -> person & person + ((string-match "\\`\\(\\w+\\) and \\(\\w.+\\)\\'" name) + (concat (bbdb-match-substring name 1) " & " (bbdb-match-substring name 2))) + ;; Surname, Firstname -> Firstname Surname + ((string-match "\\`\\(\\w.+\\), \\(\\w.+\\)\\'" name) + (concat (bbdb-match-substring name 2) " " (bbdb-match-substring name 1))) + ;; Sometimes get an email address in the name part. Map the username to a name: <Name@domain> -> Name + ((string-match "\\`<\\(.*\\)@.*\\'" name) + (bbdb-match-substring name 1)) + ;; replace name without any whitespace with empty; I don't want bbdb names containing only a single name + ((string-match "\\`\\(\\w+\\)\\'" name) + ;;(message (format "Eliding name %s" name)) + "") + (t name))) --- bbdb-2.35.cvs20080316.orig/bits/bbdb-ldif.el +++ bbdb-2.35.cvs20080316/bits/bbdb-ldif.el @@ -1,6 +1,9 @@ ;;; Copyright (C) 1998,2000 by Niels Elgaard Larsen <elgaard@diku.dk> ;;; $Log: bbdb-ldif.el,v $ +;;; Revision 1.1 2006/02/04 15:35:15 joerg +;;; Added +;;; ;;; Revision 1.1 2005/02/13 14:16:03 waider ;;; * added new file, with minor abuse to make it work with current BBDB ;;; --- bbdb-2.35.cvs20080316.orig/bits/bbdb-gnokii.el +++ bbdb-2.35.cvs20080316/bits/bbdb-gnokii.el @@ -0,0 +1,865 @@ +;; bbdb-gnokii.el --- Export phone entries from BBDB to gnokii contacts file. + +;; +;; Copyright (C) 2000, 2003, 2004, 2005, 2006 +;; Martin Schwenke, Reiner Steib, Len Trigg +;; Authors: Martin Schwenke <martin@meltin.net>, +;; Reiner Steib <Reiner.Steib@gmx.de>, +;; Len Trigg <len@reeltwo.com> +;; Maintainer: Martin Schwenke <martin@meltin.net> +;; Created: 23 August 2000 +;; $Id: bbdb-gnokii.el,v 1.16 2006/04/19 13:02:09 martins Exp $ +;; Keywords: BBDB, Nokia, gnokii +;; X-URL: http://meltin.net/hacks/emacs/ + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; If you have not received a copy of the GNU General Public License +;; along with this software, it can be obtained from the GNU Project's +;; World Wide Web server (http://www.gnu.org/copyleft/gpl.html), from +;; its FTP server (ftp://ftp.gnu.org/pub/gnu/GPL), by sending an electronic +;; mail to this program's maintainer or by writing to the Free Software +;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +;;; Commentary: +;; +;; Exports BBDB phone entries to a contacts file that can be used by +;; gnokii to write them to a Nokia mobile phone. +;; +;; No responsibility for blowing up your phone... blah, blah, blah... +;; I recommend dumping your phone book to a file (using xgnokii, say) +;; and keeping it in a safe place until you are sure that +;; bbdb-gnokii.el doesn't do anything stupid. +;; +;; The latest version of this file is available via: +;; +;; http://meltin.net/hacks/emacs/ +;; +;; The gnokii web site is +;; +;; http://www.gnokii.org/ +;; +;; bbdb-gnokii.el is loosely based on JWZ's bbdb-pilot-jwz.el. +;; +;; gnokii expects a file with the following format: +;; +;; name;number;memory_type;entry_location;caller_group_number;\ +;; subentry_type;subentry_number_type;subentry_id;subentry_text +;; +;; The length and syntax of "name" and "number" are limited, so some +;; munging goes on. You can adjust the munging to your needs by +;; customizing the variables `bbdb-gnokii-firstname-transform', +;; `bbdb-gnokii-lastname-transform' and +;; `bbdb-gnokii-location-transform'. +;; +;; The default settings of these variables reflect Martin's preferences. +;; Here is a combination of alternative settings used by Reiner: +;; +;; (setq +;; ;; Use long firstnames and lastnames and a short location: +;; bbdb-gnokii-firstname-transform 'bbdb-gnokii-transform-word +;; bbdb-gnokii-lastname-transform 12 +;; bbdb-gnokii-location-transform 'bbdb-gnokii-transform-location +;; bbdb-gnokii-max-name-length 16) +;; +;; The memory_type specifies where to write the contacts (phone memory +;; or SIM card). See variable `bbdb-gnokii-default-memory-type' and +;; it's documentation for details. + +;; Configuration: +;; +;; Add this to your ~/.emacs or equivalent: +;; +;; (autoload +;; 'bbdb-gnokii-export +;; "bbdb-gnokii" +;; "Export phone entries from BBDB to a Gnokii contacts file." +;; t) +;; +;; If you want to add some standard entries to your phone, you can put +;; them in a file and set the following variable: +;; +;; (setq bbdb-gnokii-extras-file +;; (expand-file-name "~/.bbdb-gnokii-extras.txt")) +;; +;; The contents of the specified file get appended to the file +;; generated from the BBDB (cf. `bbdb-gnokii-extras-file-position'). +;; My phone vendor preloads a bunch of their numbers into the SIM +;; card, and I'm keeping them until I'm sure they're not useful! +;; +;; Entries are only extracted from the BBDB for entries that have a +;; gnokii field. In general, if this field is present, then all of +;; the phone numbers (except those that have locations listed in +;; `bbdb-gnokii-exclude-locations') will be exported. +;; +;; For example: +;; +;; Fred Smith - Widget, Inc. +;; mobile: (04) 1234 5678 +;; home: (02) 1234 5678 +;; gnokii: t +;; +;; will have 2 items exported: +;; +;; Fred S mobile;0412345678;... +;; Fred S home;0212345678;... +;; +;; For entries with a name, the default generated name is the first +;; word of firstname, space, first letter of lastname. +;; +;; For entries without a name, but with a company, the default +;; generated name is the first word of the company name. +;; +;; The phone number locations are only appended if there is more than +;; 1 phone entry exported. +;; +;; If the gnokii field contains a string in double-quotes, then it +;; will be used as the name. +;; +;; If the gnokii field contains something like location=X then the +;; number for location will be put into speed-dial location X. All +;; other entries are put between `bbdb-gnokii-general-min-location' +;; and `bbdb-gnokii-general-max-location'. +;; +;; If the gnokii field contains something like (Y) then the entry will +;; belong to caller group Y, otherwise +;; `bbdb-gnokii-default-caller-group' is used. +;; +;; So, +;; +;; Fred Smith - Widget, Inc. +;; mobile: (04) 1234 5678 +;; home: (02) 1234 5678 +;; fax: (02) 8765 4321 +;; gnokii: "Freddy" (0) mobile=2 home=3 +;; +;; will have 2 items exported: +;; +;; Freddy mobile;0412345678;...;0; +;; Freddy home;0212345678;...;0; +;; +;; No item is exported for the fax number because it is a member of +;; `bbdb-gnokii-exclude-locations'. +;; +;; If the gnokii field contains "skip=foo", the phone number corresponding to +;; the location "foo" will not be exported. +;; +;; You can also export a whole BBDB record to a single gnokii entry by +;; setting `bbdb-gnokii-phonebook-style' to `multi' or `mega'. In +;; this style the default phone number can be set by specifying the +;; associated location in the BBDB gnokii field. For example, if the +;; gnokii field contains "[work]" then the phone number with location +;; "work" will be the default one. If no default location is +;; specified in the gnokii field, then the order of preference is +;; determined by `bbdb-gnokii-preferred-phone-locations'. If +;; `bbdb-gnokii-phonebook-style' is set to `mega', an email address +;; and postal address are also added to the gnokii entry, when +;; available. + +;; See the variables and code below for more details. You may check all +;; customizable variables using `M-x customize-group RET bbdb-gnokii RET'. + + + +;;; History: + +;; $Log: bbdb-gnokii.el,v $ +;; Revision 1.16 2006/04/19 13:02:09 martins +;; Function bbdb-gnokii-do-name now just uses firstname if lastname is +;; not set. Suggested by Magnus Henoch <mange@freemail.hu>. +;; +;; Revision 1.15 2005/06/06 09:52:49 martins +;; Added support for gnokii entries with multiple phone numbers using +;; subentries, implemented using a variation and subset of code by Len +;; Trigg: new variables bbdb-gnokii-phonebook-style and +;; bbdb-gnokii-preferred-phone-locations; removed variable +;; bbdb-gnokii-insert-extra-fields (replaced by +;; bbdb-gnokii-phonebook-style); removed defstruct bbdb-gnokii; replaced +;; functions bbdb-gnokii-convert and bbdb-gnokii-format with new function +;; bbdb-gnokii-format-record, which has most of the implementation +;; details for this feature; new functions bbdb-gnokii-format-address, +;; bbdb-gnokii-phones-find-location, bbdb-gnokii-get-default-phone; +;; retain '+' in phone number in function bbdb-gnokii-fix-phone; +;; bbdb-gnokii-export just calls bbdb-gnokii-format-record for each +;; record, instead of converting and then formatting; added Len Trigg to +;; to copyright and authors. +;; +;; Revision 1.14 2004/03/30 12:01:29 martins +;; After discussion with Reiner, changed the names of the following +;; variables: +;; +;; bbdb-gnokii-default-group -> bbdb-gnokii-default-caller-group +;; bbdb-gnokii-default-memtype -> bbdb-gnokii-default-memory-type +;; bbdb-gnokii-general-maxpos -> bbdb-gnokii-general-max-location +;; bbdb-gnokii-general-minpos -> bbdb-gnokii-general-min-location +;; bbdb-gnokii-speed-maxpos -> bbdb-gnokii-speed-dial-max-location +;; bbdb-gnokii-speed-minpos -> bbdb-gnokii-speed-dial-min-location +;; +;; for consistency with gnokii documentation, and changed associated +;; documentation accordingly. In struct bbdb-gnokii- changed name of +;; member `mempos' to `location'. Also changed function names: +;; +;; bbdb-gnokii-do-mempos -> bbdb-gnokii-do-location +;; bbdb-gnokii-do-group -> bbdb-gnokii-do-caller-group +;; +;; Revision 1.13 2004/03/02 00:50:53 martins +;; Documentation cleanups by Reiner Steib <Reiner.Steib@gmx.de>. +;; +;; Revision 1.12 2004/02/27 03:40:59 martins +;; bbdb-gnokii-default-memtype now has default value of "SM" (for +;; compatibility with xgnokii >= 0.6) - documentation and customisation +;; choices have also been improved. bbdb-gnokii-default-group's +;; documentation and customisation choices have also been improved. +;; Changes implemented by Reiner Steib <Reiner.Steib@gmx.de>. +;; +;; Revision 1.11 2004/02/25 01:16:08 martins +;; Added RCS Log section in History and imported previous entries. +;; Thanks again to Reiner. +;; +;; Revision 1.10 2004/02/07 11:47:04 martins +;; Replaced uses of bbdb-gnokii-extra-tag with bbdb-gnokii-extra-tags. +;; Oops. + +;; Revision 1.9 2004/02/07 11:40:31 martins +;; `bbdb-gnokii-extra-tags': New variable for Siemens C35 used in +;; `bbdb-gnokii-export'. Exchanged defun and defalias: +;; bbdb-gnokii-export vs. bbdb-to-gnokii-file. Changed documentation +;; section to mention bbdb-gnokii-export, not bbdb-to-gnokii. Renamed +;; function bbdb-record-to-gnokii-records to bbdb-gnokii-convert. Minor +;; cosmetic fixes. Thanks to Reiner Steib <Reiner.Steib@gmx.de>. + +;; Revision 1.8 2004/02/06 03:07:33 martins +;; Merged changes from Reiner Steib <reiner.steib@gmx.de>: Made +;; variables customizable. Did some checkdoc fixes. Made many things +;; more flexible, especially the shortening of firstname, lastname and +;; location strings. Added `bbdb-gnokii-add-field'. Also replaced +;; variable `bbdb-gnokii-maxpos' with `bbdb-gnokii-general-minpos' and +;; `bbdb-gnokii-general-maxpos'. Added information about where to get +;; latest version. Various documentation fixes. Added variable +;; `bbdb-gnokii-insert-extra-fields'. Various documentation fixes. +;; Removed declarations of variables `bbdb-gnokii-mempos' and +;; `bbdb-gnokii-speed-done' (since they are bound in a `let'). + +;; Revision 1.7 2003/07/01 01:44:29 martins +;; Added extra fields to output, which seem to be required for newer +;; phones/gnokiis. + +;; Revision 1.6 2003/06/30 01:58:10 martins +;; (bbdb-gnokii-do-name): Handle case where lastname is empty. + +;; Revision 1.5 2001/02/12 00:10:45 martin +;; Changed e-mail address. + +;; Revision 1.4 2000/10/04 00:41:58 martins +;; Changed default-memtype back to "A". + +;; Revision 1.3 2000/08/25 02:58:15 martins +;; - Added documentation and stuff at top. +;; - Changed spelling from Gnokii to gnokii. +;; - Changed default memory type to work with command-line gnokii. +;; - Reduced allowable length of names. +;; - Added bbdb-gnokii-exclude-locations and associated filtering. +;; Thanks to Chris Yeoh. +;; - Added various comments. + +;; Revision 1.2 2000/08/24 11:52:57 martins +;; Fixed RCS Id string. + +;; Revision 1.1 2000/08/24 11:52:39 martins +;; Initial revision + + +;;; Code: +(require 'bbdb) + +;; Only for `bbdb-gnokii-add-field': +(autoload 'bbdb-merge-interactively "bbdb-snarf" nil nil) +(autoload 'bbdb-add-new-field "bbdb-com" nil nil) + +(defgroup bbdb-gnokii nil + "Sync BBDB and gnokii." + :group 'bbdb) + +(defcustom bbdb-gnokii-transform-word-regexp + (if (string-match "[[:word:]]" "x") + "[^-[:word:]]" + ;; old Emacsen (e.g. Emacs 20) don't support character classes. + "[^-A-Za-z]") + "Regexp used to shorten names in `bbdb-gnokii-transform-word'." + :group 'bbdb-gnokii + :type '(choice (const :tag "first word" "[^-[:word:]]") + (const :tag "ascii" "[^-A-Za-z]") + (regexp :tag "Other"))) + +(defun bbdb-gnokii-transform-max (name &optional limit) + "Limit NAME to LIMIT characters." + (if (> (length name) limit) + (substring name 0 limit) + name)) + +(defun bbdb-gnokii-transform-word (name &optional regexp) + "Shorten NAME to first word. +`bbdb-gnokii-transform-word-regexp' is used unless REGEXP is given." + (substring name + 0 (string-match (or regexp bbdb-gnokii-transform-word-regexp) name))) + +(defun bbdb-gnokii-transform-location (location) + "Shorten LOCATION field." + ;; The default BBDB location "Office" and "Other" both give "O" + (if (string= name "Other") + "o" + (bbdb-gnokii-transform-max location 1))) + +(defcustom bbdb-gnokii-firstname-transform 'bbdb-gnokii-transform-word + "How to transform the lastname field to short variant. +If a function, call it with the name as it's argument. If a number, use +substring with maximal length number." + :group 'bbdb-gnokii + :type '(choice (const bbdb-gnokii-transform-word) + (function) + (integer))) + +(defcustom bbdb-gnokii-lastname-transform 1 + "How to transform the lastname field to short variant. +If a function, call it with the name as it's argument. If a number, use +substring with maximal length number." + :group 'bbdb-gnokii + :type '(choice (const bbdb-gnokii-transform-word) + (function) + (integer))) + +(defcustom bbdb-gnokii-location-transform 10 + "Transform the location field to short variant. +If a function, call it with the name as it's argument. If a number, use +substring with maximal length number." + :group 'bbdb-gnokii + :type '(choice (const bbdb-gnokii-transform-location) + (function) + (integer))) + +(defun bbdb-gnokii-apply-transform (transform name) + "Apply transformation TRANSFORM to NAME and return a shortened name." + (cond + ((functionp transform) + (funcall transform name)) + ((natnump transform) + (bbdb-gnokii-transform-max name transform)) + (t name))) + +(defcustom bbdb-gnokii-extras-file nil + "Name of file containing extra entries to add to gnokii." + :group 'bbdb-gnokii + :type '(choice (const :tag "None" nil) + (file))) + +(defcustom bbdb-gnokii-extra-tags nil + "List of two string elements: \"\(\"tag\" \"indicator\"\)\" or nil. +For each occurance of the form \"location=tag\" in the BBDB gnokii field, the +gnokii string \"indicator\" will be appended to the generated name in the +gnokii file. In some Siemens phones \(C35 and possibly others\), the +indicator \"!\" is used to specify a \"VIP entry\"." + :group 'bbdb-gnokii + :type '(choice (const :tag "Siemens C35 style" ("vip" "!")) + (list (symbol :tag "BBDB tag") + (symbol :tag "Gnokii string")))) + +(defcustom bbdb-gnokii-default-output-file nil + "Name of the default output file. +If the filename contains the string \"%s\", it will be replaced +with the current date in ISO format (YYYY-MM-DD)." + :group 'bbdb-gnokii + :type '(choice (const :tag "None" nil) + (file))) + +(defcustom bbdb-gnokii-extras-file-position 'bottom + "Where to insert `bbdb-gnokii-extras-file'." + :group 'bbdb-gnokii + :type '(choice (const :tag "Top" top) + (const :tag "Bottom" bottom))) + +(defcustom bbdb-gnokii-inserted-hook nil + "Hook run after all records from BBDB were inserted into the output buffer. +The hook is called in the output buffer immediately before saving the buffer." + :group 'bbdb-gnokii + :type 'hook) + +(defcustom bbdb-gnokii-confirm-kill nil + "Ask for confirmation before killing the output buffer." + :group 'bbdb-gnokii + :type 'boolean) + +(defcustom bbdb-gnokii-phonebook-style 'single + "Style for phonebook entries. +This affects the number of phone numbers per gnokii entry and the way +the name is constructed. `single' (the default) allows only a single +phone number per gnokii entry, and also generates a subentry for that +phone number. `ancient' also allows only a single phone number per +gnokii entry, but generates no subentry - older versions of gnokii +seem to work like this. `multiple' causes all phone numbers for a +BBDB entry to be put into a single gnokki entry, using multiple +subentries - in this case the location is also never appended to the +name. `mega' is like multiple but causes the 1st email address and +postal address to also be put into the gnokii entry. Note that +`multiple' and `mega' probably won't work well with +`bbdb-gnokii-default-memory-type' set to \"SM\"." + :type '(choice (const :tag "Single with subentry" single) + (const :tag "Single without subentry" ancient) + (const :tag "Multiple subentries" multiple) + (const :tag "Subentries, email, postal" mega))) + +(defcustom bbdb-gnokii-speed-dial-min-location 1 + "Minimum memory location allowed for speed dial entries. +See also `bbdb-gnokii-general-min-location', +`bbdb-gnokii-general-max-location' and +`bbdb-gnokii-speed-dial-max-location'. The range for speed dial +entries should not overlap with the range for general entries, or +entries found in `bbdb-gnokii-extras-file'." + :group 'bbdb-gnokii + :type 'integer) + +(defcustom bbdb-gnokii-speed-dial-max-location 9 + "Maximum memory location allowed for speed dial entries. +See also `bbdb-gnokii-general-min-location', +`bbdb-gnokii-general-max-location' and +`bbdb-gnokii-speed-dial-min-location'. The range for speed dial +entries should not overlap with the range for general entries, or +entries found in `bbdb-gnokii-extras-file'." + :group 'bbdb-gnokii + :type 'integer) + +(defcustom bbdb-gnokii-general-min-location 10 + "Minimum memory location allowed for general BBDB to gnokii entries. +See also `bbdb-gnokii-general-max-location', +`bbdb-gnokii-speed-dial-min-location' and +`bbdb-gnokii-speed-dial-max-location'. The range for speed dial +entries should not overlap with the range for general entries, or +entries found in `bbdb-gnokii-extras-file'." + :group 'bbdb-gnokii + :type 'integer) + +(defcustom bbdb-gnokii-general-max-location 89 + "Maximum memory location allowed for general BBDB to gnokii entries. +See also `bbdb-gnokii-general-min-location', +`bbdb-gnokii-speed-dial-min-location' and +`bbdb-gnokii-speed-dial-max-location'. The range for speed dial +entries should not overlap with the range for general entries, or +entries found in `bbdb-gnokii-extras-file'." + :group 'bbdb-gnokii + :type 'integer) + +(defcustom bbdb-gnokii-default-memory-type "SM" + "Default type of phone memory to use for BBDB to gnokii entries. +\"SM\" is for SIM card, \"ME\" for the phone memory. In versions prior to +0.6, `xgnokii' used \"A\" is for SIM card and \"B\" for the phone memory. +Please see the documentation of gnokii and xgnokii for valid values." + :group 'bbdb-gnokii + :type '(choice (const :tag "SIM card" "SM") + (const :tag "phone memory" "ME") + (const :tag "SIM card (for old xgnokii)" "A") + (const :tag "phone memory (for old xgnokii)" "B") + ;; Other valid memory types probably aren't writable. + (string :tag "Other"))) + +(defcustom bbdb-gnokii-default-caller-group 5 + "Default caller group to put BBDB to gnokii entries into. + +If the gnokii field contains something like \"\(N\)\" then the entry will +belong to caller group N, otherwise `bbdb-gnokii-default-caller-group' +is used. Possible values are 0 \(Family\), 1 \(VIP\), 2 \(Friends\), +3 \(Colleagues\), 4 \(Other group\), 5 \(No group\). Note that these +are defaults, you are able to change these manually in your phone. +See also \"caller_group_number\" in the documentation of gnokii." + :group 'bbdb-gnokii + :type '(choice (const :tag "0 (Family)" 0) + (const :tag "1 (VIP)" 1) + (const :tag "2 (Friends)" 2) + (const :tag "3 (Colleagues)" 3) + (const :tag "4 (Other group)" 4) + (const :tag "5 (No group)" 5) + (integer :tag "Other"))) + +(defcustom bbdb-gnokii-max-name-length 17 + "Maximum allowable length of name field." + :group 'bbdb-gnokii + :type 'integer) + +(defcustom bbdb-gnokii-exclude-locations '("fax") + "List of locations for phone numbers to exclude." + :group 'bbdb-gnokii + :type '(choice (const :tag "None" nil) + (const :tag "Fax" '("fax")) + (repeat (string :tag "Field")))) + +(defcustom bbdb-gnokii-preferred-phone-locations '("mobile" "home" "work") + "List of locations for choosing default phone number in multi-phone entries. +The phone number associated with earliest location in this list is used. +Otherwise, the first phone number is used." + :group 'bbdb-gnokii + :type '(choice (repeat (string :tag "Field")))) + +(defconst bbdb-gnokii-label-type-alist + '(("home" . 2) + ("mobile" . 3) + ("fax" . 4) + ("office" . 6) + ("work" . 6) + ("." . 10)) + "Alist mapping BBDB phones labels to gnokii phone number types.") + +(defun bbdb-gnokii-format-record (record) + "Convert a BBDB RECORD to text in the current buffer." + + (let ((allphones (bbdb-record-phones record)) + (allnet (bbdb-record-net record)) + (alladdresses (bbdb-record-addresses record)) + (stuff (if (listp (bbdb-record-raw-notes record)) + (cdr (assq 'gnokii (bbdb-record-raw-notes record))))) + (subentry-id 0) + name useloc phones default-phone print-escape-newlines) + + (setq name (bbdb-gnokii-do-name (bbdb-record-lastname record) + (bbdb-record-firstname record) + (bbdb-record-company record) + stuff)) + + ;; Filter out unwanted phone locations and find default phone number. + (while allphones + (let ((p (car allphones))) + (if (not (or (member (bbdb-phone-location p) + bbdb-gnokii-exclude-locations) + (string-match (concat "\\<skip=\\(" + (bbdb-phone-location p) + "\\)\\>") + (or stuff "")))) + (add-to-list 'phones p))) + (setq allphones (cdr allphones))) + + (if (memq bbdb-gnokii-phonebook-style '(multiple mega)) + (setq default-phone (bbdb-gnokii-get-default-phone phones stuff))) + + ;; Only continue if they have a name, a gnokii field and some + ;; phone numbers. + (if (and name stuff phones) + (progn + ;; Only add the location to name if there is >1 phone number + ;; and we're not doing multiple-subentries. + (setq useloc (and (> (length phones) 1) + (memq bbdb-gnokii-phonebook-style + '(ancient single)))) + ;; Create records. + (while phones + (let* ((location (bbdb-phone-location (car phones))) + (loc (bbdb-gnokii-apply-transform + bbdb-gnokii-location-transform + location)) + (num (bbdb-gnokii-fix-phone + (bbdb-phone-string (car phones)))) + (default-loc (or (and default-phone + (bbdb-gnokii-apply-transform + bbdb-gnokii-location-transform + (bbdb-phone-location default-phone))) + loc)) + (default-num (or (and default-phone + (bbdb-gnokii-fix-phone + (bbdb-phone-string default-phone))) + num)) + (name (if useloc (concat name " " loc) name))) + (if (> (length name) bbdb-gnokii-max-name-length) + ;; Don't error out on long entries, truncate them instead. + (progn + (message + (concat + "Name \"%s\" is too long. " + "Maybe you want to edit gnokii field.") + name) + (setq + name + (cond + ;; Make sure we don't strip location: + (useloc + (concat + (bbdb-gnokii-transform-max + name (- bbdb-gnokii-max-name-length + (1+ (length loc)))) + " " loc)) + (t + (bbdb-gnokii-transform-max + name bbdb-gnokii-max-name-length)))))) + ;; Checking for bbdb-gnokii-extra-tags: + (when (and (car bbdb-gnokii-extra-tags) + (cadr bbdb-gnokii-extra-tags) + location + (string-match + (concat + "\\<" location + "=" + (regexp-quote (car bbdb-gnokii-extra-tags)) + "\\>") + stuff)) + ;; extra entry found, changing label: + (setq name + (concat (bbdb-gnokii-transform-max + name (- bbdb-gnokii-max-name-length 1)) + (cadr bbdb-gnokii-extra-tags)))) + + (if (= subentry-id 0) + (insert (format "%s;%s;%s;%s;%s" + name + default-num + bbdb-gnokii-default-memory-type + (bbdb-gnokii-do-location stuff default-loc) + (bbdb-gnokii-do-caller-group stuff)))) + (if (not (eq bbdb-gnokii-phonebook-style 'ancient)) + (insert (format ";11;%d;%d;%s" + (assoc-default location + bbdb-gnokii-label-type-alist + 'string-match nil) + subentry-id + num))) + + ;; Continute along list of phone numbers. + (setq phones (cdr phones)) + ;; If doing multiple per entry, increment subentry-id count. + (if (memq bbdb-gnokii-phonebook-style '(multiple mega)) + (setq subentry-id (1+ subentry-id)) + (insert "\n")))) + + (when (eq bbdb-gnokii-phonebook-style 'mega) + ;; First email address? + (when allnet + (insert (format ";8;0;%d;%s" subentry-id (car allnet))) + (setq subentry-id (1+ subentry-id))) + ;; First postal address? + (when alladdresses + (insert (format ";9;0;%d;%s" subentry-id + (bbdb-gnokii-format-address (car alladdresses)))) + (setq subentry-id (1+ subentry-id)))) + (if (memq bbdb-gnokii-phonebook-style '(multiple mega)) + (insert "\n")) + )))) + +(defun bbdb-gnokii-format-address (address) + "Generates a single-line representation of an address." + (let (st field) + (cond ((>= bbdb-file-format 6) + (setq st (bbdb-join (bbdb-address-streets address) "\\n"))) + (t + (setq st (bbdb-address-street1 address)) + (if (> (length (bbdb-address-street2 address)) 0) + (setq st (concat st "\\n" (bbdb-address-street2 address)))) + (if (> (length (bbdb-address-street3 address)) 0) + (setq st (concat st "\\n" (bbdb-address-street3 address)))))) + (setq field (bbdb-address-city address)) + (if (> (length field) 0) (setq st (concat st "\\n" field))) + (setq field (bbdb-address-state address)) + (if (> (length field) 0) (setq st (concat st "\\n" field))) + (setq field (bbdb-address-zip-string address)) + (if (> (length field) 0) (setq st (concat st "\\n" field))) + (setq field (bbdb-address-country address)) + (if (> (length field) 0) (setq st (concat st "\\n" field))) + st)) + +(defun bbdb-gnokii-do-name (lastname firstname company stuff) + "Construct a name from the given arguments." + + (let (name) + + (cond + + ((and stuff + (string-match "\"\\([^\"]+\\)\"" stuff)) + (setq name (substring stuff (match-beginning 1) (match-end 1)))) + + (firstname + ;; Yay, they have a name! Default is first word of firstname, + ;; space, first letter of lastname. + (setq name + (bbdb-gnokii-apply-transform + bbdb-gnokii-firstname-transform firstname)) + (when (> (length lastname) 0) + (setq name + (concat name + " " + (setq name + (bbdb-gnokii-apply-transform + bbdb-gnokii-lastname-transform lastname)))))) + (company + ;; Yay, first word of company name! + ;; Maybe this should be made customizable, too (Reiner Steib). + (setq name (substring company 0 (string-match " " company))))) + name)) + + +(defun bbdb-gnokii-do-location (stuff loc) + "Calculate the `location' field for a gnokii record. +The field content STUFF and the location LOC are used." + + (let (num) + (if (and stuff + (string-match (concat "\\<" loc "=\\([0-9]+\\)") stuff)) + (progn + (setq num (string-to-number + (substring stuff (match-beginning 1) (match-end 1)))) + (if (or (< num bbdb-gnokii-speed-dial-min-location) + (> num bbdb-gnokii-speed-dial-max-location) + (member num bbdb-gnokii-speed-done)) + (error + "Speed dial location %d out of range or duplicate for %s" + num name) + (add-to-list 'bbdb-gnokii-speed-done num))) + (if (> bbdb-gnokii-location bbdb-gnokii-general-max-location) + (error "Too many records to fit in SIM card!")) + (setq num bbdb-gnokii-location) + (setq bbdb-gnokii-location (+ bbdb-gnokii-location 1))) + num)) + +(defun bbdb-gnokii-do-caller-group (bbdb-field) + "Calculate the caller `group' field for given BBDB-FIELD." + + (let (group) + (if (and bbdb-field + (string-match "(\\([0-9]+\\))" bbdb-field)) + (setq group (string-to-number + (substring bbdb-field (match-beginning 1) (match-end 1)))) + (setq group bbdb-gnokii-default-caller-group)) + group)) + +(defun bbdb-gnokii-phones-find-location (location phones) + "Return the phone element in PHONES with given LOCATION, nil if not found." + (let ((ps phones) + ret) + (while (and (not ret) ps) + (if (string= location (bbdb-phone-location (car ps))) + (setq ret (car ps))) + (setq ps (cdr ps))) + ret)) + +(defun bbdb-gnokii-get-default-phone (phones stuff) + "Get the default phone entry for a record." + + (let* ((loc (and stuff + (string-match "\\[\\([^]]+\\)\\]" stuff) + (substring stuff (match-beginning 1) (match-end 1)))) + (locs bbdb-gnokii-preferred-phone-locations) + ret) + + (if loc + (setq ret (bbdb-gnokii-phones-find-location loc phones))) + + (while (and (not ret) locs) + (setq ret (bbdb-gnokii-phones-find-location (car locs) phones)) + (setq locs (cdr locs))) + (or ret (car phones)))) + +(defun bbdb-gnokii-fix-phone (phone) + "Change phone number PHONE to gnokii compatible form." + + (let ((chars phone) + out) + (while (> (length chars) 0) + (let ((h (substring chars 0 1))) + (if (string-match "[+0-9]" h) + (setq out (concat out h))) + (setq chars (substring chars 1)))) + out)) + +;;;###autoload +(defalias 'bbdb-to-gnokii-file 'bbdb-gnokii-export) + +;;;###autoload +(defun bbdb-gnokii-export (filename &optional records) + "Export phone entries from BBDB to a gnokii contacts file FILENAME. +Unless RECORDS is given, all BBDB entries are processed." + (interactive + (list (let ((default (if (stringp bbdb-gnokii-default-output-file) + (format bbdb-gnokii-default-output-file + (format-time-string "%Y-%m-%d" (current-time))) + default-directory))) + (read-file-name "Output file: " + (file-name-directory default) + default + nil + (file-name-nondirectory default))))) + (or records (setq records (bbdb-records))) + (save-excursion + (set-buffer (find-file-noselect filename)) + (erase-buffer) + (let ((len (length records)) + (i 0) + (bbdb-gnokii-location bbdb-gnokii-general-min-location) + bbdb-gnokii-speed-done) + (while records + (message "%d%%..." (/ (* 100 i) len)) + (bbdb-gnokii-format-record (car records)) + (setq records (cdr records) + i (1+ i)))) + (when (and bbdb-gnokii-extras-file + (file-readable-p bbdb-gnokii-extras-file)) + (cond ((eq bbdb-gnokii-extras-file-position 'top) + (goto-char (point-min))) + ((eq bbdb-gnokii-extras-file-position 'bottom) + (goto-char (point-max)))) + (insert-file-contents bbdb-gnokii-extras-file)) + (run-hooks 'bbdb-gnokii-inserted-hook) + (save-buffer) + ;; Useful especially when testing. + (when (or (not bbdb-gnokii-confirm-kill) + (y-or-n-p "Kill output buffer? ")) + (kill-buffer (current-buffer)))) + filename) + +;;;###autoload +(defun bbdb-gnokii-add-field (&optional records) + "Go through all RECORDS and ask for adding a gnokii field. +If RECORDS is nil, go thru all records. If a BBDB record has an +expire field in YYYY-MM-DD format \(e.g. \"expire=2003-12-31\"\), +the record is skipped if it is older than today." + (interactive) + (or records (setq records (bbdb-records))) + (bbdb-add-new-field 'gnokii) + (dolist (record records) + ;; Go thru all records, check if we have a phone and no gnokii field. + (if (bbdb-record-phones record) + (let* ((have-gnokii + (and (listp (bbdb-record-raw-notes record)) + (cdr (assq 'gnokii (bbdb-record-raw-notes record))))) + (expire + (and (listp (bbdb-record-raw-notes record)) + (cdr (assq 'expire (bbdb-record-raw-notes record))))) + (name (bbdb-record-name record)) + (is-expired (and + expire + (string-lessp expire + (format-time-string + "%Y-%m-%d" (current-time)))))) + (message "In record `%s': gnokii=`%s', expire=`%s', is-exp=`%s'" + name have-gnokii expire is-expired) + (cond + (is-expired + (message "In record `%s': is expired." name)) + (have-gnokii + (message "In record `%s': already has gnokii field." name)) + ((y-or-n-p (format "Add gnokii field to `%s'? " name)) + (bbdb-merge-interactively name;; name + nil ;; company + nil ;; net + nil ;; addrs + nil ;; phones + '((gnokii . "t"))) + (message "In record `%s': gnokii field added." name)) + (t + (message "In record `%s': gnokii refused interactively." name)))) + (message "In record `%s': no phone found." (bbdb-record-name record))))) + +(provide 'bbdb-gnokii) + +;;; bbdb-gnokii.el ends here --- bbdb-2.35.cvs20080316.orig/bits/bbdb-obsolete.el +++ bbdb-2.35.cvs20080316/bits/bbdb-obsolete.el @@ -4,7 +4,7 @@ ;; Author: Colin Rafferty <colin@xemacs.org> ;; Keywords: bbdb, net, obsolete -;; Version: $Id: bbdb-obsolete.el,v 1.1 2002/06/29 23:59:19 waider Exp $ +;; Version: $Id: bbdb-obsolete.el,v 1.3 2006/02/04 15:34:30 joerg Exp $ ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by --- bbdb-2.35.cvs20080316.orig/utils/bbdb-srv.pl +++ bbdb-2.35.cvs20080316/utils/bbdb-srv.pl @@ -1,4 +1,4 @@ -#!/usr/local/bin/perl +#!/usr/bin/perl # This script reads a block of message headers on stdin, and converts them # to an emacs-lisp string (quoting all dangerous characters) and then --- bbdb-2.35.cvs20080316.orig/utils/bbdb-cid.pl +++ bbdb-2.35.cvs20080316/utils/bbdb-cid.pl @@ -1,4 +1,4 @@ -#!/usr/local/bin/perl5 -w +#!/usr/bin/perl -w # # Caller-ID-logger, by jwz (19-Jan-97) # Modified: 24-Apr-97 --- bbdb-2.35.cvs20080316.orig/utils/bbdb-unlazy-lock.pl +++ bbdb-2.35.cvs20080316/utils/bbdb-unlazy-lock.pl @@ -1,4 +1,4 @@ -#!/usr/local/bin/perl +#!/usr/bin/perl # # Author: Christopher Kline <ckline@media.mit.edu> #