branch: externals/ebdb
commit 4f3db7ffefdb825394003d816330df63d19ad2f1
Author: Eric Abrahamsen <[email protected]>
Commit: Eric Abrahamsen <[email protected]>
Save match data around ebdb-parse-i18n
* ebdb-i18n.el (ebdb-parse-i18n): Parse methods are likely to using
regexp matching, save match data around them.
---
ebdb-i18n.el | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/ebdb-i18n.el b/ebdb-i18n.el
index 8a7401b..ed9b0f1 100644
--- a/ebdb-i18n.el
+++ b/ebdb-i18n.el
@@ -77,6 +77,11 @@ This method should return a new instance of CLASS.")
(cl-defgeneric ebdb-delete-field-i18n (field record spec unload)
"An internationalized version of `ebdb-delete-field'.")
+(cl-defmethod ebdb-parse-i18n :around (_class _string _spec)
+ "Don't clobber match data when testing names."
+ (save-match-data
+ (cl-call-next-method)))
+
;;;###autoload
(defun ebdb-internationalize-addresses ()
"Go through all the EBDB contacts and \"internationalize\"