Subject: Re: bug#77612: [PATCH] (eieio-backward-compatibility): Change default to new `warn` value

From: Stefan Monnier <[email-masked]>
Date: Thu, 17 Apr 2025 16:10:33 -0400

> With this change (in commit ae1d01328f2), auth-source-search started
> producing warnings, since (IIUC) it relies on the obsolete calling
> convention using :initarg.  For example, I get the following messages
> when evaluating the example form in the auth-source-search docstring:
>
> --8<---------------cut here---------------start------------->8---
> Accessing slot ‘host’ via obsolete initarg name ‘:host’
> Accessing slot ‘type’ via obsolete initarg name ‘:type’
> Accessing slot ‘host’ via obsolete initarg name ‘:host’
> Accessing slot ‘type’ via obsolete initarg name ‘:type’
> Accessing slot ‘host’ via obsolete initarg name ‘:host’
> Accessing slot ‘type’ via obsolete initarg name ‘:type’
> --8<---------------cut here---------------end--------------->8---
>
> WDYT about adapting auth-source-search, along the following lines?

LGTM.  Do you want me to push it, or will you?

        Stefan

> diff --git a/lisp/auth-source.el b/lisp/auth-source.el
> index 1d039d8b0d1..946debca95e 100644
> --- a/lisp/auth-source.el
> +++ b/lisp/auth-source.el
> @@ -708,7 +708,11 @@ auth-source-search
>            (condition-case nil
>                (unless (auth-source-search-collection
>                         (plist-get spec key)
> -                       (slot-value backend key))
> +                       (slot-value
> +                        backend
> +                        (if (keywordp key)
> +                            (intern-soft (substring (symbol-name key) 1))
> +                          key)))
>                  (setq filtered-backends (delq backend filtered-backends))
>                  (cl-return))
>              (invalid-slot-name nil))))
>
>
> Best,
>
> Eshel