addressbook-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Addressbook-devel] treatment of the FN field


From: David A . Thompson
Subject: Re: [Addressbook-devel] treatment of the FN field
Date: Sat, 27 Oct 2012 10:55:48 -0700
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.8 Emacs/23.4 (i486-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

At Fri, 19 Oct 2012 15:19:33 -0700,
David A. Thompson wrote:
> 
> Attached is a patch which modifies ABOOK-GET-CARD-FN so that the FN
> field is preferred and deriving a value using the N field is used only
> when the FN field doesn't provide a non-empty value.
> 

I wonder if something which provides the user with more flexibility
with respect to 'fallback' behavior (i.e., what to do when FN isn't
specified absent or empty) is preferable to my initial suggestion. It
might be implemented along the lines of:

(defun abook-get-card-fn (&optional with-aka card-number)
  (let ((card (abook-get-card (if card-number
                                  card-number
                                abook-current-card))))
    (let* ((fn-attr (vcard-get-named-attribute card "fn"))
           (fn-attr-values (if fn-attr (vcard-attr-get-values fn-attr)))
           (fn (nth 0 fn-attr-values))) 
      (if (and fn (not (equal fn "")))
          fn 
        (if (functionp abook-get-card-fn-fallback)
            (funcall abook-get-card-fn-fallback card with-aka)
          "FN unspecified and ABOOK-GET-CARD-FN-FALLBACK doesn't point
  at a function")))))

The attached patch could be used for something along these lines.

Attachment: abook-el.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]