>>>>> On Wed, 26 Nov 2003 10:28:52 +0100, Robert Widhopf <[EMAIL PROTECTED]> said:
>> 
>> Try `dabbrev-completion' or write your own function and
>> supply a patch ...

> Better use: M-x mail-interactive-insert-alias RET
> or bind it ti a key of your choice ...

I don't love mail-interactive-insert-alias.  I prefer to type a little
bit on the header line and hit TAB to complete.  I wrote this function
a few years ago to expand aliases along with addresses.  I use a
defadvice on eudc-expand-inline (I use eudc to search both bbdb and my
company's ldap directory; I believe the same after advice would work
fine on bbdb-complete-name) to call it to check for mail-aliases if
ldap and bbdb both fail.

(defun dsg-complete-alias ()
  (interactive)
  (let* ((b-o-w (save-excursion
                  (forward-word -1)
                  (point)))
         (word (buffer-substring b-o-w (point)))
         (maybes (all-completions word mail-aliases)))
    (cond ((null maybes)
           (error "no aliases match %s" word))
          ((= (length maybes) 1)
           (delete-region b-o-w (point))
           (insert (car maybes)))
          (t
           (with-output-to-temp-buffer "*Completions*"
             (display-completion-list maybes))))
    (expand-abbrev)))


-- 
Dave Goldberg
[EMAIL PROTECTED]




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/

Reply via email to