[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb ae7dd97 2/3: Fix compiler warnings
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb ae7dd97 2/3: Fix compiler warnings |
Date: |
Fri, 19 Apr 2019 20:00:59 -0400 (EDT) |
branch: externals/ebdb
commit ae7dd977bd14e358ddd7b4afaf750a372d19f043
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
Fix compiler warnings
Mostly unused dispatch vars.
* ebdb-format.el (ebdb-fmt-compose-fields): But also a couple of real
bugs in the usage of pcase here.
---
ebdb-com.el | 15 +++++++--------
ebdb-counsel.el | 2 +-
ebdb-format.el | 9 +++++----
ebdb-html.el | 12 +++++++-----
ebdb-org.el | 8 ++++----
5 files changed, 24 insertions(+), 22 deletions(-)
diff --git a/ebdb-com.el b/ebdb-com.el
index 8277a77..8b0bbfc 100644
--- a/ebdb-com.el
+++ b/ebdb-com.el
@@ -660,8 +660,8 @@ Print the first line, add an ellipsis, and add a tooltip."
;;; Record display
-(cl-defmethod ebdb-fmt-record ((fmt ebdb-formatter-ebdb)
- (record ebdb-record))
+(cl-defmethod ebdb-fmt-record ((_fmt ebdb-formatter-ebdb)
+ (_record ebdb-record))
(concat (cl-call-next-method) "\n"))
(cl-defmethod ebdb-fmt-record-header ((fmt ebdb-formatter-ebdb)
@@ -690,15 +690,15 @@ Print the first line, add an ellipsis, and add a tooltip."
inst " "))
header-fields " "))))))
-(cl-defmethod ebdb-fmt-record-header :around ((fmt
ebdb-formatter-ebdb-multiline)
- (record ebdb-record)
- &optional header-fields)
+(cl-defmethod ebdb-fmt-record-header :around ((_fmt
ebdb-formatter-ebdb-multiline)
+ (_record ebdb-record)
+ &optional _header-fields)
(concat (cl-call-next-method) "\n"))
(cl-defmethod ebdb-fmt-compose-fields ((fmt ebdb-formatter-ebdb-multiline)
(record ebdb-record)
&optional
- field-alist depth)
+ field-alist _depth)
"Turn FIELD-ALIST into a string.
The FIELD-ALIST structure is that returned by
`ebdb-fmt-collect-fields'. It is an alist with three keys:
@@ -2478,8 +2478,7 @@ Obey `ebdb-completion-list'."
PROMPT is used in `completing-read'. Actual completion is done
using the function `ebdb-record-completion-table'."
(let ((string (completing-read
- prompt #'ebdb-record-completion-table nil t))
- records)
+ prompt #'ebdb-record-completion-table nil t)))
(unless (string-empty-p string)
(or (car-safe (ebdb-gethash string '(fl-name aka mail)))
(message "No matching records for \"%s\"" string)))))
diff --git a/ebdb-counsel.el b/ebdb-counsel.el
index 8423dbe..6e0341e 100644
--- a/ebdb-counsel.el
+++ b/ebdb-counsel.el
@@ -26,7 +26,7 @@
(require 'ebdb)
-(declare-function 'ivy-read "ext:ivy")
+(declare-function ivy-read "ext:ivy")
;;;###autoload
(defun ebdb-counsel ()
diff --git a/ebdb-format.el b/ebdb-format.el
index 678c106..0515430 100644
--- a/ebdb-format.el
+++ b/ebdb-format.el
@@ -467,16 +467,16 @@ multiple instances in a single alist."
field-separator
(mapconcat
(lambda (f)
- (if (object-p f)
+ (if (eieio-object-p f)
(ebdb-fmt-field fmt f 'compact rec)
;; See docs of 'field-missing slot of
;; `ebdb-formatter-constrained' for explanation of the
;; following behavior.
(pcase f
- (`(_ . ,(and (pred stringp) str)) str)
+ (`(,_ . ,(and (pred stringp) str)) str)
(`(,spec . ,(and (pred symbolp) sym))
(signal sym (list rec spec)))
- (`(,spec . (and (pred functionp) fun))
+ (`(,spec . ,(and (pred functionp) fun))
(funcall fun fmt rec spec)))))
field-list
field-separator))))
@@ -508,7 +508,8 @@ multiple instances in a single alist."
(make-instance 'ebdb-formatter-csv :label "csv"
:fields '(mail-primary))
"Default CSV formatter."
- :group 'ebdb)
+ :group 'ebdb
+ :type 'ebdb-formatter-csv)
;;; Basic export routines
diff --git a/ebdb-html.el b/ebdb-html.el
index 5d423b4..dc3ef27 100644
--- a/ebdb-html.el
+++ b/ebdb-html.el
@@ -45,7 +45,7 @@
formatting.")
(cl-defmethod ebdb-fmt-record :around ((_fmt ebdb-html-formatter-html5)
- (rec ebdb-record))
+ (_rec ebdb-record))
(concat
"<article class=\"ebdb-record\">\n"
(cl-call-next-method)
@@ -58,7 +58,7 @@
"<header>\n"
(format "<h1>%s</h1>\n" (ebdb-record-name rec))
(mapconcat
- (pcase-lambda ((map style inst class))
+ (pcase-lambda ((map style inst _class))
(format "<p>%s</p>" (mapconcat (lambda (f) (ebdb-fmt-field fmt f style
rec)) inst ", ")))
header-fields
"\n")
@@ -106,13 +106,15 @@
(make-instance 'ebdb-html-formatter-tabular
:label "html table"
:fields '(mail-primary))
- "The default HTML table formatter.")
+ "The default HTML table formatter."
+ :type 'ebdb-html-formatter-tabular)
(defcustom ebdb-html-default-formatter-html5
(make-instance 'ebdb-html-formatter-html5
:label "html5 block"
:include '(mail-primary ebdb-field-phone ebdb-field-address
ebdb-field-notes))
- "The default HTML5 block formatter.")
+ "The default HTML5 block formatter."
+ :type 'ebdb-html-formatter-html5)
(cl-defmethod ebdb-fmt-header ((fmt ebdb-html-formatter-tabular)
_records)
@@ -132,7 +134,7 @@
"</th><th>")
"</th></tr>\n")))
-(cl-defmethod ebdb-fmt-footer ((fmt ebdb-html-formatter-tabular)
+(cl-defmethod ebdb-fmt-footer ((_fmt ebdb-html-formatter-tabular)
_records)
"\n</table>")
diff --git a/ebdb-org.el b/ebdb-org.el
index b7c1b65..242efd2 100644
--- a/ebdb-org.el
+++ b/ebdb-org.el
@@ -168,10 +168,10 @@ To do this automatically for every search, add this
function to
:documentation "Formatter responsible for Org-specific field
formatting.")
-(cl-defmethod ebdb-fmt-field ((fmt ebdb-org-formatter)
- (field ebdb-field-mail)
+(cl-defmethod ebdb-fmt-field ((_fmt ebdb-org-formatter)
+ (_field ebdb-field-mail)
_style
- (rec ebdb-record))
+ (_rec ebdb-record))
(concat "mailto:" (cl-call-next-method)))
(defun ebdb-org-table-post-format ()
@@ -187,7 +187,7 @@ To do this automatically for every search, add this
function to
(field-separator :initform " | ")
(post-format-function :initform #'ebdb-org-table-post-format)))
-(cl-defmethod ebdb-fmt-header :around ((fmt ebdb-org-formatter-tabular)
+(cl-defmethod ebdb-fmt-header :around ((_fmt ebdb-org-formatter-tabular)
_records)
(concat "| "
(cl-call-next-method)