Re: [PATCH] Silencing the compiler with latest Emacs master

Arash Esbati <[email protected]> Wed, 06 Jul 2022 09:38:04 +0200
Newsgroups gmane.emacs.bbdb.user
Message-ID <[email protected]>
--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Roland Winkler <[email protected]> writes:

> Thanks, pushed!  (I did not create a new version for GNU Elpa.)

Thanks.  But I was too optimistic about fixing them all.  Please find
attached a patch fixing 2 docstring issues reported by the compiler.

Further, the compiler complains about:

  bbdb.el:1736:29: Warning: =E2=80=98sc-load-hook=E2=80=99 is an obsolete v=
ariable (as of 26.1);
      use =E2=80=98with-eval-after-load=E2=80=99 instead.

I'm also attaching a small change using `eval-after-load' which should
fix this and also supports older Emacs'en.

Best, Arash

--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=docstring.patch

diff --git a/lisp/bbdb-anniv.el b/lisp/bbdb-anniv.el
index 99f8521..1b9bfd4 100644
--- a/lisp/bbdb-anniv.el
+++ b/lisp/bbdb-anniv.el
@@ -77,7 +77,7 @@ as format string."
 This obeys `calendar-date-style' via `diary-date-forms'.
 To enable this feature, put the following into your .emacs:
 
- \(add-hook 'diary-list-entries-hook 'bbdb-anniv-diary-entries)"
+ \(add-hook \\='diary-list-entries-hook \\='bbdb-anniv-diary-entries)"
   ;; Loop over NUMBER dates starting from ORGINAL-DATE.
   (let* ((num-date (1- (calendar-absolute-from-gregorian original-date)))
          (end-date (+ num-date number)))
diff --git a/lisp/bbdb-gnus-aux.el b/lisp/bbdb-gnus-aux.el
index f2050d8..96f7d8b 100644
--- a/lisp/bbdb-gnus-aux.el
+++ b/lisp/bbdb-gnus-aux.el
@@ -318,14 +318,14 @@ determine the group and spooling priority for a single address."
 ;;
 ;;;###autoload
 (defun bbdb/gnus-nnimap-folder-list-from-bbdb ()
-  "Return a list of \( \"From\" mail-regexp imap-folder-name\) tuples
+  "Return a list of (\"From\" mail-regexp imap-folder-name) tuples
 based on the contents of the bbdb.
 
-The folder-name is the value of the 'imap attribute of the BBDB record;
+The folder-name is the value of the \\='imap attribute of the BBDB record;
 the mail-regexp consists of all the mail addresses for the BBDB record
-concatenated with OR.  Records without an 'imap attribute are ignored.
+concatenated with OR.  Records without an \\='imap attribute are ignored.
 
-Here  is an example of a relevant BBDB record:
+Here is an example of a relevant BBDB record:
 
 Uwe Brauer
            mail: [email protected]
@@ -336,13 +336,13 @@ This function uses `regexp-opt' to generate the mail-regexp which automatically
 the `nnimap-split-fancy' method you have to use macros, that is your setting
 will look like:
 
-\(setq nnimap-split-rule  'nnimap-split-fancy
-       nnimap-split-inbox \"INBOX\"
-       nnimap-split-fancy
-       `\(| ,@\(bbdb/gnus-nnimap-folder-list-from-bbdb\)
-            ... \)\)
+\(setq nnimap-split-rule  \\='nnimap-split-fancy
+      nnimap-split-inbox \"INBOX\"
+      nnimap-split-fancy
+      \\=`(| ,@(bbdb/gnus-nnimap-folder-list-from-bbdb)
+            ... ))
 
-Note that `\( is the backquote, NOT the quote '\(."
+Note that \\=`( is the backquote, NOT the quote \\='(."
 
   (let (;; the value of the 'imap attribute of a bbdb record
         folder-attr

--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=sc-load-hook.patch

diff --git a/lisp/bbdb.el b/lisp/bbdb.el
index e18c54b..bf6c18f 100644
--- a/lisp/bbdb.el
+++ b/lisp/bbdb.el
@@ -1726,14 +1726,14 @@ See also `bbdb-silent'.")
      ,(lambda () (add-hook 'mail-setup-hook #'bbdb-insinuate-mail)))
     (sendmail
      ,(lambda () (message "BBDB: sendmail insinuation deprecated.  Use mail.")
-            (add-hook 'mail-setup-hook #'bbdb-insinuate-mail)))
+        (add-hook 'mail-setup-hook #'bbdb-insinuate-mail)))
     (message                    ; the gnus mail user agent
      ,(lambda () (add-hook 'message-setup-hook #'bbdb-insinuate-message)))
     (mu4e                       ; the mu4e user agent
      ,(lambda () (add-hook 'mu4e-main-mode-hook #'bbdb-insinuate-mu4e)))
 
     (sc                         ; supercite
-     ,(lambda () (add-hook 'sc-load-hook #'bbdb-insinuate-sc)))
+     ,(lambda () (eval-after-load "supercite" '(bbdb-insinuate-sc))))
     (anniv                      ; anniversaries
      ,(lambda () (add-hook 'diary-list-entries-hook #'bbdb-anniv-diary-entries)))
     (pgp                        ; pgp-mail

--=-=-=--