Inline query expansion is a powerful method to get completion from your
directory server. The most common usage is for expanding names to email
addresses in mail message buffers. The expansion is performed by the
command M-x eudc-expand-inline which is available from the
‘Expand Inline Query’ menu item but can also be conveniently
bound to a key shortcut (see Installation). The operation is
controlled by the variables
If the query fails for a server, other servers may be tried successively until one of them finds a match (see Multi-server Queries).
Query the server and expand the query string before point. The query string consists of the buffer substring from the point back to the preceding comma, colon or beginning of line.
eudc-inline-query-formatcontrols how individual words are mapped onto directory attribute names. After querying the server for the given string, the expansion specified by
eudc-inline-expansion-formatis inserted in the buffer at point. If replace-p is
tthen this expansion replaces the query string in the buffer. If
nilthen the meaning of replace-p is negated.
Format of an inline expansion query. This is actually a list of formats. A format is a list of one or more EUDC attribute names. A format applies if it contains as many attributes as individual words in the inline query string. If several formats apply then they are tried in order until a match is found. If
nilall the words will be mapped onto the default server/protocol attribute name (generally
For instance, use the following(setq eudc-inline-query-format '((name) (firstname) (firstname name)))
to indicate that single word expansion queries are to be considered as surnames and if no match is found then they should be tried as first names. Inline queries consisting of two words are considered as consisting of a first name followed by a surname. If the query consists of more than two words, then the first one is considered as the first name and the remaining words are all considered as surname constituents.
formats are in fact not limited to EUDC attribute names, you can use server or protocol specific names in them. It may be safer if you do so, to set the variable
eudc-inline-query-formatin a protocol or server local fashion (see see Server/Protocol Locals).
For instance you could use the following to match up to three words against the
cnattribute of LDAP servers:(eudc-protocol-set 'eudc-inline-query-format '((cn) (cn cn) (cn cn cn)) 'ldap)
This variable lets you control exactly what is inserted into the buffer upon an inline expansion request. It is a list whose first element is a string passed to
format. Remaining elements are symbols corresponding to directory attribute names. The corresponding attribute values are passed as additional arguments to
format. Default is
("%s" email)but you may want to consider a value like
("%s <%s>" name email)
This variable controls what to do when multiple entries match a query for an inline expansion. Possible values are:
- The first match is considered as being the only one, the others are discarded.
- A selection buffer pops up where you can choose a particular match. This is the default value of the variable.
- The expansion uses all records successively
- An error is signaled. The expansion aborts.