From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 07 13:30:32 2025 Received: (at submit) by debbugs.gnu.org; 7 Apr 2025 17:30:32 +0000 Received: from localhost ([127.0.0.1]:56681 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u1qIp-00009W-KT for submit@debbugs.gnu.org; Mon, 07 Apr 2025 13:30:32 -0400 Received: from lists.gnu.org ([2001:470:142::17]:33928) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u1qIU-0008SF-3M for submit@debbugs.gnu.org; Mon, 07 Apr 2025 13:30:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u1qI6-00058F-FV for bug-gnu-emacs@gnu.org; Mon, 07 Apr 2025 13:29:55 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u1qI2-0007bw-Iv for bug-gnu-emacs@gnu.org; Mon, 07 Apr 2025 13:29:45 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 5133880289 for ; Mon, 7 Apr 2025 13:29:41 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1744046976; bh=rjhTQNCNL6uH75lc7y5Vb4JylbE55LrpzWm2wV8P3BE=; h=From:To:Subject:Date:From; b=LfiI/LXhaPUxVY/GqqF/ahAa3Vi4Iqgfz+TwJiNb3vLkIZUDaOObRSDstvE9PZc/c z+8309UAL2al7eYhzw1iBREmWIjZymVjHoKCGp+C89JTau+4LSnWdnnGMhWO7pAx07 aOg4wAJEdosY7jX8uyHliA8VQQ72wLsNG9r3NP3bkC1kI5RoXbGgIqXnm4sp/UMGua 2WpuhH/EMAmjBu8CHTEHnJxxNrtGNZ9NOGMAMXegTY+f9tH4ojn1o3gxbcv907+Ola YtN8fyJzljdCsBAS3d5VbIbKwPsV0sHfC+ggq+CE2fF+/JsSnJUlrD1qOcNusk/4c6 V9q8VrlJdK0pg== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 65EE680756 for ; Mon, 7 Apr 2025 13:29:36 -0400 (EDT) Received: from alfajor (modemcable005.21-80-70.mc.videotron.ca [70.80.21.5]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 47B31120371 for ; Mon, 7 Apr 2025 13:29:36 -0400 (EDT) From: Stefan Monnier To: bug-gnu-emacs@gnu.org Subject: [PATCH] (eieio-backward-compatibility): Change default to new `warn` value Message-ID: X-Debbugs-Cc: , Eric M. Ludlam Date: Mon, 07 Apr 2025 13:29:35 -0400 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.150 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Tags: patch See commit message below. I also encourage everyone to set `eieio-backward-compatibility` to nil in their `.emacs`. Stefan In GNU Emacs 31.0.50 (build 2, i686-pc-linux-gnu, GTK+ Version 3.24.48, cairo version 1.18.2) of 2025-03-15 built on alfajor Repository revision: 4a378e3b325ff3cb84307a2ff4d05ab9ffe24905 Repository branch: work Windowing system distributor 'The X.Org Foundation', version 11.0.12101015 System Description: Debian GNU/Linux trixie/sid Configured using: 'configure -C --enable-checking --enable-check-lisp-object-type --with-modules --with-cairo --with-tiff=ifavailable 'CFLAGS=-Wall -g3 -Og -Wno-pointer-sign' PKG_CONFIG_PATH=/home/monnier/lib/pkgconfig' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-eieio-backward-compatibility-Change-default-to-new-w.patch >From 5864b71a28be9fcf89fe0ba3603901f33f3fde78 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 7 Apr 2025 13:27:26 -0400 Subject: [PATCH] (eieio-backward-compatibility): Change default to new `warn` value `eieio-backward-compatibility` controls compatibility with features declared obsolete since Emacs-25. I'm not sure we're ready to remove support for those features (i.e. to set `eieio-backward-compatibility` to nil), so instead I suggest to make uses of those features emit warnings not only at compile-time but also at run-time. * lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility): Change default to new value `warn`. (eieio-defclass-internal): Obey the new `warn` value of `eieio-backward-compatibility` in `-list-p` predicates. * lisp/emacs-lisp/eieio-base.el (make-instance): Remove backward compatibility when `eieio-backward-compatibility` is nil and emit a warning if `eieio-backward-compatibility` is `warn`. (eieio-persistent-make-instance): Obey the new `warn` value of `eieio-backward-compatibility`. * lisp/emacs-lisp/eieio.el (defclass): Obey the new `warn` value of `eieio-backward-compatibility` in accessors to class slots. (make-instance): Remove backward compatibility when `eieio-backward-compatibility` is nil and emit a warning if `eieio-backward-compatibility` is `warn`. (clone): Obey the new `warn` value of `eieio-backward-compatibility`. --- etc/NEWS | 8 ++++++++ lisp/emacs-lisp/eieio-base.el | 6 ++++-- lisp/emacs-lisp/eieio-core.el | 8 ++++++-- lisp/emacs-lisp/eieio.el | 13 ++++++++----- 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 63957628b98..bc8871cd581 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -535,6 +535,14 @@ This variable has no effect when Transient Mark mode is off. * Changes in Specialized Modes and Packages in Emacs 31.1 +** EIEIO +--- +*** New value 'warn' for 'eieio-backward-compatibility'. +This is the new default value and causes warnings to be emitted +at run-time for the use of the associated deprecated features. +(setq eieio-backward-compatibility t) can be used to recover +the previous silence. + --- ** Text mode diff --git a/lisp/emacs-lisp/eieio-base.el b/lisp/emacs-lisp/eieio-base.el index 7975cdf280d..31f40bb8ca1 100644 --- a/lisp/emacs-lisp/eieio-base.el +++ b/lisp/emacs-lisp/eieio-base.el @@ -207,9 +207,9 @@ clone nobj)) (cl-defmethod make-instance ((class (subclass eieio-named)) &rest args) - (if (not (stringp (car args))) + (if (not (and eieio-backward-compatibility (stringp (car args)))) (cl-call-next-method) - (funcall (if eieio-backward-compatibility #'ignore #'message) + (funcall (if (eq eieio-backward-compatibility 'warn) #'message #'ignore) "Obsolete: name passed without :object-name to %S constructor" class) (apply #'cl-call-next-method class :object-name args))) @@ -345,6 +345,8 @@ eieio-persistent-make-instance (object-of-class-p newobj 'eieio-named) (not (oref newobj object-name)) name) + (when (eq eieio-backward-compatibility 'warn) + (message "Obsolete name slot initialized for %S" newobj)) (oset newobj object-name name)) newobj)))) diff --git a/lisp/emacs-lisp/eieio-core.el b/lisp/emacs-lisp/eieio-core.el index 99f8feb9644..7d0fd643056 100644 --- a/lisp/emacs-lisp/eieio-core.el +++ b/lisp/emacs-lisp/eieio-core.el @@ -63,12 +63,14 @@ eieio-skip-typecheck (defvar eieio-optimize-primary-methods-flag t "Non-nil means to optimize the method dispatch on primary methods.") -(defvar eieio-backward-compatibility t +(defvar eieio-backward-compatibility 'warn "If nil, drop support for some behaviors of older versions of EIEIO. Currently under control of this var: - Define every class as a var whose value is the class symbol. - Define -child-p and -list-p predicates. -- Allow object names in constructors.") +- Allow object names in constructors. +When `warn', also emit warnings at run-time when code uses those +deprecated features.") (define-obsolete-variable-alias 'eieio-unbound 'eieio--unbound "28.1") (defvar eieio--unbound (make-symbol "eieio--unbound") @@ -359,6 +361,8 @@ eieio-defclass-internal (internal--format-docstring-line "Test OBJ to see if it a list of objects which are a child of type `%s'." cname)) + (when (eq eieio-backward-compatibility 'warn) + (message "Use of obsolete function %S" csym)) (when (listp obj) (let ((ans t)) ;; nil is valid ;; Loop over all the elements of the input list, test diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el index d66915260c8..37233677d89 100644 --- a/lisp/emacs-lisp/eieio.el +++ b/lisp/emacs-lisp/eieio.el @@ -216,6 +216,9 @@ defclass "Retrieve the class slot `%S' from a class `%S'." sname name) "\nThis method is obsolete.") + (when (eq eieio-backward-compatibility 'warn) + (message "Use of obsolete method %S on %S" + ',acces '(subclass ,name))) (if (slot-boundp this ',sname) (eieio-oref-default this ',sname))) accessors))) @@ -732,10 +735,10 @@ make-instance calls `initialize-instance' on that object." (let* ((new-object (copy-sequence (eieio--class-default-object-cache (eieio--class-object class))))) - (if (and slots + (if (and slots eieio-backward-compatibility (let ((x (car slots))) (or (stringp x) (null x)))) - (funcall (if eieio-backward-compatibility #'ignore #'message) + (funcall (if (eq eieio-backward-compatibility 'warn) #'message #'ignore) "Obsolete name argument %S passed to %S constructor" (pop slots) class)) ;; Call the initialize method on the new object with the slots @@ -841,9 +844,9 @@ clone (cl-defmethod clone ((obj eieio-default-superclass) &rest params) "Make a copy of OBJ, and then apply PARAMS." (let ((nobj (copy-sequence obj))) - (if (stringp (car params)) - (funcall (if eieio-backward-compatibility #'ignore #'message) - "Obsolete name argument %S passed to clone" (pop params))) + (if (and (stringp (car params)) + (memq eieio-backward-compatibility '(nil warn))) + (message "Obsolete name argument %S passed to clone" (pop params))) (if params (shared-initialize nobj params)) nobj)) -- 2.47.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 07 18:36:45 2025 Received: (at 77612) by debbugs.gnu.org; 7 Apr 2025 22:36:45 +0000 Received: from localhost ([127.0.0.1]:57413 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u1v5A-0007Cq-AW for submit@debbugs.gnu.org; Mon, 07 Apr 2025 18:36:44 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:5100) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u1v52-0007C2-G1 for 77612@debbugs.gnu.org; Mon, 07 Apr 2025 18:36:41 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 48F7010006B; Mon, 7 Apr 2025 18:36:30 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1744065389; bh=MTFmd2IWtoKxQC6JsFUeKjmiOYPDZ4n10EUOw8SuNmQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=ko5nfKLpvF7JXAHWDJ/ZCZ1BDW9Y99YnO3YYRJwgdZocsNhi5H4qmP2exa5YgDe2y aCcFt+MkE8e7bis23Aj88ikRt8ILQ/i5kzuJJldi03Qvg25FhMyH5PAszKtCz+uQI9 zUhHZi8LAHaggmP5oQ/0q33HcYGP2hMuTgbFEPNLxeNpFuQ4qFNVlx36m5VWi9bO8b x+zbDZ4DIYvjXRpUtgrMLU9kFL20csd7M6JkUr3wL1YeZ33cil0EEk5GJdQ9ZCeMFG +kJSmyGuJe1F0EMJz+43uSD0b4lfR1PDMDJ1u4udLHUdOjNRj4W/AG28eCphzC7DaD /dob/3zunKqyQ== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 9D8C3100027; Mon, 7 Apr 2025 18:36:29 -0400 (EDT) Received: from alfajor (unknown [104.247.242.5]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 6FB1A1203DA; Mon, 7 Apr 2025 18:36:29 -0400 (EDT) From: Stefan Monnier To: 77612@debbugs.gnu.org Subject: Re: bug#77612: [PATCH] (eieio-backward-compatibility): Change default to new `warn` value In-Reply-To: Message-ID: References: Date: Mon, 07 Apr 2025 18:36:19 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.356 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77612 Cc: "Eric M. Ludlam" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > `eieio-backward-compatibility` controls compatibility with > features declared obsolete since Emacs-25. I'm not sure > we're ready to remove support for those features (i.e. to set > `eieio-backward-compatibility` to nil), so instead I suggest > to make uses of those features emit warnings not only at > compile-time but also at run-time. I forgot to add the same treatment for the (ab)use of initargs as slot names (also deprecated since Emacs-25), so I'd suggest adding the patch below to the previous one. Stefan diff --git a/lisp/emacs-lisp/eieio-core.el b/lisp/emacs-lisp/eieio-core.el index 7d0fd643056..d608517e671 100644 --- a/lisp/emacs-lisp/eieio-core.el +++ b/lisp/emacs-lisp/eieio-core.el @@ -913,12 +913,15 @@ (let* ((fsi (gethash slot (cl--class-index-table class)))) (if (integerp fsi) fsi + (when eieio-backward-compatibility (let ((fn (eieio--initarg-to-attribute class slot))) - (if fn + (when fn + (when (eq eieio-backward-compatibility 'warn) + (message "Accessing slot `%S' via obsolete initarg name `%S'" + fn slot)) ;; Accessing a slot via its :initarg is accepted by EIEIO ;; (but not CLOS) but is a bad idea (for one: it's slower). - (eieio--slot-name-index class fn) - nil))))) + (eieio--slot-name-index class fn))))))) (defun eieio--class-slot-name-index (class slot) "In CLASS find the index of the named SLOT. From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 17 15:50:29 2025 Received: (at 77612) by debbugs.gnu.org; 17 Apr 2025 19:50:30 +0000 Received: from localhost ([127.0.0.1]:48487 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u5VFk-0000tC-4y for submit@debbugs.gnu.org; Thu, 17 Apr 2025 15:50:29 -0400 Received: from mail.eshelyaron.com ([107.175.124.16]:33040 helo=eshelyaron.com) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u5VFi-0000s5-6V for 77612@debbugs.gnu.org; Thu, 17 Apr 2025 15:50:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1744919425; bh=B/SpaQr5yR0q/m78lATPA1CXbzRGFBX30XS9dMkNw2o=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=TnwotML1QdPZRXTjwGmMOi7/t+BBXkFmJP328Yxyn1tpEF7LP9jR4zS+7Hks7iEFw mvN3D4UPiGHjsUwIgh1g+aRFoavVWuUno/EG/Q+W/1+a65DyUpSikvL0rvh+LlM0l4 8s2PHXOfxJjpsjA+j3h3AT4c7PkZoHjWFqQAkLaRvJSe/OCQB/QCrZs0IXOqW+3Wtg U4A5GMI4CL2B/Sj739tmmo70Ej8i/W8xdb0hkp06sM/FoFe/UHkboeX8e3rUG0faK7 wdaKzwhl9HDNo9oeDlrFnfZvt8TJBFrzHf/5HX1TEYJHBYdcAoDnOQXfdDCyUuForG KemzNzLVynA+w== From: Eshel Yaron To: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Subject: Re: bug#77612: [PATCH] (eieio-backward-compatibility): Change default to new `warn` value In-Reply-To: References: Date: Thu, 17 Apr 2025 21:50:22 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 77612 Cc: "Eric M. Ludlam" , Stefan Monnier , 77612@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Stefan, Stefan Monnier writes: >> `eieio-backward-compatibility` controls compatibility with >> features declared obsolete since Emacs-25. I'm not sure >> we're ready to remove support for those features (i.e. to set >> `eieio-backward-compatibility` to nil), so instead I suggest >> to make uses of those features emit warnings not only at >> compile-time but also at run-time. > > I forgot to add the same treatment for the (ab)use of initargs as slot > names (also deprecated since Emacs-25), so I'd suggest adding the patch > below to the previous one. > > > Stefan > > diff --git a/lisp/emacs-lisp/eieio-core.el b/lisp/emacs-lisp/eieio-core.el > index 7d0fd643056..d608517e671 100644 > --- a/lisp/emacs-lisp/eieio-core.el > +++ b/lisp/emacs-lisp/eieio-core.el > @@ -913,12 +913,15 @@ > (let* ((fsi (gethash slot (cl--class-index-table class)))) > (if (integerp fsi) > fsi > + (when eieio-backward-compatibility > (let ((fn (eieio--initarg-to-attribute class slot))) > - (if fn > + (when fn > + (when (eq eieio-backward-compatibility 'warn) > + (message "Accessing slot `%S' via obsolete initarg name `%= S'" > + fn slot)) > ;; Accessing a slot via its :initarg is accepted by EIEIO > ;; (but not CLOS) but is a bad idea (for one: it's slower). > - (eieio--slot-name-index class fn) > - nil))))) > + (eieio--slot-name-index class fn))))))) >=20=20 > (defun eieio--class-slot-name-index (class slot) > "In CLASS find the index of the named SLOT. 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 =E2=80=98host=E2=80=99 via obsolete initarg name =E2=80=98:h= ost=E2=80=99 Accessing slot =E2=80=98type=E2=80=99 via obsolete initarg name =E2=80=98:t= ype=E2=80=99 Accessing slot =E2=80=98host=E2=80=99 via obsolete initarg name =E2=80=98:h= ost=E2=80=99 Accessing slot =E2=80=98type=E2=80=99 via obsolete initarg name =E2=80=98:t= ype=E2=80=99 Accessing slot =E2=80=98host=E2=80=99 via obsolete initarg name =E2=80=98:h= ost=E2=80=99 Accessing slot =E2=80=98type=E2=80=99 via obsolete initarg name =E2=80=98:t= ype=E2=80=99 --8<---------------cut here---------------end--------------->8--- WDYT about adapting auth-source-search, along the following lines? 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 From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 17 16:10:48 2025 Received: (at 77612) by debbugs.gnu.org; 17 Apr 2025 20:10:49 +0000 Received: from localhost ([127.0.0.1]:48539 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u5VZO-0004WH-5t for submit@debbugs.gnu.org; Thu, 17 Apr 2025 16:10:48 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:54183) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u5VZK-0004UU-16 for 77612@debbugs.gnu.org; Thu, 17 Apr 2025 16:10:43 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 50288807BC; Thu, 17 Apr 2025 16:10:36 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1744920635; bh=smwp/U+CXSclVf2b/vmqeYoY6uFshjl4DftBvovuYDE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=N/fNqIGWgrpjY56+dIB5t56LrT5bAH0+6ILoEXkPQOy/KNf7TXP3yvcTxJMmKjBRq y256MQqMhsgMYNTOHGDmSFXSc/chaMCnMzjJtckzK2TsIrLdWmisr3HfOwEDe1zd/Y PPdSHq1trm/cw6dXeVY/BSvM7fqgjjQcOckbE1fbsK2jCp5LsJxjOz6DOqAcFQx243 Tzp2nMMJmkL3G7nTCidvMx2bgLqO+qCqwLQU+bWayuq33NZqABSaMqsJjCZGvX+ZkZ JH0usVSZ7XkhDhsZOsrRLkxqzKbd1G8/wLCU1zzDnHDGgdD4fdnAHxrwp7f85XZ0SG ppdYIUu6ubHRQ== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 7BC388060A; Thu, 17 Apr 2025 16:10:35 -0400 (EDT) Received: from pastel (104-195-239-180.cpe.teksavvy.com [104.195.239.180]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 4B718120504; Thu, 17 Apr 2025 16:10:35 -0400 (EDT) From: Stefan Monnier To: Eshel Yaron Subject: Re: bug#77612: [PATCH] (eieio-backward-compatibility): Change default to new `warn` value In-Reply-To: Message-ID: References: Date: Thu, 17 Apr 2025 16:10:33 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.054 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77612 Cc: "Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors" , "Eric M. Ludlam" , 77612@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > 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 =E2=80=98host=E2=80=99 via obsolete initarg name =E2=80=98= :host=E2=80=99 > Accessing slot =E2=80=98type=E2=80=99 via obsolete initarg name =E2=80=98= :type=E2=80=99 > Accessing slot =E2=80=98host=E2=80=99 via obsolete initarg name =E2=80=98= :host=E2=80=99 > Accessing slot =E2=80=98type=E2=80=99 via obsolete initarg name =E2=80=98= :type=E2=80=99 > Accessing slot =E2=80=98host=E2=80=99 via obsolete initarg name =E2=80=98= :host=E2=80=99 > Accessing slot =E2=80=98type=E2=80=99 via obsolete initarg name =E2=80=98= :type=E2=80=99 > --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 From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 18 02:40:24 2025 Received: (at 77612) by debbugs.gnu.org; 18 Apr 2025 06:40:25 +0000 Received: from localhost ([127.0.0.1]:49421 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u5fOf-0001SA-S3 for submit@debbugs.gnu.org; Fri, 18 Apr 2025 02:40:24 -0400 Received: from mail.eshelyaron.com ([107.175.124.16]:52044 helo=eshelyaron.com) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u5fOZ-0001PN-Io for 77612@debbugs.gnu.org; Fri, 18 Apr 2025 02:40:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1744958414; bh=hK07THM5YpI9iLL9qJ+Q0ceZY/gMef+Y8vOj/Hq42EM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=cYXd/Rdz1uOVle5EoUTeQ+9qJNTR6EXp1pUFGfkAbTbkyB8IhzdDqKqi6fr8d+N61 9YzLuQi1cHDHvvqMGwmPBkiA0V2gx8dnUr4+FYEtyia1u8q6t3IVt1MhJl007kd1mN n58cZyQ55h7mdJ+p4KuRErb+XynzLcmLYyElN81Cm5cievnEL9wYqv6sskMpfee0SB FUa/Jnw1Gmj0vSq/Inu24dPd9Nfdrx1Z0G4+knvTYXExbQ2c0QPFenX9aNm59NAd/5 Fpg7X3ACWqZf16t+O8aaINMulmyEUIZ7HnawVY1JHS/qX1bkD9E7ZdQVOh5KmoFShl rjolLlXSgRPnA== From: Eshel Yaron To: Stefan Monnier Subject: Re: bug#77612: [PATCH] (eieio-backward-compatibility): Change default to new `warn` value In-Reply-To: References: Date: Fri, 18 Apr 2025 08:40:11 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 77612 Cc: "Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors" , "Eric M. Ludlam" , 77612@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Monnier writes: >> 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 =E2=80=98host=E2=80=99 via obsolete initarg name =E2=80= =98:host=E2=80=99 >> Accessing slot =E2=80=98type=E2=80=99 via obsolete initarg name =E2=80= =98:type=E2=80=99 >> Accessing slot =E2=80=98host=E2=80=99 via obsolete initarg name =E2=80= =98:host=E2=80=99 >> Accessing slot =E2=80=98type=E2=80=99 via obsolete initarg name =E2=80= =98:type=E2=80=99 >> Accessing slot =E2=80=98host=E2=80=99 via obsolete initarg name =E2=80= =98:host=E2=80=99 >> Accessing slot =E2=80=98type=E2=80=99 via obsolete initarg name =E2=80= =98:type=E2=80=99 >> --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? I just pushed it as commit 2f67352d7ae, thanks :) Eshel