Skip to content

Commit

Permalink
Properly deal with whitespace between given-name and family-name
Browse files Browse the repository at this point in the history
  • Loading branch information
tumashu committed May 30, 2015
1 parent 1c37bfb commit a596c89
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions bbdb-vcard.el
Expand Up @@ -591,9 +591,18 @@ Extend existing BBDB records where possible."
(name-to-search-for
(when raw-name (if (stringp raw-name)
raw-name
(concat (nth 1 raw-name) ; given name
" .*"
(nth 0 raw-name))))) ; family name
(let* ((given-name (nth 1 raw-name))
(family-name (nth 0 raw-name))
(separator
(if (or (not given-name) ; if given-name or family-name
(not family-name) ; is `nil', whitespace is needless.
;; No whitespace needed between
;; given-name and family-name for CJK users.
(string-match-p "\\cc" (or given-name ""))
(string-match-p "\\cc" (or family-name "")))
".*"
" .*")))
(concat given-name separator family-name)))))
(vcard-nicknames
(bbdb-vcard-flatten (bbdb-vcard-search scard "NICKNAME" "content")))
;; Organization suitable for storing in BBDB:
Expand Down

0 comments on commit a596c89

Please sign in to comment.