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

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

[elpa] externals/ebdb dc4217d 213/350: Compiler-inspired fixes, volume 5


From: Eric Abrahamsen
Subject: [elpa] externals/ebdb dc4217d 213/350: Compiler-inspired fixes, volume 5453
Date: Mon, 14 Aug 2017 11:46:38 -0400 (EDT)

branch: externals/ebdb
commit dc4217d16dd6ab4b4b463e80517912b8b557ccd2
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>

    Compiler-inspired fixes, volume 5453
---
 ebdb-chn.el     | 18 ++++++++---------
 ebdb-com.el     | 24 +++++++++++++++++++++++
 ebdb-format.el  | 60 ++++++++++++++++++++++++++++-----------------------------
 ebdb-gnus.el    | 12 ++++++------
 ebdb-migrate.el |  3 +--
 ebdb-mua.el     | 28 ++-------------------------
 ebdb-pgp.el     | 56 ++++++++++++++++++++++++++---------------------------
 ebdb-vcard.el   | 44 +++++++++++++++++++++---------------------
 ebdb.el         | 10 +++++++---
 9 files changed, 129 insertions(+), 126 deletions(-)

diff --git a/ebdb-chn.el b/ebdb-chn.el
index d785116..6b777e1 100644
--- a/ebdb-chn.el
+++ b/ebdb-chn.el
@@ -41,14 +41,14 @@
         (format "X%d" extension)
        ""))))
 
-(cl-defmethod ebdb-parse-i18n ((class (subclass ebdb-field-phone))
+(cl-defmethod ebdb-parse-i18n ((_class (subclass ebdb-field-phone))
                               (str string)
-                              (cc (eql 86))
+                              (_cc (eql 86))
                               &optional slots)
   ;; First remove everything but the numbers.
   (let ((num-str (string-trim
                  (replace-regexp-in-string "[^0-9Xx]+" "" str)))
-       a-code number extension)
+       a-code)
     ;; In China, basically everything that starts with a 1 is a cell
     ;; number, unless it starts with a 10, in which case it's the
     ;; Beijing area code.  Sometimes the area codes are written with a
@@ -73,8 +73,8 @@
 
 (cl-defmethod ebdb-parse-i18n ((class (subclass ebdb-field-name-complex))
                               (string string)
-                              (script (eql han))
-                              &optional slots)
+                              (_script (eql han))
+                              &optional _slots)
   (let (surname given-names)
     (if (string-match (format "\\`\\(%s\\)\\(.*\\)\\'" (regexp-opt 
ebdb-china-compound-surnames)) string)
        (setq surname (match-string 1 string)
@@ -82,12 +82,12 @@
       (setq surname (substring string 0 1)
            given-names (substring string 1)))
 
-    (make-instance 'ebdb-field-name-complex
+    (make-instance class
                   :surname surname
                   :given-names (list given-names))))
 
 (cl-defmethod ebdb-string-i18n ((field ebdb-field-name-complex)
-                               (script (eql han)))
+                               (_script (eql han)))
   "Properly format names in Chinese characters.
 
 This should only run once, at init time, or any time a record's
@@ -153,12 +153,12 @@ searchs via pinyin will find the record."
 
 (cl-defmethod ebdb-init-field-i18n ((field ebdb-field-name)
                                    record
-                                   (script (eql han)))
+                                   (_script (eql han)))
   (ebdb-china-handle-name field record 'add))
 
 (cl-defmethod ebdb-delete-field-i18n ((field ebdb-field-name)
                                      record
-                                     (script (eql han))
+                                     (_script (eql han))
                                      _unload)
   (ebdb-china-handle-name field record 'del))
 
diff --git a/ebdb-com.el b/ebdb-com.el
index 901797f..3b6041b 100644
--- a/ebdb-com.el
+++ b/ebdb-com.el
@@ -658,6 +658,30 @@ buffer."
   `ebdb-buffer-name'."
   (format "*%s*" ebdb-buffer-name))
 
+(cl-defgeneric ebdb-popup-window (major-mode)
+  "Return a spec for how to pop up a window on an *EBDB* buffer.
+
+This generic function dispatches on the current value of
+major-mode.  The return value should be a two-element list
+of (window split), in which WINDOW is the window to split, and
+SPLIT is either an integer, specifying number of rows/columns, or
+a float specifying what percentage of window real estate the
+pop-up should occupy.  SPLIT can also be nil, in which case the
+window will probably take up half the available space.
+
+Alternately, the return value can be nil, which means continue
+using the current window.")
+
+(cl-defmethod ebdb-popup-window (&context (major-mode ebdb-mode))
+  "When popping up from an existing *EBDB* buffer, just reuse the window.
+
+Ie, don't pop up at all."
+  nil)
+
+(cl-defmethod ebdb-popup-window ()
+  "When popping up from a random window, use half the window."
+  (list (get-buffer-window) 0.5))
+
 (defun ebdb-display-records (records &optional fmt append
                                      select pop buf)
   "Display RECORDS using FMT.
diff --git a/ebdb-format.el b/ebdb-format.el
index 9f7e950..0c13d09 100644
--- a/ebdb-format.el
+++ b/ebdb-format.el
@@ -96,13 +96,13 @@
 (cl-defmethod ebdb-string ((fmt ebdb-formatter))
   (slot-value fmt 'object-name))
 
-(defgeneric ebdb-fmt-header (fmt records)
+(cl-defgeneric ebdb-fmt-header (fmt records)
   "Insert a string at the beginning of the list of records.")
 
-(defgeneric ebdb-fmt-footer (fmt records)
+(cl-defgeneric ebdb-fmt-footer (fmt records)
   "Insert a string at the end of the list of records.")
 
-(defgeneric ebdb-fmt-record (fmt record)
+(cl-defgeneric ebdb-fmt-record (fmt record)
   "Handle the insertion of formatted RECORD.
 
 This method collects all the fields to be output for RECORD,
@@ -110,13 +110,13 @@ groups them into header fields and body fields, and then 
calls
 `ebdb-fmt-record-header' and `ebdb-fmt-record-body' with the two
 lists, respectively.")
 
-(defgeneric ebdb-fmt-record-header (fmt record fields)
+(cl-defgeneric ebdb-fmt-record-header (fmt record fields)
   "Format a header for RECORD, using the fields in FIELDS.")
 
-(defgeneric ebdb-fmt-record-body (fmt record fields)
+(cl-defgeneric ebdb-fmt-record-body (fmt record fields)
   "Format the body of RECORD, using the fields in FIELDS.")
 
-(defgeneric ebdb-fmt-collect-fields (fmt record &optional fields)
+(cl-defgeneric ebdb-fmt-collect-fields (fmt record &optional fields)
   "Return a list of RECORD's FIELDS to be formatted.
 
 Each element of FIELDS is either a single field instance, or a
@@ -124,20 +124,20 @@ list of field instances.  Which fields are present, how 
they're
 sorted, and how they're combined into lists is determined by the
 \"exclude\" and \"sort\" slots of FMT.")
 
-(defgeneric ebdb-fmt-process-fields (fmt record &optional fields))
+(cl-defgeneric ebdb-fmt-process-fields (fmt record &optional fields))
 
-(defgeneric ebdb-fmt-sort-fields (fmt record &optional fields))
+(cl-defgeneric ebdb-fmt-sort-fields (fmt record &optional fields))
 
 ;; Do we still need this now that formatters and specs are collapsed?
-(defgeneric ebdb-fmt-compose-field (fmt field-cons record))
+(cl-defgeneric ebdb-fmt-compose-field (fmt field-cons record))
 
-(defgeneric ebdb-fmt-field (fmt field style record)
+(cl-defgeneric ebdb-fmt-field (fmt field style record)
   "Format FIELD value of RECORD.
 
 This method only returns the string value of FIELD itself,
 possibly with text properties attached.")
 
-(defgeneric ebdb-fmt-field-label (fmt field-or-class style record)
+(cl-defgeneric ebdb-fmt-field-label (fmt field-or-class style record)
   "Format a field label, using formatter FMT.
 
 FIELD-OR-CLASS is a field class or a field instance, and STYLE is
@@ -178,55 +178,55 @@ which formats them appropriately."
           inst
           ", "))))
 
-(cl-defmethod ebdb-fmt-field-label ((fmt ebdb-formatter)
+(cl-defmethod ebdb-fmt-field-label ((_fmt ebdb-formatter)
                                    (cls (subclass ebdb-field))
                                    _style
-                                   (record ebdb-record))
+                                   (_record ebdb-record))
   (ebdb-field-readable-name cls))
 
-(cl-defmethod ebdb-fmt-field-label ((fmt ebdb-formatter)
+(cl-defmethod ebdb-fmt-field-label ((_fmt ebdb-formatter)
                                    (field ebdb-field)
                                    _style
-                                   (record ebdb-record))
+                                   (_record ebdb-record))
   (ebdb-field-readable-name field))
 
-(cl-defmethod ebdb-fmt-field-label ((fmt ebdb-formatter)
+(cl-defmethod ebdb-fmt-field-label ((_fmt ebdb-formatter)
                                    (field ebdb-field-labeled)
                                    _style
-                                   (record ebdb-record))
+                                   (_record ebdb-record))
   (eieio-object-name-string field))
 
-(cl-defmethod ebdb-fmt-field-label ((fmt ebdb-formatter)
+(cl-defmethod ebdb-fmt-field-label ((_fmt ebdb-formatter)
                                    (field ebdb-field-labeled)
-                                   (style (eql compact))
-                                   (record ebdb-record))
+                                   (_style (eql compact))
+                                   (_record ebdb-record))
   (ebdb-field-readable-name field))
 
 (cl-defmethod ebdb-fmt-field ((fmt ebdb-formatter)
                              (field ebdb-field-labeled)
-                             (style (eql compact))
+                             (_style (eql compact))
                              (record ebdb-record))
   (format "(%s) %s"
          (eieio-object-name-string field)
          (ebdb-fmt-field fmt field 'oneline record)))
 
-(cl-defmethod ebdb-fmt-field ((fmt ebdb-formatter)
+(cl-defmethod ebdb-fmt-field ((_fmt ebdb-formatter)
                              (field ebdb-field)
-                             (style (eql oneline))
-                             (record ebdb-record))
+                             (_style (eql oneline))
+                             (_record ebdb-record))
   (car (split-string (ebdb-string field) "\n")))
 
 (cl-defmethod ebdb-fmt-field ((fmt ebdb-formatter)
                              (field ebdb-field)
-                             (style (eql collapse))
+                             (_style (eql collapse))
                              (record ebdb-record))
   "For now, treat collapse the same as oneline."
   (ebdb-fmt-field fmt field 'oneline record))
 
-(cl-defmethod ebdb-fmt-field ((fmt ebdb-formatter)
+(cl-defmethod ebdb-fmt-field ((_fmt ebdb-formatter)
                              (field ebdb-field)
                              _style
-                             (record ebdb-record))
+                             (_record ebdb-record))
   "The base implementation for FIELD simply returns the value of
   `ebdb-string'."
   (ebdb-string field))
@@ -318,10 +318,10 @@ which formats them appropriately."
       (cl-call-next-method fmt record field-list))))
 
 (cl-defmethod ebdb-fmt-sort-fields ((fmt ebdb-formatter)
-                                   (record ebdb-record)
+                                   (_record ebdb-record)
                                    field-list)
   (let ((sort (slot-value fmt 'sort))
-       f acc outlist)
+       f acc outlist class)
     (when sort
       (dolist (s sort)
        (if (symbolp s)
@@ -345,7 +345,7 @@ which formats them appropriately."
     field-list))
 
 (cl-defmethod ebdb-fmt-process-fields ((fmt ebdb-formatter)
-                                      (record ebdb-record)
+                                      (_record ebdb-record)
                                       field-list)
   "Process FIELD-LIST for FMT.
 
diff --git a/ebdb-gnus.el b/ebdb-gnus.el
index 061d6f8..4bcc463 100644
--- a/ebdb-gnus.el
+++ b/ebdb-gnus.el
@@ -75,7 +75,7 @@
 
 (cl-defmethod ebdb-read ((field (subclass ebdb-gnus-private-field)) &optional 
slots obj)
   (let ((group (ebdb-read-string "Group name: " (when obj (slot-value obj 
'group)))))
-    (cl-call-next-method)))
+    (cl-call-next-method field (plist-put slots :group group) obj)))
 
 (cl-defmethod ebdb-string ((field ebdb-gnus-private-field))
   (slot-value field 'group))
@@ -108,7 +108,7 @@ record which contains a gnus-score field.")
   "This function is called through `ebdb-after-change-hook',
 and sets `ebdb/gnus-score-rebuild-alist' to t if the changed
 record contains a gnus-score field."
-  (if (ebdb-record-user-field record ebdb-gnus-score-field)
+  (if (ebdb-record-user-field record 'ebdb-gnus-score-field)
       (setq ebdb/gnus-score-rebuild-alist t)))
 
 ;;;###autoload
@@ -126,7 +126,7 @@ addresses better than the traditionally static global 
scorefile."
                   (ding) (sit-for 2)
                   nil)))))
 
-(defun ebdb/gnus-score-as-text (group)
+(defun ebdb/gnus-score-as-text (_group)
   "Returns a SCORE file format string built from the EBDB."
   (cond ((or (cond ((/= (or ebdb/gnus-score-default 0)
                         (or ebdb/gnus-score-default-internal 0))
@@ -140,7 +140,7 @@ addresses better than the traditionally static global 
scorefile."
                (concat "((touched nil) (\"from\"\n"
                        (mapconcat
                         (lambda (record)
-                          (let ((score (or (ebdb-record-user-field record 
ebdb-gnus-score-field)
+                          (let ((score (or (ebdb-record-user-field record 
'ebdb-gnus-score-field)
                                            ebdb/gnus-score-default))
                                 (mail (ebdb-record-mail record)))
                             (when (and score mail)
@@ -300,9 +300,9 @@ determine the group and spooling priority for a single 
address."
              (record (car (ebdb-message-search (car tmp) mail)))
              public private rgx)
         (when record
-          (setq private (ebdb-record-user-field record  
ebdb-gnus-private-field)
+          (setq private (ebdb-record-user-field record  
'ebdb-gnus-private-field)
                ;; TODO: Fix this, there's no longer a public field.
-                public (ebdb-record-user-field record 
ebdb/gnus-split-public-field))
+                public (ebdb-record-user-field record 
'ebdb/gnus-split-public-field))
           (if (and public (not source) (string-match "^\\([^ ]+\\) \\(.*\\)$" 
public))
               (setq rgx (substring public (match-beginning 2) (match-end 2))
                     public (substring public (match-beginning 1) (match-end 
1)))
diff --git a/ebdb-migrate.el b/ebdb-migrate.el
index 00dfd2b..2c326ab 100644
--- a/ebdb-migrate.el
+++ b/ebdb-migrate.el
@@ -25,7 +25,7 @@
 ;;; Code:
 
 (require 'ebdb)
-
+(autoload 'calendar-absolute-from-gregorian "calendar")
 ;;; Migrating the EBDB
 
 ;; Unused
@@ -535,7 +535,6 @@ holding valid contacts in a previous BBDB format."
         ((eq lab 'anniversary)
          (let* ((bits (split-string val " "))
                 (date-bits (split-string (car bits) "-")))
-           (require 'calendar)
            (push (make-instance 'ebdb-field-anniversary
                                 :date (calendar-absolute-from-gregorian
                                        (mapcar #'string-to-number
diff --git a/ebdb-mua.el b/ebdb-mua.el
index 0422ca2..d9d7314 100644
--- a/ebdb-mua.el
+++ b/ebdb-mua.el
@@ -676,8 +676,8 @@ variables `ebdb-user-mail-address-re',
       (throw 'done t))))
 
 ;; How are you supposed to do the &context arglist for a defgeneric?
-;; (cl-defgeneric ebdb-message-header (header)
-;;   "Get value of HEADER for the mua keyed to major-mode.")
+(cl-defgeneric ebdb-message-header (header)
+  "Get value of HEADER for the mua keyed to major-mode.")
 
 (defun ebdb-get-address-components (&optional header-class ignore-address)
   "Process mail addresses extracted from a message.
@@ -1092,30 +1092,6 @@ Dispatches on the value of major-mode."
   ;; Doesn't need to do anything by default.
   t)
 
-(cl-defgeneric ebdb-popup-window (major-mode)
-  "Return a spec for how to pop up a window on an *EBDB* buffer.
-
-This generic function dispatches on the current value of
-major-mode.  The return value should be a two-element list
-of (window split), in which WINDOW is the window to split, and
-SPLIT is either an integer, specifying number of rows/columns, or
-a float specifying what percentage of window real estate the
-pop-up should occupy.  SPLIT can also be nil, in which case the
-window will probably take up half the available space.
-
-Alternately, the return value can be nil, which means continue
-using the current window.")
-
-(cl-defmethod ebdb-popup-window (&context (major-mode ebdb-mode))
-  "When popping up from an existing *EBDB* buffer, just reuse the window.
-
-Ie, don't pop up at all."
-  nil)
-
-(cl-defmethod ebdb-popup-window ()
-  "When popping up from a random window, use half the window."
-  (list (get-buffer-window) 0.5))
-
 (cl-defgeneric ebdb-mua-article-body (major-mode)
   "Return the text of the current MUA article, as a string.
 
diff --git a/ebdb-pgp.el b/ebdb-pgp.el
index dc8e86f..7cdeac5 100644
--- a/ebdb-pgp.el
+++ b/ebdb-pgp.el
@@ -28,33 +28,6 @@
 (require 'message)
 (require 'ebdb-com)
 
-(defclass ebdb-field-pgp (ebdb-field-user)
-  ((action
-    :initarg :action
-    :type symbol
-    :custom (choice
-            (const :tag "Encrypt" encrypt)
-            (const :tag "Query encryption" encrypt-query)
-            (const :tag "Sign" sign)
-            (const :tag "Query signing" sign-query))
-    :documentation
-    "A symbol indicating what action to take when sending a
-    message to this contact."))
-  :documentation "A field defining a default signing/encryption
-  action for a record.  This action is taken by calling
-  `ebdb-pgp' in a message/mail composition buffer, or by adding
-  that function to the message/mail-send-hook."
-    :human-readable "pgp action")
-
-(cl-defmethod ebdb-string ((field ebdb-field-pgp))
-  (symbol-name (slot-value field 'action)))
-
-(cl-defmethod ebdb-read ((class (subclass ebdb-field-pgp)) &optional slots obj)
-  (let ((val (intern (ebdb-read-string
-                     "PGP action: " (when obj (slot-value obj 'action))
-                     ebdb-pgp-ranked-actions t))))
-    (cl-call-next-method class (plist-put slots :action val) obj)))
-
 (defcustom ebdb-pgp-default-action nil
   "Default action when sending a message and the recipients are not in EBDB.
 This should be one of the following symbols:
@@ -132,6 +105,33 @@ See info node `(message)security'."
                        (symbol :tag "Encrypt method")))
   :group 'ebdb-utilities-pgp)
 
+(defclass ebdb-field-pgp (ebdb-field-user)
+  ((action
+    :initarg :action
+    :type symbol
+    :custom (choice
+            (const :tag "Encrypt" encrypt)
+            (const :tag "Query encryption" encrypt-query)
+            (const :tag "Sign" sign)
+            (const :tag "Query signing" sign-query))
+    :documentation
+    "A symbol indicating what action to take when sending a
+    message to this contact."))
+  :documentation "A field defining a default signing/encryption
+  action for a record.  This action is taken by calling
+  `ebdb-pgp' in a message/mail composition buffer, or by adding
+  that function to the message/mail-send-hook."
+    :human-readable "pgp action")
+
+(cl-defmethod ebdb-string ((field ebdb-field-pgp))
+  (symbol-name (slot-value field 'action)))
+
+(cl-defmethod ebdb-read ((class (subclass ebdb-field-pgp)) &optional slots obj)
+  (let ((val (intern (ebdb-read-string
+                     "PGP action: " (when obj (slot-value obj 'action))
+                     ebdb-pgp-ranked-actions t))))
+    (cl-call-next-method class (plist-put slots :action val) obj)))
+
 ;;;###autoload
 (defun ebdb-pgp ()
   "Add PGP MML tags to a message according to the recipients' EBDB records.
@@ -173,7 +173,7 @@ use one of the following, as appropriate:
                        (delete-dups
                         (mapcar
                          (lambda (record)
-                           (if-let ((field (car-safe (ebdb-record-field record 
ebdb-field-pgp))))
+                           (if-let ((field (car-safe (ebdb-record-field record 
'ebdb-field-pgp))))
                               (slot-value field 'action)))
                          (delete-dups
                           (apply 'nconc
diff --git a/ebdb-vcard.el b/ebdb-vcard.el
index ad90658..bfde104 100644
--- a/ebdb-vcard.el
+++ b/ebdb-vcard.el
@@ -168,7 +168,7 @@ method is just responsible for formatting the record name."
            (ebdb-record-sortkey r)
            (ebdb-fmt-field f name 'normal r)))))
 
-(cl-defmethod ebdb-fmt-record-body ((f ebdb-formatter-vcard)
+(cl-defmethod ebdb-fmt-record-body ((_f ebdb-formatter-vcard)
                                    (_r ebdb-record)
                                    (fields list))
   (mapconcat
@@ -178,43 +178,43 @@ method is just responsible for formatting the record 
name."
    fields
    "\n"))
 
-(cl-defmethod ebdb-fmt-record-body :around ((f ebdb-formatter-vcard-40)
-                                           (r ebdb-record-person)
+(cl-defmethod ebdb-fmt-record-body :around ((_f ebdb-formatter-vcard-40)
+                                           (_r ebdb-record-person)
                                            (_fields list))
   (let ((str (cl-call-next-method)))
     (concat str "\nKIND:individual")))
 
-(cl-defmethod ebdb-fmt-record-body :around ((f ebdb-formatter-vcard-40)
-                                           (r ebdb-record-organization)
+(cl-defmethod ebdb-fmt-record-body :around ((_f ebdb-formatter-vcard-40)
+                                           (_r ebdb-record-organization)
                                            (_fields list))
   (let ((str (cl-call-next-method)))
     (concat str "\nKIND:org")))
 
-(cl-defmethod ebdb-fmt-field ((f ebdb-formatter-vcard)
+(cl-defmethod ebdb-fmt-field ((_f ebdb-formatter-vcard)
                              (field ebdb-field)
                              _style
                              _record)
   (ebdb-string field))
 
-(cl-defmethod ebdb-fmt-field-label ((f ebdb-formatter-vcard)
-                                   (field ebdb-field-timestamp)
+(cl-defmethod ebdb-fmt-field-label ((_f ebdb-formatter-vcard)
+                                   (_field ebdb-field-timestamp)
                                    _style
                                    _record)
   "REV")
 
-(cl-defmethod ebdb-fmt-field-label ((f ebdb-formatter-vcard)
-                                   (field ebdb-field-notes)
+(cl-defmethod ebdb-fmt-field-label ((_f ebdb-formatter-vcard)
+                                   (_field ebdb-field-notes)
                                    _style
                                    _record)
   "NOTE")
 
-(cl-defmethod ebdb-fmt-field-label ((f ebdb-formatter-vcard)
-                                   (field ebdb-field-creation-date)
+(cl-defmethod ebdb-fmt-field-label ((_f ebdb-formatter-vcard)
+                                   (_field ebdb-field-creation-date)
                                    _style
                                    _record)
   "X-CREATION-DATE")
 
-(cl-defmethod ebdb-fmt-field ((f ebdb-formatter-vcard)
+(cl-defmethod ebdb-fmt-field ((_f ebdb-formatter-vcard)
                              (mail ebdb-field-mail)
                              _style
                              _record)
@@ -226,7 +226,7 @@ method is just responsible for formatting the record name."
                              _record)
   (format-time-string "%Y%m%dT%H%M%S%z" (slot-value ts 'timestamp) t))
 
-(cl-defmethod ebdb-fmt-field ((f ebdb-formatter-vcard)
+(cl-defmethod ebdb-fmt-field ((_f ebdb-formatter-vcard)
                              (name ebdb-field-name-complex)
                              _style
                              _record)
@@ -238,13 +238,13 @@ method is just responsible for formatting the record 
name."
      (or prefix "")
      (or suffix ""))))
 
-(cl-defmethod ebdb-fmt-field-label ((f ebdb-formatter-vcard)
-                                   (field ebdb-field-uuid)
+(cl-defmethod ebdb-fmt-field-label ((_f ebdb-formatter-vcard)
+                                   (_field ebdb-field-uuid)
                                    _style
                                    _record)
   "UID:urn:uuid")
 
-(cl-defmethod ebdb-fmt-field-label ((f ebdb-formatter-vcard)
+(cl-defmethod ebdb-fmt-field-label ((_f ebdb-formatter-vcard)
                                    (mail ebdb-field-mail)
                                    _style
                                    _record)
@@ -257,25 +257,25 @@ method is just responsible for formatting the record 
name."
        ('defunct ";PREF=100")
        (t "")))))
 
-(cl-defmethod ebdb-fmt-field-label ((f ebdb-formatter-vcard)
+(cl-defmethod ebdb-fmt-field-label ((_f ebdb-formatter-vcard)
                                    (phone ebdb-field-phone)
                                    _style
                                    _record)
   (format "TEL;TYPE=%s" (slot-value phone 'object-name)))
 
-(cl-defmethod ebdb-fmt-field-label ((f ebdb-formatter-vcard)
+(cl-defmethod ebdb-fmt-field-label ((_f ebdb-formatter-vcard)
                                    (rel ebdb-field-relation)
                                    _style
                                    _record)
   (format "RELATED;TYPE=%s" (slot-value rel 'object-name)))
 
-(cl-defmethod ebdb-fmt-field-label ((f ebdb-formatter-vcard)
+(cl-defmethod ebdb-fmt-field-label ((_f ebdb-formatter-vcard)
                                    (url ebdb-field-url)
                                    _style
                                    _record)
   (format "URL;TYPE=%s" (slot-value url 'object-name)))
 
-(cl-defmethod ebdb-fmt-field ((f ebdb-formatter-vcard)
+(cl-defmethod ebdb-fmt-field ((_f ebdb-formatter-vcard)
                              (rel ebdb-field-relation)
                              _style
                              _record)
@@ -293,7 +293,7 @@ method is just responsible for formatting the record name."
                              _record)
   (ebdb-concat "," (slot-value tags 'tags)))
 
-(cl-defmethod ebdb-fmt-field-label ((f ebdb-formatter-vcard)
+(cl-defmethod ebdb-fmt-field-label ((_f ebdb-formatter-vcard)
                                    (ann ebdb-field-anniversary)
                                    _style
                                    _record)
diff --git a/ebdb.el b/ebdb.el
index 227f16c..a7b69ae 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -58,7 +58,9 @@
 (autoload 'calendar-gregorian-from-absolute "calendar")
 (autoload 'calendar-read-date "calendar")
 (autoload 'diary-sexp-entry "diary-lib")
+(autoload 'diary-add-to-list "diary-lib")
 (autoload 'org-agenda-list "org-agenda")
+(defvar ebdb-i18n-countries)
 
 ;; These are the most important internal variables, holding EBDB's
 ;; data structures.
@@ -2298,7 +2300,7 @@ priority."
        left
 
       (if auto
-         (object-add-to-list left 'aka name)
+         (object-add-to-list left 'aka rname)
 
        (unless (equal rname lname)
          (let ((prefix (format "Merging %s with %s:"
@@ -2306,11 +2308,11 @@ priority."
                                (ebdb-record-name left))))
           (if (yes-or-no-p (format "%s Use %s as primary name? " prefix 
(ebdb-record-name right)))
               (progn
-                (ebdb-record-change-name left name)
+                (ebdb-record-change-name left rname)
                 (when (yes-or-no-p (format "%s Keep %s as an aka? " prefix 
(ebdb-record-name left)))
                   (object-add-to-list left 'aka lname)))
             (when (yes-or-no-p (format "%s Keep %s as an aka? " prefix 
(ebdb-record-name right)))
-              (object-add-to-list left 'aka name))))))
+              (object-add-to-list left 'aka rname))))))
 
       (setf (slot-value left 'relations)
            (delete-dups (append rrelations lrelations)))
@@ -4430,6 +4432,7 @@ This function is a possible formatting function for
   (let ((country (ebdb-address-country address))
         (streets (ebdb-address-streets address)))
     (when (symbolp country)
+      (require 'ebdb-i18n)
       (setq country (car (rassq country ebdb-i18n-countries))))
     (concat (if streets
                 (concat (mapconcat 'identity streets "\n") "\n"))
@@ -4477,6 +4480,7 @@ The formatting rules are defined in 
`ebdb-address-format-list'."
                             (setq string (concat string (format 
(replace-regexp-in-string "%r" "%s" form t) str)))))
                          ((string-match "%c" form) ; country
                          (when (symbolp country)
+                           (require 'ebdb-i18n)
                            (setq country (car (rassq country 
ebdb-i18n-countries))))
                           (unless (or (not country) (string= "" country))
                             (setq string (concat string (format 
(replace-regexp-in-string "%c" "%s" form t) country)))))



reply via email to

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