[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb c43e39b 097/350: Another round of compiler-inspire
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb c43e39b 097/350: Another round of compiler-inspired fixes |
Date: |
Mon, 14 Aug 2017 11:46:14 -0400 (EDT) |
branch: externals/ebdb
commit c43e39bdc7a52dc7a258b206b4e801522afc41a0
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
Another round of compiler-inspired fixes
---
ebdb-com.el | 16 ++++++++--------
ebdb-mua.el | 43 +++++++++++++++++++++++--------------------
ebdb.el | 13 ++++++-------
3 files changed, 37 insertions(+), 35 deletions(-)
diff --git a/ebdb-com.el b/ebdb-com.el
index 14b1df2..5107cce 100644
--- a/ebdb-com.el
+++ b/ebdb-com.el
@@ -481,7 +481,7 @@ property is the field instance itself."
value))
(cl-defmethod ebdb-fmt-field ((_fmt ebdb-formatter-ebdb)
- (field ebdb-field-obfuscated)
+ (_field ebdb-field-obfuscated)
_style
(_record ebdb-record))
(let ((str "HIDDEN"))
@@ -778,7 +778,7 @@ only happens when removing records.")
'ebdb-marked)))
'replaced)
-(cl-defmethod ebdb-redisplay-record ((record ebdb-record)
+(cl-defmethod ebdb-redisplay-record ((_record ebdb-record)
(_action (eql remove))
full-record)
(setq ebdb-records (delq full-record ebdb-records))
@@ -812,12 +812,12 @@ only happens when removing records.")
(ebdb-redisplay-record record (nth 1 full-record) full-record))
(cl-defmethod ebdb-redisplay-record ((record ebdb-record)
- (action (eql unmark))
+ (_action (eql unmark))
full-record)
(setf (nth 3 full-record) nil)
(ebdb-redisplay-record record (nth 1 full-record) full-record))
-(defun ebdb-redisplay-records (records action &optional all-buffers sort)
+(defun ebdb-redisplay-records (records action &optional all-buffers _sort)
"Take ACTION to alter the display of RECORDS in one or more EBDB buffers.
If ACTION is an instance of `ebdb-formatter-ebdb', then redisplay
@@ -838,7 +838,7 @@ displayed records."
(buffer-list))
(and (eq major-mode 'ebdb-mode)
(list (current-buffer)))))
- local-record renumber-index marker end-marker fmt record-number ret)
+ local-record renumber-index marker end-marker record-number ret)
(setq records (ebdb-record-list records))
;; First check if we've been given any records as uuid strings,
;; rather than actual records.
@@ -1363,9 +1363,9 @@ With prefix N move backwards N (sub)fields."
;; Buffer manipulation
;;;###autoload
-(defun ebdb-clone-buffer (&optional arg)
+(defun ebdb-clone-buffer ()
"Make a copy of the current *EBDB* buffer, renaming it."
- (interactive (list current-prefix-arg))
+ (interactive)
(let ((new-name (read-string "New buffer name: "))
(current-records (when (eql major-mode 'ebdb-mode) (mapcar #'car
ebdb-records))))
(ebdb-display-records current-records nil nil t nil
@@ -2719,7 +2719,7 @@ of all of these people."
(if noisy (message "EBDB mail alias: rebuilding done")))
-(defun ebdb-mail-abbrev-expand-hook (alias records)
+(defun ebdb-mail-abbrev-expand-hook (_alias records)
; (run-hook-with-args 'ebdb-mail-abbrev-expand-hook alias records)
(mail-abbrev-expand-hook)
(when ebdb-completion-display-record
diff --git a/ebdb-mua.el b/ebdb-mua.el
index b721765..e4602ef 100644
--- a/ebdb-mua.el
+++ b/ebdb-mua.el
@@ -53,6 +53,10 @@
(defvar ebdb-offer-to-create nil
"For communication between `ebdb-update-records' and `ebdb-query-create'.")
+(defvar ebdb-update-records-p nil
+ "For communication between `ebdb-update-records' and
+ `ebdb-query-create'.")
+
(defvar ebdb-update-records-address nil
"For communication between `ebdb-update-records' and `ebdb-query-create'.
It is a list with elements (NAME MAIL HEADER HEADER-CLASS MUA).")
@@ -629,7 +633,7 @@ or if some FIELD of RECORD is empty."
"Return a single-character string to mark RECORD in an MUA
summary buffer.")
-(cl-defmethod ebdb-mua-make-summary-mark ((record ebdb-record))
+(cl-defmethod ebdb-mua-make-summary-mark ((_record ebdb-record))
"By default, do nothing."
nil)
@@ -671,7 +675,7 @@ Currently no other MUAs support this EBDB feature."
(let ((val (ebdb-message-header header))
(case-fold-search t)) ; RW: Is this what we want?
(when (and val (string-match regexp val))
- (throw done t))))
+ (throw 'done t))))
(defun ebdb-mua-test-headers (header-type address-parts &optional
ignore-address)
"Decide if the address in ADDRESS-PARTS should be ignored or
@@ -1233,7 +1237,7 @@ bind `ebdb-message-all-addresses' to ALL."
;; as well as the current content of the field that gets edited.
;; In principle, this function can be used not only with MUAs.
-(defun ebdb-annotate-record (record annotation &optional field replace)
+(defun ebdb-annotate-record (record annotation &optional field _replace)
"In RECORD add an ANNOTATION to field FIELD.
FIELD defaults to `ebdb-annotate-field'.
If REPLACE is non-nil, ANNOTATION replaces the content of FIELD.
@@ -1390,23 +1394,22 @@ For use as an element of `ebdb-notice-record-hook'."
;; It would be faster if we could somehow store (permanently?) that we
;; have already annotated a message.
(let ((case-fold-search t))
- (unless (or ebdb-read-only
- ;; check the ignore-messages pattern
- (let ((ignore-messages ebdb-auto-notes-ignore-messages)
- ignore rule)
- (while (and (not ignore) (setq rule (pop ignore-messages)))
- (if (cond ((functionp rule)
- ;; RULE may use `ebdb-update-records-address'
- (funcall rule record))
- ((symbolp rule)
- (eq rule (nth 4 ebdb-update-records-address)))
- ((eq 1 (safe-length rule))
- (ebdb-message-header-re (car rule) (cdr rule)))
- ((eq 2 (safe-length rule))
- (and (eq (car rule) (nth 4
ebdb-update-records-address))
- (ebdb-message-header-re (nth 1 rule) (nth
2 rule)))))
- (setq ignore t)))
- ignore))
+ (unless ;; check the ignore-messages pattern
+ (let ((ignore-messages ebdb-auto-notes-ignore-messages)
+ ignore rule)
+ (while (and (not ignore) (setq rule (pop ignore-messages)))
+ (if (cond ((functionp rule)
+ ;; RULE may use `ebdb-update-records-address'
+ (funcall rule record))
+ ((symbolp rule)
+ (eq rule (nth 4 ebdb-update-records-address)))
+ ((eq 1 (safe-length rule))
+ (ebdb-message-header-re (car rule) (cdr rule)))
+ ((eq 2 (safe-length rule))
+ (and (eq (car rule) (nth 4 ebdb-update-records-address))
+ (ebdb-message-header-re (nth 1 rule) (nth 2
rule)))))
+ (setq ignore t)))
+ ignore)
;; For speed-up expanded rules are stored in
`ebdb-auto-notes-rules-expanded'.
(when (and ebdb-auto-notes-rules
diff --git a/ebdb.el b/ebdb.el
index ad7bceb..1a5b5ec 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -514,7 +514,7 @@ Then call `cl-call-next-method' with the new values.")
"Create the actual field instance."
(apply 'make-instance field-class slots))
-(cl-defmethod ebdb-parse :before ((_field-class (subclass ebdb-field)) str
&optional slots)
+(cl-defmethod ebdb-parse :before ((_field-class (subclass ebdb-field)) str
&optional _slots)
(when (string-empty-p str)
(signal 'ebdb-empty (list "Empty string cannot be parsed"))))
@@ -768,7 +768,7 @@ simple or complex name class."
((string-match-p "[[:space:]]" input)
(ebdb-parse ebdb-default-name-class input slots))
(t
- (ebdb-parse ebdb-field-name-simple input slots)))))
+ (ebdb-parse 'ebdb-field-name-simple input slots)))))
(defclass ebdb-field-name-simple (ebdb-field-name)
((name
@@ -1652,7 +1652,7 @@ record uuids.")
(push (list alias (list record address)) ebdb-mail-alias-alist)))))
(cl-defmethod ebdb-delete-field ((field ebdb-field-mail-alias)
- &optional record unload)
+ &optional record _unload)
(with-slots (alias address) field
(let* ((existing (assoc alias ebdb-mail-alias-alist))
(entry (assq record (cdr-safe existing))))
@@ -2022,8 +2022,7 @@ only return fields that are suitable for user editing.")
;; TODO: rename this to `ebdb-record-name-string', it's confusing.
(cl-defmethod ebdb-record-name ((record ebdb-record))
"Get or set-and-get the cached name string of RECORD."
- (let ((cached (slot-value (ebdb-record-cache record) 'name-string))
- str)
+ (let ((cached (slot-value (ebdb-record-cache record) 'name-string)))
(or cached
(and (slot-value record 'name)
(setf (slot-value (ebdb-record-cache record) 'name-string)
@@ -2639,7 +2638,7 @@ appropriate person record."
(ebdb-record-adopt-role-fields record org t)))
(cl-defmethod ebdb-record-change-name ((org ebdb-record-organization)
&optional name)
- (let ((new-name (or name (ebdb-read ebdb-field-name-simple nil (slot-value
org 'name)))))
+ (let ((new-name (or name (ebdb-read 'ebdb-field-name-simple nil (slot-value
org 'name)))))
(setf (slot-value (ebdb-record-cache org) 'name-string) (ebdb-string
new-name))
(cl-call-next-method org new-name)))
@@ -4424,7 +4423,7 @@ important work is done by the `ebdb-db-load' method."
(setq s (make-instance 'ebdb-db-file :file s :dirty t))
;; Try to get it on disk first.
(ebdb-db-save s))))
- ((null (object-of-class-p s ebdb-db))
+ ((null (object-of-class-p s 'ebdb-db))
(error "Source %s must be a filename or instance of `ebdb-db'."
s)))
;; Now load it.
(if (object-of-class-p s 'ebdb-db)
- [elpa] externals/ebdb 1c4fadd 080/350: Make ebdb-record-name a get-or-get-and-set operation, (continued)
- [elpa] externals/ebdb 1c4fadd 080/350: Make ebdb-record-name a get-or-get-and-set operation, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 9aab682 088/350: Add a generic for ebdb-db-editable, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 4263d5b 090/350: Fix the reload process, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb dd4f251 098/350: Split off ebdb-record-field for field classes, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 8c20202 103/350: Update company-ebdb to work with new search style, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 5ec40d5 102/350: Add sections on searching and record marking to manual, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 7da77f4 089/350: Expand ebdb-with-record-edits, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 8312ea4 109/350: Allow company-ebdb to work in notmuch-message-mode as well, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb dcb7dbc 104/350: Change default keybindings in Gnus, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 9ac0f0f 111/350: Searching on empty strings should happen in field-search method, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb c43e39b 097/350: Another round of compiler-inspired fixes,
Eric Abrahamsen <=
- [elpa] externals/ebdb 40df5bc 114/350: Remove ebdb-new-mails-primary, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 825c4cc 112/350: Simplify the structure of ebdb-org-hashtable, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb c0979b0 135/350: Typo in ebdb-mua-check-header, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 1219b93 100/350: Rework *EBDB* buffer searching, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 80ef19d 108/350: Make ebdb-search-read and ebdb-search-field into generics, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 6c85728 116/350: Manual and README additions, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 4688493 125/350: Wrap ebdb-parse in save-match-data, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 587ebbc 129/350: Use ebdb-prompt-for-record in org link completion, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 8f82b0f 121/350: Complete changes from ed3e270, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 9edc54f 120/350: Merge snarf branch, basic framework of snarfing in place, Eric Abrahamsen, 2017/08/14