Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes issue #10 where empty N and FN fields would throw an error #15

Closed
wants to merge 1 commit into from

Conversation

dbankmann
Copy link

Now just returns an empty string

…n error

Now just returns an empty string
Copy link
Owner

@DamienCassou DamienCassou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your work. Can you please take care of my comments? I will try to fix the build so travis is happy with your PR.



(describe "contact-no-name"
(it "contacts without FN or F should return empty string"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please move this it to the describe called "knows how to extract a contact's fullname" and rename it to "when there is neither FN nor F"?

@@ -84,9 +84,11 @@ Return nil if PROPERTY is not in CONTACT."
"Return the fullname of CONTACT."
(or
(vdirel--contact-property "FN" contact)
(if (equal (vdirel--contact-property "N" contact) nil)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer a different code structure (untested):

(or
  (vdirel--contact-property "FN" contact)
  (let ((name (vdirel--contact-property "N" contact)))
    (when name
      (replace-regexp-in-string ";" " " name)))
  "")

@DamienCassou
Copy link
Owner

Can you please also rebase your branch on top of latest master? It will hopefully make the travis build pass.

@DamienCassou
Copy link
Owner

Next time, I suggest you follow the best practices to open a PR, it will make both our lifes easier :-). No need to change this PR though, it's ok.

@peterhoeg
Copy link

I have addressed this differently in #18 (I wasn't aware of this PR), where we just return the email address for the name to at least give us something in case N or FN are both missing. If the approach in this PR is preferred, I'll change accordingly of course.

@DamienCassou
Copy link
Owner

I'm closing this PR as the author isn't responding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants