stardiviner <numbch...@gmail.com> writes:

> I try to define custom faces to be applied in variable =bbdb-name-face-alist= 
> for
> variant field names.
>
> Here is my try:
>
> #+BEGIN_SRC emacs-lisp
> ;;; define variant faces for variant xfields
>
> ;; TODO: improve it
> (setq bbdb-name-face-alist '((mail . bbdb-field-mail)
>                              (mail-alias . bbdb-field-mail-alias)))
>
> (defface bbdb-field-mail
>   '((t (:inherit bbdb-field-name :foreground "green yellow")))
>   "Face used for BBDB fields."
>   :group 'bbdb-faces)
>
> (defface bbdb-field-mail-alias
>   '((t (:inherit bbdb-field-name :foreground "yellow")))
>   "Face used for BBDB fields."
>   :group 'bbdb-faces)
> #+END_SRC
>
>
> But this seems does not work.
> I checked the docstring of =bbdb-name-face-alist=.

I think this is just a misunderstanding about what
`bbdb-name-face-alist' does. It *only* provides font-locking for the
actual name of the record, not the other fields. You give the record an
xfield called 'name-face, and the *value* of that field points to one of
the keys of `bbdb-name-face-alist'. Then the specified face is used to
format the name of the record, none of its other fields.

HTH,
Eric

> Description about the ~KEY~.
>
> #+BEGIN_QUOTE
> the xfield name-face of this record should have the value KEY.
> The value of name-face may also be a face which is then used directly.
> If none of these schemes succeeds, the face `bbdb-name' is used.
> #+END_QUOTE
>
> I think maybe I do not have the ~KEY~ (like ~mail~, ~mail-alias~) defined.
>
> So How to defined those key automatically based on the BBDB database?
>
> If it's not what I'm thinking. Then what it is?
>
> ------------------------------------------------------------------------------
> Want fast and easy access to all the code in your enterprise? Index and
> search up to 200,000 lines of code with a free copy of Black Duck
> Code Sight - the same software that powers the world's largest code
> search on Ohloh, the Black Duck Open Hub! Try it now.
> http://p.sf.net/sfu/bds
> _______________________________________________
> bbdb-info@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bbdb-info
> BBDB Home Page: http://bbdb.sourceforge.net/


------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/

Reply via email to