emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/ebdb 8ca9902869 2/2: Fix mis-parsing of surname prefixe


From: Eric Abrahamsen
Subject: [elpa] externals/ebdb 8ca9902869 2/2: Fix mis-parsing of surname prefixes
Date: Sat, 5 Nov 2022 23:02:30 -0400 (EDT)

branch: externals/ebdb
commit 8ca9902869b6a3e3bb4d0d2b45b88f476146b7b6
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>

    Fix mis-parsing of surname prefixes
    
    Fixes #106
    
    * ebdb.el (ebdb-divide-name): The prefix should only be found at the
    beginning of the string, separated by a space from the actual surname.
---
 ebdb-test.el | 5 +++++
 ebdb.el      | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/ebdb-test.el b/ebdb-test.el
index ad9c9c4710..ac73d37c5c 100644
--- a/ebdb-test.el
+++ b/ebdb-test.el
@@ -358,6 +358,11 @@ If it doesn't exist, raise `ebdb-related-unfound'."
            (ebdb-parse 'ebdb-field-name-complex "MURAKAMI Haruki")
            'surname)
           "Murakami"))
+  (should (equal
+          (slot-value
+           (ebdb-parse 'ebdb-field-name-complex "John Reddemann")
+           'surname)
+          "Reddemann"))
   (should (equal
           (slot-value
            (ebdb-parse 'ebdb-field-name-complex "Fintan O'Toole")
diff --git a/ebdb.el b/ebdb.el
index 9634fc3c48..065b30931c 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -2,7 +2,7 @@
 
 ;; Copyright (C) 2016-2022  Free Software Foundation, Inc.
 
-;; Version: 0.8.14
+;; Version: 0.8.15
 ;; Package-Requires: ((emacs "25.1") (seq "2.15"))
 
 ;; Maintainer: Eric Abrahamsen <eric@ericabrahamsen.net>
@@ -5464,7 +5464,7 @@ usage) to represent the surname."
                               (substring string 0 (match-beginning 0)))
                    string (match-string 1 string)))))
     (setq given (when given (split-string given nil t)))
-    (cond ((string-match (regexp-opt ebdb-lastname-prefixes) string)
+    (cond ((string-match (concat "\\`" (regexp-opt ebdb-lastname-prefixes) " 
") string)
           (setq prefix (substring string 0 (match-end 0))
                 string (substring string (match-end 0))))
          ((and (>= (length given) 2)



reply via email to

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