GNU bug report logs -
#77612
[PATCH] (eieio-backward-compatibility): Change default to new `warn` value
Previous Next
To reply to this bug, email your comments to 77612 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
monnier <at> iro.umontreal.ca, zappo <at> gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#77612
; Package
emacs
.
(Mon, 07 Apr 2025 17:31:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Stefan Monnier <monnier <at> iro.umontreal.ca>
:
New bug report received and forwarded. Copy sent to
monnier <at> iro.umontreal.ca, zappo <at> gnu.org, bug-gnu-emacs <at> gnu.org
.
(Mon, 07 Apr 2025 17:31:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
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'
[0001-eieio-backward-compatibility-Change-default-to-new-w.patch (text/patch, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77612
; Package
emacs
.
(Mon, 07 Apr 2025 22:37:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 77612 <at> debbugs.gnu.org (full text, mbox):
> `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.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77612
; Package
emacs
.
(Thu, 17 Apr 2025 19:51:05 GMT)
Full text and
rfc822 format available.
Message #11 received at 77612 <at> debbugs.gnu.org (full text, mbox):
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)))))))
>
> (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 ‘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?
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
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77612
; Package
emacs
.
(Thu, 17 Apr 2025 19:52:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77612
; Package
emacs
.
(Thu, 17 Apr 2025 20:11:03 GMT)
Full text and
rfc822 format available.
Message #17 received at 77612 <at> debbugs.gnu.org (full text, mbox):
> 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
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77612
; Package
emacs
.
(Thu, 17 Apr 2025 20:12:05 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77612
; Package
emacs
.
(Fri, 18 Apr 2025 06:41:05 GMT)
Full text and
rfc822 format available.
Message #23 received at 77612 <at> debbugs.gnu.org (full text, mbox):
Stefan Monnier <monnier <at> iro.umontreal.ca> 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 ‘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?
I just pushed it as commit 2f67352d7ae, thanks :)
Eshel
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77612
; Package
emacs
.
(Fri, 18 Apr 2025 06:42:06 GMT)
Full text and
rfc822 format available.
This bug report was last modified 15 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.