Subject: bug#66595: closed (Re: bug#66595: EBDB 0.8.18; Silencing the compiler)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 18 Oct 2023 18:26:02 +0000

Your bug report

#66595: EBDB 0.8.18; Silencing the compiler

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
66595: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=66595
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#66595: EBDB 0.8.18; Silencing the compiler
From: Arash Esbati <[email-masked]>
To: Eric Abrahamsen <[email-masked]>
Cc: [email-masked]
Date: Wed, 18 Oct 2023 20:24:54 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Eric Abrahamsen <[email-masked]> writes:

> Thank you very much! One of those things that never manages to climb up
> the TODO list. I appreciate the patches and will get them going in later
> today.

Thanks, and you're welcome.  Since this issue is now higher on your
list, I'm closing the report.

Best, Arash

Subject: EBDB 0.8.18; Silencing the compiler
From: Arash Esbati <[email-masked]>
To: [email-masked]
Date: Tue, 17 Oct 2023 18:34:26 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

X-Debbugs-CC: [email-masked]

Hi all,

I installed EBDB from ELPA and it emits lots of warnings during the
compilation with Emacs from master (98748aa6e6).  Attached are some
patches fixing the trivial ones.

>From 69977c15bd25a184420d37c358ded03c6d5a7987 Mon Sep 17 00:00:00 2001
From: Arash Esbati <[email-masked]>
Date: Tue, 17 Oct 2023 14:15:15 +0200
Subject: [PATCH 1/6] ; ebdb-com.el: Pacify the compiler

* ebdb-com.el (ebdb-dedicated-window)
(ebdb-default-multiline-include, ebdb-default-multiline-exclude)
(ebdb-default-multiline-combine)
(ebdb-default-multiline-collapse, ebdb-fmt-field): Silence the
compiler for wrong usage of unescaped single quotes.
---
 ebdb-com.el | 40 ++++++++++++++++++++--------------------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/ebdb-com.el b/ebdb-com.el
index 717f829..a91b79b 100644
--- a/ebdb-com.el
+++ b/ebdb-com.el
@@ -1,6 +1,6 @@
 ;;; ebdb-com.el --- User-level commands of EBDB      -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2016-2022  Free Software Foundation, Inc.
+;; Copyright (C) 2016-2023  Free Software Foundation, Inc.
 
 ;; Author: Eric Abrahamsen <[email-masked]>
 ;; Keywords: convenience, mail
@@ -60,7 +60,7 @@
 
 (defcustom ebdb-dedicated-window nil
   "Make *EBDB* window a dedicated window.
-Allowed values include nil (not dedicated) 'ebdb (weakly dedicated)
+Allowed values include nil (not dedicated) \\='ebdb (weakly dedicated)
 and t (strongly dedicated)."
   :type '(choice (const :tag "EBDB window not dedicated" nil)
                  (const :tag "EBDB window weakly dedicated" ebdb)
@@ -449,10 +449,10 @@ position-marker mark)."
 (defcustom ebdb-default-multiline-include nil
   "A list of field types to include in multiline display.
 Valid list values include all field class names (ebdb-field-*),
-as well as the shortcuts 'mail, 'phone, 'address, 'notes, 'tags,
-and 'role, and the special shortcuts 'mail-primary,
-'mail-defunct, 'mail-not-defunct, 'role-defunct, and
-'role-not-defunct.
+as well as the shortcuts \\='mail, \\='phone, \\='address, \\='notes, \\='tags,
+and \\='role, and the special shortcuts \\='mail-primary,
+\\='mail-defunct, \\='mail-not-defunct, \\='role-defunct, and
+\\='role-not-defunct.
 
 If this option is set, *only* fields listed here will be
 displayed.  Also see `ebdb-default-multiline-exclude'."
@@ -465,10 +465,10 @@ displayed.  Also see `ebdb-default-multiline-exclude'."
     mail-defunct role-defunct)
   "A list of field types to exclude in multiline display.
 Valid list values include all field class names (ebdb-field-*),
-as well as the shortcuts 'mail, 'phone, 'address, 'notes, 'tags,
-and 'role, and the special shortcuts 'mail-primary,
-'mail-defunct, 'mail-not-defunct, 'role-defunct, and
-'role-not-defunct.
+as well as the shortcuts \\='mail, \\='phone, \\='address, \\='notes, \\='tags,
+and \\='role, and the special shortcuts \\='mail-primary,
+\\='mail-defunct, \\='mail-not-defunct, \\='role-defunct, and
+\\='role-not-defunct.
 
 If `ebdb-default-multiline-include' is set, this option will be
 ignored."
@@ -482,10 +482,10 @@ ignored."
 displayed on one line.
 
 Valid list values include all field class names (ebdb-field-*),
-as well as the shortcuts 'mail, 'phone, 'address, 'notes, 'tags,
-and 'role, and the special shortcuts 'mail-primary,
-'mail-defunct, 'mail-not-defunct, 'role-defunct, and
-'role-not-defunct."
+as well as the shortcuts \\='mail, \\='phone, \\='address, \\='notes, \\='tags,
+and \\='role, and the special shortcuts \\='mail-primary,
+\\='mail-defunct, \\='mail-not-defunct, \\='role-defunct, and
+\\='role-not-defunct."
   :type 'list
   :group 'ebdb-record-display)
 
@@ -496,10 +496,10 @@ and 'role, and the special shortcuts 'mail-primary,
 field class will be displayed.
 
 Valid list values include all field class names (ebdb-field-*),
-as well as the shortcuts 'mail, 'phone, 'address, 'notes, 'tags,
-and 'role, and the special shortcuts 'mail-primary,
-'mail-defunct, 'mail-not-defunct, 'role-defunct, and
-'role-not-defunct."
+as well as the shortcuts \\='mail, \\='phone, \\='address, \\='notes, \\='tags,
+and \\='role, and the special shortcuts \\='mail-primary,
+\\='mail-defunct, \\='mail-not-defunct, \\='role-defunct, and
+\\='role-not-defunct."
   :type 'list
   :group 'ebdb-record-display)
 
@@ -610,7 +610,7 @@ choice: that formatter should be selected explicitly."
 				      (field ebdb-field)
 				      _style
 				      (_record ebdb-record))
-  "Put the 'ebdb-field text property on FIELD.  The value of the
+  "Put the \\='ebdb-field text property on FIELD.  The value of the
 property is the field instance itself."
   (let ((str (cl-call-next-method)))
     ;; If the field fails to produce a string, or produces an empty
@@ -784,7 +784,7 @@ record that actually owns the field."
   "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:
-'class, 'style, and 'inst.
+\\='class, \\='style, and \\='inst.
 
 This function passes the class and field instances to FMT, which
 formats them appropriately, and concatenates them into a
-- 
2.42.0

>From ec92a37cdfcad96713ad489ab9c3759fd38bafd0 Mon Sep 17 00:00:00 2001
From: Arash Esbati <[email-masked]>
Date: Tue, 17 Oct 2023 14:17:35 +0200
Subject: [PATCH 2/6] ; ebdb-format.el: Pacify the compiler

* ebdb-format.el (ebdb-fmt-field-label, ebdb-fmt-sort-fields)
(ebdb-fmt-process-fields): Silence the compiler for wrong usage of
unescaped single quotes.
---
 ebdb-format.el | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/ebdb-format.el b/ebdb-format.el
index 815b513..47367f9 100644
--- a/ebdb-format.el
+++ b/ebdb-format.el
@@ -1,6 +1,6 @@
 ;;; ebdb-format.el --- Formatting/exporting EBDB records  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2016-2022  Free Software Foundation, Inc.
+;; Copyright (C) 2016-2023  Free Software Foundation, Inc.
 
 ;; Author: Eric Abrahamsen <[email-masked]>
 
@@ -209,8 +209,8 @@ possibly with text properties attached.")
 (cl-defgeneric ebdb-fmt-field-label (fmt field-or-class style &optional record)
   "Format a field label, using formatter FMT.
 FIELD-OR-CLASS is a field class or a field instance, and STYLE is
-a symbol indicating a style of some sort, such as 'compact or
-'expanded.")
+a symbol indicating a style of some sort, such as \\='compact or
+\\='expanded.")
 
 ;;; Basic method implementations
 
@@ -349,7 +349,7 @@ combined into a single string."
 				    field-list)
   "Sort FIELD-LIST using sort order from FMT.
 First sorts all fields with `ebdb-field-compare', then sorts
-again by the order of each field's class symbol in the 'sort
+again by the order of each field's class symbol in the \\='sort
 slot of FMT."
   (let* ((sort-order (slot-value fmt 'sort))
 	 (catchall (or (seq-position sort-order "_")
@@ -378,8 +378,8 @@ This method assumes that fields in FIELD-LIST have already been
 grouped by field class.
 
 The return value is a list of alists.  Each alist has three keys:
-'class, holding a class symbol, 'style, holding either the symbol
-`collapse' or the symbol `normal', and 'inst, a list of all the
+\\='class, holding a class symbol, \\='style, holding either the symbol
+`collapse' or the symbol `normal', and \\='inst, a list of all the
 instances in this bundle.  The `combine' style works by putting
 multiple instances in a single alist."
   (let (outlist f acc)
-- 
2.42.0

>From 1e24bb5bad30fc7d88b523312fecb11940e41fb3 Mon Sep 17 00:00:00 2001
From: Arash Esbati <[email-masked]>
Date: Tue, 17 Oct 2023 14:18:34 +0200
Subject: [PATCH 3/6] ; ebdb-i18n-basic.el: Pacify the compiler

* ebdb-i18n-basic.el (ebdb-string-i18n): Silence the compiler for
free variable `ebdb-default-phone-country'.
---
 ebdb-i18n-basic.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ebdb-i18n-basic.el b/ebdb-i18n-basic.el
index 7c4d9d5..42c7d89 100644
--- a/ebdb-i18n-basic.el
+++ b/ebdb-i18n-basic.el
@@ -118,6 +118,9 @@ number, and any remaining as an extension."
       (args-out-of-range nil))
     slots))
 
+;; Defined in `ebdb.el'
+(defvar ebdb-default-phone-country)
+
 (cl-defmethod ebdb-string-i18n ((phone ebdb-field-phone)
 				(_cc (eql 1)))
   (with-slots (area-code number extension) phone
-- 
2.42.0

>From 32964090eef1a3e31f55e757e4081af0ce734d85 Mon Sep 17 00:00:00 2001
From: Arash Esbati <[email-masked]>
Date: Tue, 17 Oct 2023 14:19:44 +0200
Subject: [PATCH 4/6] ; ebdb-mua.el: Pacify the compiler

* ebdb-mua.el (ebdb-accept-header-alist)
(ebdb-ignore-header-alist, ebdb-user-mail-address-re)
(ebdb-get-user-mail-address-re, ebdb-notice-record-hook)
(ebdb-notice-record): Silence the compiler for wrong usage of
unescaped single quotes.
---
 ebdb-mua.el | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/ebdb-mua.el b/ebdb-mua.el
index 6ade65c..98318da 100644
--- a/ebdb-mua.el
+++ b/ebdb-mua.el
@@ -1,6 +1,6 @@
 ;;; ebdb-mua.el --- Mail user agent interaction for EBDB  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2016-2022  Free Software Foundation, Inc.
+;; Copyright (C) 2016-2023  Free Software Foundation, Inc.
 
 ;; Author: Eric Abrahamsen <[email-masked]>
 
@@ -178,8 +178,8 @@ also consider the email addresses in the remaining headers."
 The format of this alist is
    ((HEADER-TYPE . REGEXP) ...)
 
-Where HEADER-TYPE is one of the symbols 'sender, 'recipients,
-'any (meaning 'sender or 'recipients), or 'subject.
+Where HEADER-TYPE is one of the symbols \\='sender, \\='recipients,
+\\='any (meaning \\='sender or \\='recipients), or \\='subject.
 
 For example, if
    ((sender . \"@.*\\.maximegalon\\.edu\")
@@ -201,8 +201,8 @@ See also `ebdb-ignore-header-alist', which has the opposite effect."
 The format of this alist is
    ((HEADER-TYPE . REGEXP) ... )
 
-Where HEADER-TYPE is one of the symbols 'sender, 'recipients',
-'any (meaning 'sender or 'recipients), or 'subject.
+Where HEADER-TYPE is one of the symbols \\='sender, \\='recipients,
+\\='any (meaning \\='sender or \\='recipients), or \\='subject.
 
 For example, if
    ((sender . \"mailer-daemon\")
@@ -225,8 +225,8 @@ See also `ebdb-accept-header-alist', which has the opposite effect."
        (concat "\\<" (regexp-quote (match-string 1 user-mail-address)) "\\>"))
   "A regular expression matching your mail addresses.
 This option can be directly set to a regexp.  It can also be the
-symbol 'message, in which case the value of
-`message-alternative-emails' will be used, or the symbol 'self,
+symbol \\='message, in which case the value of
+`message-alternative-emails' will be used, or the symbol \\='self,
 in which case the value will be constructed from the mail
 addresses of the record pointed to by option `ebdb-record-self'.
 Several EBDB commands extract either the sender or the
@@ -287,7 +287,7 @@ Reads mail addresses to permanently ignore from the option
 (defun ebdb-get-user-mail-address-re ()
   "Get or set the value of variable `ebdb-user-mail-address-re'.
 
-If it's a symbol, check if it's one of 'self or 'message, and set
+If it's a symbol, check if it's one of \\='self or \\='message, and set
 accordingly."
   (cond ((stringp ebdb-user-mail-address-re)
 	 ebdb-user-mail-address-re)
@@ -421,14 +421,14 @@ existing EBDB record or to a record EBDB has created for the mail
 address.
 
 Run with two arguments: the record, and one of the symbols
-'sender or 'recipient.  It is up to the hook function to
+\\='sender or \\='recipient.  It is up to the hook function to
 determine which MUA is used and to act appropriately."
   :type 'hook)
 
 (cl-defgeneric ebdb-notice-record (record type)
   "Inform RECORD that it's been \"noticed\".
 
-TYPE is one of the symbols 'sender or 'recipient, indicating
+TYPE is one of the symbols \\='sender or \\='recipient, indicating
 RECORD's location in the message headers.")
 
 (cl-defmethod ebdb-notice-record ((rec ebdb-record) type)
@@ -1172,7 +1172,7 @@ found in that header.  When ALL is non-nil, behave as if
 
 This command is meant for manually updating records when
 `ebdb-mua-auto-update-p' is nil: it behaves as if that option
-were set to 'query.  The rules of `ebdb-select-message' still
+were set to \\='query.  The rules of `ebdb-select-message' still
 apply, however."
   (interactive)
   ;; Temporarily copy and paste from `ebdb-mua-display-records',
-- 
2.42.0

>From b2c56308db7464675d4c6fae1de7a8aa22da4d8f Mon Sep 17 00:00:00 2001
From: Arash Esbati <[email-masked]>
Date: Tue, 17 Oct 2023 14:20:46 +0200
Subject: [PATCH 5/6] ; ebdb-snarf.el: Pacify the compiler

* ebdb-snarf.el (ebdb-snarf-collect): Use
`line-beginning-position' instead of `point-at-bol'.
---
 ebdb-snarf.el | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/ebdb-snarf.el b/ebdb-snarf.el
index 1c25df8..0b39d61 100644
--- a/ebdb-snarf.el
+++ b/ebdb-snarf.el
@@ -1,6 +1,6 @@
 ;;; ebdb-snarf.el --- Creating or displaying records based on free-form pieces of text  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2016-2022  Free Software Foundation, Inc.
+;; Copyright (C) 2016-2023  Free Software Foundation, Inc.
 
 ;; Author: Eric Abrahamsen <[email-masked]>
 ;; Keywords: mail
@@ -187,9 +187,8 @@ nil."
 	       (name (save-excursion
 		       (when (re-search-backward
 			      name-re
-			      (if (bolp)
-				  (line-beginning-position 0)
-				(point-at-bol))
+                              (line-beginning-position
+                               (when (bolp) 0))
 			      t)
 			 ;; If something goes wrong with the
 			 ;; name, don't worry about it.
-- 
2.42.0

>From aa2c1110729e4f95a27ab022b565e4d55d65fd0e Mon Sep 17 00:00:00 2001
From: Arash Esbati <[email-masked]>
Date: Tue, 17 Oct 2023 14:24:06 +0200
Subject: [PATCH 6/6] ; ebdb.el: Pacify the compiler

* ebdb.el (ebdb-notice-field, ebdb-read, initialize-instance)
(ebdb-record-field-slot-query, ebdb-dwim-mail, ebdb-add-job)
(ebdb-eval-spec, ebdb-records-cite): Silence the compiler for
wrong usage of unescaped single quotes.
---
 ebdb.el | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/ebdb.el b/ebdb.el
index f31d5fa..f707826 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -1,6 +1,6 @@
 ;;; ebdb.el --- Contact management package           -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2016-2022  Free Software Foundation, Inc.
+;; Copyright (C) 2016-2023  Free Software Foundation, Inc.
 
 ;; Version: 0.8.18
 ;; Package-Requires: ((emacs "25.1") (seq "2.15"))
@@ -1199,15 +1199,15 @@ RECORD has taken place.  It is up to the class of FIELD to decide
 what, if anything, to do about this.
 
 TYPE is a further indicator of how RECORD was noticed: in normal
-MUAs it is one of the symbols 'sender or 'recipient.")
+MUAs it is one of the symbols \\='sender or \\='recipient.")
 
 (cl-defmethod ebdb-notice-field ((_field ebdb-field)
 				 &optional _type _record)
   "Ask FIELD of RECORD to react to RECORD being \"noticed\".
 When the user receives an email from or cc'd to RECORD, that
 record will call `ebdb-notice' on all its fields, and give them a
-chance to react somehow.  TYPE is one of the symbols 'sender or
-'recipient, indicating which message header the record was found
+chance to react somehow.  TYPE is one of the symbols \\='sender or
+\\='recipient, indicating which message header the record was found
 in."
   nil)
 
@@ -1257,12 +1257,12 @@ in."
   "Prompt for a label for a new object of class CLASS.
 OBJ is used as as a default, and the results are stored in SLOTS.
 
-All subclasses of `ebdb-field-labeled' should have a 'label-list
+All subclasses of `ebdb-field-labeled' should have a \\='label-list
 slot pointing to a var holding known labels for that class.  This
 method checks that the label is known, and asks for confirmation
 if it isn't.
 
-This method also signals the 'ebdb-empty error if the user gives
+This method also signals the \\='ebdb-empty error if the user gives
 an empty string as a label, which allows interruption of the read
 process."
   ;; FIXME: Now that labels are read after the main class, this should
@@ -3056,8 +3056,8 @@ RECORD is responsible for parsing it correctly.")
 
 (cl-defmethod initialize-instance ((record ebdb-record) &optional slots)
   "Initialize RECORD.
-Adds a cache to the cache slot, and ensures the 'timestamp and
-'creation-date slots are filled."
+Adds a cache to the cache slot, and ensures the \\='timestamp and
+\\='creation-date slots are filled."
   ;; This is the very first thing that happens to a record after it is
   ;; created (whether manually or loaded).
   (let ((cache (make-ebdb-record-cache)))
@@ -3123,8 +3123,8 @@ acceptable fields.  Each list element is a cons of the form (SLOT
 . FIELDCLASS), meaning that RECORD-CLASS can accept fields of
 class FIELDCLASS in SLOT.
 
-If QUERY is non-nil, it should be a cons of either '(SLOT . nil),
-or '(nil . FIELDCLASS).  The \"nil\" is the value to query for:
+If QUERY is non-nil, it should be a cons of either \\='(SLOT . nil),
+or \\='(nil . FIELDCLASS).  The \"nil\" is the value to query for:
 either \"which slot can accept this field class\", or \"which
 fieldclass is appropriate for this slot\".  The return value in
 either case is a cons with both slot and fieldclass filled in.")
@@ -4869,7 +4869,7 @@ addresses.  Sort mails by descending priority.")
 However, if both the first name and last name are constituents of
 the address as in [email-masked], and
 `ebdb-mail-avoid-redundancy' is non-nil, then the address is used
-as is.  If `ebdb-mail-avoid-redundancy' is 'mail-only the name is
+as is.  If `ebdb-mail-avoid-redundancy' is \\='mail-only the name is
 never included.  MAIL may be a mail address to be used for
 RECORD.  If MAIL is nil use RECORD's primary mail address.  If
 MAIL is the symbol `prompt', prompt the user for a mail address
@@ -5166,7 +5166,7 @@ same meaning as in `completing-read'."
 (defsubst ebdb-add-job (spec record string)
   "Internal function: Evaluate SPEC for RECORD and STRING.
 If SPEC is a function call it with args RECORD and STRING.  Return value.
-If SPEC is a regexp, return 'query unless SPEC matches STRING.
+If SPEC is a regexp, return \\='query unless SPEC matches STRING.
 Otherwise return SPEC.
 Used with variable `ebdb-add-name' and friends."
   (cond ((functionp spec)
@@ -5177,7 +5177,7 @@ Used with variable `ebdb-add-name' and friends."
 
 (defsubst ebdb-eval-spec (spec prompt)
   "Internal function: Evaluate SPEC using PROMPT.
-Return t if either SPEC equals t, or SPEC equals 'query and `ebdb-silent'
+Return t if either SPEC equals t, or SPEC equals \\='query and `ebdb-silent'
 is non-nil or `y-or-no-p' returns t using PROMPT.
 Used with return values of `ebdb-add-job'."
   (or (eq spec t)
@@ -5709,7 +5709,7 @@ inserting it."
 
 (cl-defgeneric ebdb-records-cite (style records)
   "Return mode-appropriate mail strings for RECORDS.
-STYLE is a symbol, one of 'inline or 'list.  This is interpreted
+STYLE is a symbol, one of \\='inline or \\='list.  This is interpreted
 differently by different major modes; the default looks like
 \"Firstname Lastname <[email-masked]>\".
 
-- 
2.42.0

Best, Arash