GNU bug report logs - #66342
Quote cl-generic-current-method-specializers

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Thuna <thuna.cing@HIDDEN>; Keywords: moreinfo patch; dated Wed, 4 Oct 2023 14:20:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 66342 <at> debbugs.gnu.org:


Received: (at 66342) by debbugs.gnu.org; 4 Mar 2025 22:15:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 04 17:15:43 2025
Received: from localhost ([127.0.0.1]:33363 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tpaY8-0003cj-Ty
	for submit <at> debbugs.gnu.org; Tue, 04 Mar 2025 17:15:43 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:26428)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <monnier@HIDDEN>)
 id 1tpaXm-0003Xj-DF
 for 66342 <at> debbugs.gnu.org; Tue, 04 Mar 2025 17:15:19 -0500
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 08707100154;
 Tue,  4 Mar 2025 17:15:10 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1741126509;
 bh=zdEIYCK6QkwScLMysIMTWWsvU3DsuEZy84aEU2nl6CA=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=UYZuUdxmIWmsacCQsqM4OzIJBEiEfH7RhidCpfdZFbG5YVlTfr4Vu1hKTc7dWTW1/
 k9JpmJ0AZXtdqhP/razaaG/dUD4fM16aEpbQjPGMTYHWWDnLUHWNZ3DsqZ4viSPXdd
 K3F6KANQX7hHhAUkaTTOisJ8bnnC1sLRVjUijEKC+WT+NSOQiFyC04nYMFHoExkXDH
 ji4Wy4yhxb8vz2o0SLTbRMiZcB8wMaqngwkdArUCZVpjbFidIchWHBd6R1yWgbgbId
 v2NhKXo4POkdVxMTGbvwVgYppkDj32jXqeZQPj23Rt70WEf0JAl3pEBcB4PqMeY2N0
 XiarS3O1hmQpw==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 22DBC100035;
 Tue,  4 Mar 2025 17:15:09 -0500 (EST)
Received: from alfajor (unknown [104.247.242.5])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id E7495120198;
 Tue,  4 Mar 2025 17:15:08 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Thuna <thuna.cing@HIDDEN>
Subject: Re: bug#66342: Quote cl-generic-current-method-specializers
In-Reply-To: <87ikooa3kj.fsf@HIDDEN>
Message-ID: <jwvwmd41m1m.fsf-monnier+emacs@HIDDEN>
References: <87leci1nf7.fsf@HIDDEN> <jwvv7tc5gei.fsf-monnier+emacs@HIDDEN>
 <CADwFkmkp1W14n8DAgQ=QCZQfctPfe9uNidjTshXUkyp4-s7GvQ@HIDDEN>
 <87ikooa3kj.fsf@HIDDEN>
Date: Tue, 04 Mar 2025 17:15:07 -0500
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.261 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: 66342
Cc: Stefan Kangas <stefankangas@HIDDEN>, 66342 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

>> Thuna, would you like to propose a patch that does that?
> Hm, I still think it's a shame, but sure.

Which brings back my first question:

    Interesting.  Out of curiosity, where/how did you bump into this?


- Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#66342; Package emacs. Full text available.

Message received at 66342 <at> debbugs.gnu.org:


Received: (at 66342) by debbugs.gnu.org; 4 Mar 2025 21:28:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 04 16:28:24 2025
Received: from localhost ([127.0.0.1]:33237 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tpZoO-0001Db-6S
	for submit <at> debbugs.gnu.org; Tue, 04 Mar 2025 16:28:24 -0500
Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]:45417)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <thuna.cing@HIDDEN>)
 id 1tpZoL-0001DF-Mj
 for 66342 <at> debbugs.gnu.org; Tue, 04 Mar 2025 16:28:22 -0500
Received: by mail-ed1-x52e.google.com with SMTP id
 4fb4d7f45d1cf-5dee07e51aaso11401335a12.3
 for <66342 <at> debbugs.gnu.org>; Tue, 04 Mar 2025 13:28:21 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1741123695; x=1741728495; darn=debbugs.gnu.org;
 h=mime-version:message-id:date:references:in-reply-to:subject:cc:to
 :from:from:to:cc:subject:date:message-id:reply-to;
 bh=5x9GiOH2wQ/KJ+wfeXly0t+sSO4ZIwhWRlCWWVNw1b0=;
 b=ap7gMlBGo8jcbN3dHnHQu/pECjPZxSBLXsCzJ7lReQaG7rXHye+yf+aXBHmDxlZuot
 lQa3kW8dotoMSOFXILpVbv9B/IHztFpvKGGZ+1Z4TCqwAIbmrBvnyq+IpKR6BOJcQTpX
 bb4Dat8yx0+1EdemAXXQlUE2gKxPiIZeoerhaK0jzrS78I3wEUyKzwcMV6CFCepUJLKW
 LqBwxrvZNCr+9Exns/dOvqYNDbWlg+fQ8zYGSH7jMHu78ka/BIiPhqEvC61prmTvIgNw
 DnHb3TlyQ0HKp7zuwhwecPtNQJYE3NgsO28YYJayNG2VBozMjHcCwzJj74+Kw4YSPn6n
 1C4Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1741123695; x=1741728495;
 h=mime-version:message-id:date:references:in-reply-to:subject:cc:to
 :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=5x9GiOH2wQ/KJ+wfeXly0t+sSO4ZIwhWRlCWWVNw1b0=;
 b=UKVsi/7vfZjnPARo4m4HUAq0Y3SNS0MRlZNyOUV1DN5UYDFdmYApPwT8TcjzzNVEo8
 VULFvLvUzXc1hvp1ba8XDedWEudlb3xHGhN1/4GpS9eGUuws0Weh2tBdMnqQcE/X6lE0
 WWmeS7LNHu9CJTVcOX4sRguzIGDy9Kv38HyiNL928VfyxgNKzMQn394YhmIYT3JnfW1P
 ud54mNX8HxgGWBNpoQ4xbXWuPfKQM7ofn+8TqnhPCFmE3Iuiq/4iGT8HxAp2e1T6e1m2
 l6Dk0pbHY/R4dcEOnhtqcaO03njNdru9mNSjU4EZoal7jCj05QmEaAabm242AFoofOcx
 dUIg==
X-Gm-Message-State: AOJu0Yyw3ZHecbOPlOLYuQqWuMnEV6i20Qd2ZXeEwu//Qz4VFpEvmlnA
 uxA8iCVClR4z3KQWGsSMArND8N+NvpTyKHphzNzQFre81pfxZX6pSSf95xZ1eUH4rg==
X-Gm-Gg: ASbGncsUW+ZNgjs00GySCmlCy8aSmW5wThu7CE7LumUglITg9JzFZKOrLH4igpu+qiR
 HvZs++hlq0WtLA/XeDnLvKDHAKJjVyw9UM8pVcLFW55f01N03hqiaag/sFnDl+ORLwfSQ2P5uzP
 qNEaMHr+wsI0wm9t23hxkETbzSjp7CTeRrTa5A0gq5fx3iUAFbqt0M5WcdfCffvrFVC8P2yalVX
 md2G9HHxPOuZLOSX1U3g+7qfG17VesubZeWSaW2lup1nhtkxx4bx488lpNQM1+26Oy8CMf/9PiF
 ntEQunnbHwcXqad+ULsqG3pb6VFhgs000+bUC8zjzbZ+
X-Google-Smtp-Source: AGHT+IF58Ik3QkM97MHchmvueKu9l2/kYJ6TJDlkb8a7wBbW8mZBCJkeGKmHlghC6JFPdpSnBHX3kw==
X-Received: by 2002:a05:6402:3784:b0:5db:e7eb:1b34 with SMTP id
 4fb4d7f45d1cf-5e59f3d67famr615746a12.13.1741123695219; 
 Tue, 04 Mar 2025 13:28:15 -0800 (PST)
Received: from thuna-lis3 ([178.249.211.77]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5e4c3b4af4dsm8695252a12.11.2025.03.04.13.28.12
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 04 Mar 2025 13:28:13 -0800 (PST)
From: Thuna <thuna.cing@HIDDEN>
To: Stefan Kangas <stefankangas@HIDDEN>, Stefan Monnier
 <monnier@HIDDEN>
Subject: Re: bug#66342: Quote cl-generic-current-method-specializers
In-Reply-To: <CADwFkmkp1W14n8DAgQ=QCZQfctPfe9uNidjTshXUkyp4-s7GvQ@HIDDEN>
References: <87leci1nf7.fsf@HIDDEN> <jwvv7tc5gei.fsf-monnier+emacs@HIDDEN>
 <CADwFkmkp1W14n8DAgQ=QCZQfctPfe9uNidjTshXUkyp4-s7GvQ@HIDDEN>
Date: Tue, 04 Mar 2025 22:28:12 +0100
Message-ID: <87ikooa3kj.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 66342
Cc: 66342 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain

> If it's not useful, and anyways not used by anyone, I think it's better
> to get rid of it.
>
> Thuna, would you like to propose a patch that does that?

Hm, I still think it's a shame, but sure.  Something like the attached
patch should do the trick, though I've not tested it in the slightest.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-Remove-cl-generic-current-method-specializers.patch

From 6d1fbc312fb2a73141a28c3abe7d94c88429f88a Mon Sep 17 00:00:00 2001
From: Thuna <thuna.cing@HIDDEN>
Date: Tue, 4 Mar 2025 22:25:32 +0100
Subject: [PATCH] Remove `cl-generic-current-method-specializers'

* lisp/emacs-lisp/cl-generic.el (cl-generic-define-context-rewriter): Do
not bind `cl-generic-current-method-specializers' in the macro
environment.
(cl-generic-current-method-specializers): Remove macro.
---
 lisp/emacs-lisp/cl-generic.el | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el
index 11685d09d12..ea2bca4c1e0 100644
--- a/lisp/emacs-lisp/cl-generic.el
+++ b/lisp/emacs-lisp/cl-generic.el
@@ -339,11 +339,6 @@ cl-generic-define
     (setf (cl--generic-options generic) options)
     (cl--generic-make-function generic)))
 
-(defmacro cl-generic-current-method-specializers ()
-  "List of (VAR . TYPE) where TYPE is var's specializer.
-This macro can only be used within the lexical scope of a cl-generic method."
-  (error "cl-generic-current-method-specializers used outside of a method"))
-
 (defmacro cl-generic-define-context-rewriter (name args &rest body)
   "Define a special kind of context named NAME.
 Whenever a context specializer of the form (NAME . ARGS) appears,
@@ -391,17 +386,14 @@ cl-generic-define-context-rewriter
     "Make the lambda expression for a method with ARGS and BODY."
     (pcase-let* ((`(,spec-args . ,plain-args)
                   (cl--generic-split-args args))
-                 (fun `(cl-function (lambda ,plain-args ,@body)))
-                 (macroenv (cons `(cl-generic-current-method-specializers
-                                   . ,(lambda () spec-args))
-                                 macroexpand-all-environment)))
+                 (fun `(cl-function (lambda ,plain-args ,@body))))
       (require 'cl-lib)        ;Needed to expand `cl-flet' and `cl-function'.
       (when (assq 'interactive body)
         (message "Interactive forms not supported in generic functions: %S"
                  (assq 'interactive body)))
       ;; First macroexpand away the cl-function stuff (e.g. &key and
       ;; destructuring args, `declare' and whatnot).
-      (pcase (macroexpand fun macroenv)
+      (pcase (macroexpand fun macroexpand-all-environment)
         (`#'(lambda ,args . ,body)
          (let* ((parsed-body (macroexp-parse-body body))
                 (nm (make-symbol "cl--nm"))
@@ -412,7 +404,7 @@ cl-generic-define-context-rewriter
                         `(cl-flet ((cl-call-next-method ,cnm)
                                    (cl-next-method-p ,nmp))
                            ,@(cdr parsed-body))
-                        macroenv))
+                        macroexpand-all-environment))
                 ;; FIXME: Rather than `grep' after the fact, the
                 ;; macroexpansion should directly set some flag when cnm
                 ;; is used.
-- 
2.44.2


--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#66342; Package emacs. Full text available.

Message received at 66342 <at> debbugs.gnu.org:


Received: (at 66342) by debbugs.gnu.org; 2 Mar 2025 03:41:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 01 22:41:19 2025
Received: from localhost ([127.0.0.1]:49200 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1toaCc-0003ka-4Q
	for submit <at> debbugs.gnu.org; Sat, 01 Mar 2025 22:41:18 -0500
Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]:56402)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>)
 id 1toaCZ-0003jz-Mr
 for 66342 <at> debbugs.gnu.org; Sat, 01 Mar 2025 22:41:16 -0500
Received: by mail-ed1-x533.google.com with SMTP id
 4fb4d7f45d1cf-5e4d50ed90aso3235122a12.0
 for <66342 <at> debbugs.gnu.org>; Sat, 01 Mar 2025 19:41:15 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1740886869; x=1741491669; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:mime-version:references:in-reply-to
 :from:from:to:cc:subject:date:message-id:reply-to;
 bh=ARKHbElYAh8/3cHHIqWRrxmIWu7L514o6mCCQ5oVJmQ=;
 b=Kk9tnw+dBU6l3fOHUBK/QvtD5tSvNy2TZINfNZsqY5wjzCGVtE7d0GEWKCjgbMHmER
 6ovntPoovWfIUPFm9fJggAlUfG/EkR4V6ehtYo8aNVJGEK3JmpmKGuC720jvqHxK7J0G
 LneNFrD4yUEVPoO0oOtJRxeZe75Wh/8Qb5UXS7/LtKfJT+KL6x+vQEQQTWGkzYjPAtzJ
 RCleSUii0oPMHemqID6H2b3vUC3Iw4gCzZkuO6XvdBxn6oO6XinzsiHIR47V5ZL7FdeA
 P8Zqe6HUYiOjyARdlmduKNlS6C7X1+jQBaZ1Vy2kIpWpFojg2im6oVcou/D1nCE/g5dO
 CG4g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1740886869; x=1741491669;
 h=cc:to:subject:message-id:date:mime-version:references:in-reply-to
 :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=ARKHbElYAh8/3cHHIqWRrxmIWu7L514o6mCCQ5oVJmQ=;
 b=L3pAs/wqOubYIaD/8q5lx3pOcgbu2g1Xt722xjmB5Xji2WX0IkuyMyv7ysbAowQwvI
 nuBZBO8lQ1e3t0LQUXfMyGchmg+Vwnpzotudvogbwm7rHj18DgmjJ0npiTtaJ6koYs5G
 NdCSXymLG2P846E8luBwZNMYuqLH3BJ8/o5s+3Hfx6wpbGxPtV2/s6yQZR8tZVzygY4U
 YLgi8FCSgyrEW8e/SYyaUcMe7MHbDDNQrFLMjR84AuP2QcUQntBbxurXQ4SfWiKNZ32m
 P5aLmSUOCMqPjAr7Z1CWlQZ9VjO4fJaZKGso8a8rpV+skfAZ6tZKOlOyP4Mss80WtLGl
 TMyw==
X-Forwarded-Encrypted: i=1;
 AJvYcCXPzR4NvMj5XJJIHTpr3P51P5ZgKT/fWkzJayY06EQ1oLIdYCoqtIFrGInCgCEnqNHPMyePeQ==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YzpAMtVMofEuKMDP0NiZhBr6Qwooxtbd32t4vi1VdIIPCKW+WFZ
 qA4OjApv9CwbUXzCE+rvneIwABCgBIazJHwbDRhYvekKk62C8e59llDAhN/ISyYvy84MAstdN6j
 YkL5XrcWXp7SoYoaqRcxb6mvaBdufxIdb3+w=
X-Gm-Gg: ASbGnctmYWvrnu6ozZJBErn37R0ggIRzZJdllLSNwgKUj1kwPTqNRa9SwnbD6rjnX2I
 sViqDwjvFqT+NmhtuE9trgt7WG0TXJ0RfUJgsO1qGYSdUUCX2uwQEqhoEm0kED1Y9PJKM9YCpIP
 i+NCTioLfzloX1f0TTiNsIOgUCVQ==
X-Google-Smtp-Source: AGHT+IGWO7pD0brq7+H8i9rE4wmdDn56wl5aVeWVBW6NgwW+Tvwrtb4ubNIWA8w4hwkjxywz6yPmNqoBCL0Q8PKh7ZQ=
X-Received: by 2002:a05:6402:3482:b0:5e4:cfb0:f66b with SMTP id
 4fb4d7f45d1cf-5e4d6acd48fmr10875425a12.7.1740886869359; Sat, 01 Mar 2025
 19:41:09 -0800 (PST)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Sat, 1 Mar 2025 19:41:08 -0800
From: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <jwvv7tc5gei.fsf-monnier+emacs@HIDDEN>
References: <87leci1nf7.fsf@HIDDEN> <jwvv7tc5gei.fsf-monnier+emacs@HIDDEN>
MIME-Version: 1.0
Date: Sat, 1 Mar 2025 19:41:08 -0800
X-Gm-Features: AQ5f1JodQ5A8ABZxRGhe9EQapWsgG9r7gy-x5q2ie6vwbKA5v9qvZN4-L2ut4Qw
Message-ID: <CADwFkmkp1W14n8DAgQ=QCZQfctPfe9uNidjTshXUkyp4-s7GvQ@HIDDEN>
Subject: Re: bug#66342: Quote cl-generic-current-method-specializers
To: Stefan Monnier <monnier@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 66342
Cc: 66342 <at> debbugs.gnu.org, Thuna <thuna.cing@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Stefan Monnier <monnier@HIDDEN> writes:

> Hi,
>
>> Currently, cl-generic-current-method-specializers expands into an alist
>> of the form ((ARG . TYPE)...).  The patch I provide quotes this so that
>> it can serve as a proper sexp.
>
> Interesting.  Out of curiosity, where/how did you bump into this?
>
>> Without quoting, this expansion is a bad sexp that, when evaluated,
>> results in an error.
>
> Indeed, it was never meant to be inserted as-is in the macro-expanded
> code, instead the idea was that a macro could use
>
>     (macroexpand '(cl-generic-current-method-specializers)
>                  macroexpand-all-environment)
>
> to collect type information about the variables to decide how to
> generate its code.  This was not very well thought out (e.g. this typing
> information may be invalid if the method mutates those vars) and AFAIK
> it's never been used anywhere.
>
> Maybe it's best to get rid of it?

If it's not useful, and anyways not used by anyone, I think it's better
to get rid of it.

Thuna, would you like to propose a patch that does that?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#66342; Package emacs. Full text available.
Added tag(s) moreinfo. Request was from Stefan Kangas <stefankangas@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 66342 <at> debbugs.gnu.org:


Received: (at 66342) by debbugs.gnu.org; 14 Feb 2025 22:16:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 14 17:16:53 2025
Received: from localhost ([127.0.0.1]:52143 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tj3zR-0006Xm-E0
	for submit <at> debbugs.gnu.org; Fri, 14 Feb 2025 17:16:53 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:53940)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <monnier@HIDDEN>)
 id 1tj3zN-0006XT-VQ
 for 66342 <at> debbugs.gnu.org; Fri, 14 Feb 2025 17:16:50 -0500
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id F2AE580964;
 Fri, 14 Feb 2025 17:16:43 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1739571403;
 bh=002Hns07dalZ3w9QfBl9dbfFV4C0i0ywmeXjtXB3eQ8=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=orPM1wjV8K0Jdx0LH5/Rg1Iww0SlMFok/TlubGkvcim+cUYqPQuOTOqz0NFR/0tGG
 xBCNCSgKUDxxDyJhunq0/FLOrqV6yk08tqQ5D4Ae7/Opib9Q3Jn/gVCIPyZMqco1qx
 kC9np8prUKlzu3siRbEEB9igvsUTAwbmOfW4jBCQmuJf0GOyOeAzCQHk7HURezZ5IQ
 zhHv+l7suK0qCz/0LtSL7WtnumY/GyVlVgV2famWDN0+zfKwPWvPsJgcM9EOjiDqD0
 cnqiOjr1KUdfZZWFxHKBrda6Qp0VY/uQ8J9ndYn+Jb6nCQqUdX/YmoLFUm6RBwFGUo
 Jp0ljlrLDQqfw==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 33505801C2;
 Fri, 14 Feb 2025 17:16:43 -0500 (EST)
Received: from pastel (unknown [104.247.242.5])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id D2224120317;
 Fri, 14 Feb 2025 17:16:42 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Thuna <thuna.cing@HIDDEN>
Subject: Re: bug#66342: Quote cl-generic-current-method-specializers
In-Reply-To: <87leci1nf7.fsf@HIDDEN> (Thuna's message of "Wed, 04 Oct 2023
 16:18:20 +0200")
Message-ID: <jwvv7tc5gei.fsf-monnier+emacs@HIDDEN>
References: <87leci1nf7.fsf@HIDDEN>
Date: Fri, 14 Feb 2025 17:16:40 -0500
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.275 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: 66342
Cc: 66342 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi,

> Currently, cl-generic-current-method-specializers expands into an alist
> of the form ((ARG . TYPE)...).  The patch I provide quotes this so that
> it can serve as a proper sexp.

Interesting.  Out of curiosity, where/how did you bump into this?

> Without quoting, this expansion is a bad sexp that, when evaluated,
> results in an error.

Indeed, it was never meant to be inserted as-is in the macro-expanded
code, instead the idea was that a macro could use

    (macroexpand '(cl-generic-current-method-specializers)
                 macroexpand-all-environment)

to collect type information about the variables to decide how to
generate its code.  This was not very well thought out (e.g. this typing
information may be invalid if the method mutates those vars) and AFAIK
it's never been used anywhere.

Maybe it's best to get rid of it?


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#66342; Package emacs. Full text available.

Message received at 66342 <at> debbugs.gnu.org:


Received: (at 66342) by debbugs.gnu.org; 12 Feb 2025 04:17:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 11 23:17:38 2025
Received: from localhost ([127.0.0.1]:60125 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ti4Bu-0004dc-DE
	for submit <at> debbugs.gnu.org; Tue, 11 Feb 2025 23:17:38 -0500
Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]:59754)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>)
 id 1ti4Br-0004dE-8C
 for 66342 <at> debbugs.gnu.org; Tue, 11 Feb 2025 23:17:35 -0500
Received: by mail-ed1-x52d.google.com with SMTP id
 4fb4d7f45d1cf-5de6ff9643fso6005305a12.3
 for <66342 <at> debbugs.gnu.org>; Tue, 11 Feb 2025 20:17:35 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1739333849; x=1739938649; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:mime-version:references:in-reply-to
 :from:from:to:cc:subject:date:message-id:reply-to;
 bh=J13qqfBL2VPJcPL2pmw7+XK29mXSZsQT/GUd3zifOrY=;
 b=GwwIfFCibQfU7Y/6AvpQ7tPjDsI6VmONGiKVGkMyUNhepI6PX96vl9lAT4glyHxbIF
 OeCDf65WSCEkkUAjkSnsXDhkXp2vWW1JQd0bQk437cXoMmITJbXRSRUuHlq84NoCU/O/
 QC83eR8OQAgYwdt0BmOZx9xwji8cEduylokl7IDirPyg6urLPdQChxm/5rv5DnrrinVR
 z5F3VCVwTpAqZUvha5rtaZfYeINFKT8jqH1DLzZBaLa588We/6mnmGOomCKyDBFp2oo3
 M+fYfQqCOC/EHVaUYUy9vK4rtlJlPk9z/vXlMUaw9wij8QBc158L4tAm1gISUSDivUeo
 lUeA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1739333849; x=1739938649;
 h=cc:to:subject:message-id:date:mime-version:references:in-reply-to
 :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=J13qqfBL2VPJcPL2pmw7+XK29mXSZsQT/GUd3zifOrY=;
 b=DxfeCZL1eJ4Xh1XIfsJ3Ffi0fRKXhvTVo1qyz9pJ7Si7Bd2KTzZ5gMAPjecm5Yzku7
 0TAlw9gPS0VJtrHnP2D9FBKgYu2Ovv6wjMgFvz1HM6levW41ShQkqTD3HQkLtJ2pVYXE
 r+2Qg5Vk2DIdizssyZnRwghM84A4OyPDo/oMo1STIrkftoOir5K3ayMk7eH+o6r+hajT
 22dFhr53y0jIp9SwwxNFl0P49Nn8EpypLhAmKr1bbQ7KH6wFK+E1DBKiovDz0rI4YDhG
 0VLpUC4SWn8QHzdCRggLOIly82gX/K23opc0ZHxlyRJEL69GRNNALw9VCNJFhqg96Ki5
 10ZQ==
X-Gm-Message-State: AOJu0YwW8UxTAPFuYtr3OCsUh+90A7PbiPxyA2Ft/iADfwT+5W4xcw6K
 313pUYU9+rYFR152z1hSlptHrekiUPKYGEbCh1P0V/pkvo9jDAwgfrCJGASgi3CiKETE9woIDbj
 CVgSdsRBWDfcOmG5vMibFUDhxM9I=
X-Gm-Gg: ASbGncvrG4XSlupv8+rZohSEscSFktd2rbUWfqkUTq/BAGhcwN0aFrRJ4rYLNbJAdbd
 OIzV2dYAalZ52ECQn4CIjcJAeBbDK7cdiC1u7EPGci8Jxm2xMlOBMrXAc/KW/EWkAa/eLYSfu
X-Google-Smtp-Source: AGHT+IFzclwKYjuNJprp5DE7N63ctvKqlrbZ9TOGnhG0Habk3/5uqEpsJcUf70Fdg1LGH1L2ENOC+e5KVojC7EHnOcY=
X-Received: by 2002:a05:6402:2087:b0:5db:68ce:2125 with SMTP id
 4fb4d7f45d1cf-5deadd9c6c1mr1273762a12.14.1739333849048; Tue, 11 Feb 2025
 20:17:29 -0800 (PST)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Tue, 11 Feb 2025 20:17:28 -0800
From: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <87leci1nf7.fsf@HIDDEN>
References: <87leci1nf7.fsf@HIDDEN>
MIME-Version: 1.0
Date: Tue, 11 Feb 2025 20:17:28 -0800
X-Gm-Features: AWEUYZl0cDj-1OjwiHzEEil8cKkCz8tFxmbLTladoxOKudd5wmutNwP_Nwb0SYg
Message-ID: <CADwFkm=NVRU4kdKietBtJDX4Rwxh6tRu1c=zwgWccysN7KbO5g@HIDDEN>
Subject: Re: bug#66342: Quote cl-generic-current-method-specializers
To: Thuna <thuna.cing@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 66342
Cc: Stefan Monnier <monnier@HIDDEN>, 66342 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Thuna <thuna.cing@HIDDEN> writes:

> Currently, cl-generic-current-method-specializers expands into an alist
> of the form ((ARG . TYPE)...).  The patch I provide quotes this so that
> it can serve as a proper sexp.
>
> Without quoting, this expansion is a bad sexp that, when evaluated,
> results in an error.  If quoted, the form will simply not macroexpand,
> and any other method causes it to be evaluated after expanding.  As it
> relies on the cl-defmethod's context, I see no obvious and/or convenient
> ways to use macroexpand to get the result unevaluated.
>
> A quick grep brought up no uses of this macro, so I feel that this
> change shouldn't effect many people, if any at all, although feel free
> to correct me if this is not the case.
>

Stefan M, could you please take a look at this patch?

>
> From a5b3065b8db59570cd98e8799c0ba0b0c46b9d6f Mon Sep 17 00:00:00 2001
> From: Thuna <thuna.cing@HIDDEN> Date: Sun, 1 Oct 2023 21:15:29
> +0200 Subject: [PATCH] Quote cl-generic-current-method-specializers
> inside method body
>
> * lisp/emacs-lisp/cl-generic.el (cl--generic-lambda): Quote spec-args
> when using cl-generic-current-method-specializers inside a method
> body.
> ---
>  lisp/emacs-lisp/cl-generic.el | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el
> index dec14bd5df6..a938195f097 100644
> --- a/lisp/emacs-lisp/cl-generic.el
> +++ b/lisp/emacs-lisp/cl-generic.el
> @@ -393,7 +393,7 @@ cl-generic-define-context-rewriter
>                    (cl--generic-split-args args))
>                   (fun `(cl-function (lambda ,plain-args ,@body)))
>                   (macroenv (cons `(cl-generic-current-method-specializers
> -                                   . ,(lambda () spec-args))
> +                                   . ,(lambda () (list 'quote spec-args)))
>                                   macroexpand-all-environment)))
>        (require 'cl-lib)        ;Needed to expand `cl-flet' and `cl-function'.
>        (when (assq 'interactive body)




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#66342; Package emacs. Full text available.
Added tag(s) patch. Request was from Stefan Kangas <stefankangas@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 4 Oct 2023 14:19:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 04 10:19:06 2023
Received: from localhost ([127.0.0.1]:45087 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qo2iQ-0002Y1-8x
	for submit <at> debbugs.gnu.org; Wed, 04 Oct 2023 10:19:06 -0400
Received: from lists.gnu.org ([2001:470:142::17]:43644)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <thuna.cing@HIDDEN>) id 1qo2iN-0002XR-6t
 for submit <at> debbugs.gnu.org; Wed, 04 Oct 2023 10:19:04 -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 <thuna.cing@HIDDEN>)
 id 1qo2hz-0005qF-SI
 for bug-gnu-emacs@HIDDEN; Wed, 04 Oct 2023 10:18:39 -0400
Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <thuna.cing@HIDDEN>)
 id 1qo2hn-0005Pq-Fd
 for bug-gnu-emacs@HIDDEN; Wed, 04 Oct 2023 10:18:32 -0400
Received: by mail-wr1-x431.google.com with SMTP id
 ffacd0b85a97d-32487efc319so2175826f8f.1
 for <bug-gnu-emacs@HIDDEN>; Wed, 04 Oct 2023 07:18:24 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1696429103; x=1697033903; darn=gnu.org;
 h=mime-version:message-id:date:subject:to:from:from:to:cc:subject
 :date:message-id:reply-to;
 bh=rcP5KpbGStOpdqvgLQx6g47+cesEe1o3XGGEZZke+tg=;
 b=JjsqNn36WBhrHttfeD3VNNpCGPVaYQjsPC4XcTWuwNGlUm5PiJTeYftat/v+Leev0d
 j3IJ2W/FEyyo1PAg/lmEyWJRlVqTB4++gP+rQ8oBO1EUAnBjHfYxFlOGwUwASPLVErcG
 lpLdJkV5MAbIUcIvYv46PoOY+y11BkwWsO28AafGXicVcpRzCiS/kcpTjUdXejaG0qM0
 4+cCInU1SjQdlcXBBoaGQE9wRQnroeW+ZEtXQSmuPVlrkk2YiKEyncVWSI/w+HLbMu3X
 2NCLlx9HD4Squ7vsh5p0UIkiBHgjt8q/XNah9nZRdetuzlmNKE/2f/os0F73YyX1eZf5
 0uIw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1696429103; x=1697033903;
 h=mime-version:message-id:date:subject:to:from:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=rcP5KpbGStOpdqvgLQx6g47+cesEe1o3XGGEZZke+tg=;
 b=P+OsP7Sp3yH8nw2AgrIKD6O49lqG/sDtt+oLLl7JlAMbdA0Y6sJkVNUeF93m8TIOJ8
 4CpeiwVKF3L9OEGzaVTmB30XC/BujxeBDxMgM0j2q9jKxSRL2yRuPWbPskD6vs1px/7/
 kI9tvPYsGa+s4AQWyhaiA6irR2gNy+++M8rm/GyIZk9idg56IYn0B5j/fbOZBj9AnPtQ
 Y8pIXkGLuIJeOQrr7oymYXjw7mQyL0zYMEEb8qZEpGqwCvJp57Z7+ILm5k3XQiAbvrjr
 JKytntpIcUU9obpDAuQVgIK//TjcxisWZqHky/kfqIz2zJzWxgUKwq7cSRFctclOmtim
 IdaA==
X-Gm-Message-State: AOJu0Yy+2X6NKDS/rR5HeeQSLDxNLCQUsIsT1X1l5/ukz+dUazOZCogQ
 DHQvsSt1XDjlqO+9U0N+xfWzlAGQpCo=
X-Google-Smtp-Source: AGHT+IFUtVek5tgtWlacoPSjhiiuELWwNn7jJj9sbvKs86I/0MWelaR0mimo7Vzhfl3axOb6Ky338w==
X-Received: by 2002:a5d:458f:0:b0:321:6ff5:9256 with SMTP id
 p15-20020a5d458f000000b003216ff59256mr1954408wrq.58.1696429101786; 
 Wed, 04 Oct 2023 07:18:21 -0700 (PDT)
Received: from thuna ([90.147.71.75]) by smtp.gmail.com with ESMTPSA id
 z17-20020a5d4d11000000b0032485046055sm4155178wrt.5.2023.10.04.07.18.21
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 04 Oct 2023 07:18:21 -0700 (PDT)
From: Thuna <thuna.cing@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: Quote cl-generic-current-method-specializers
Date: Wed, 04 Oct 2023 16:18:20 +0200
Message-ID: <87leci1nf7.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=2a00:1450:4864:20::431;
 envelope-from=thuna.cing@HIDDEN; helo=mail-wr1-x431.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

--=-=-=
Content-Type: text/plain

Currently, cl-generic-current-method-specializers expands into an alist
of the form ((ARG . TYPE)...).  The patch I provide quotes this so that
it can serve as a proper sexp.

Without quoting, this expansion is a bad sexp that, when evaluated,
results in an error.  If quoted, the form will simply not macroexpand,
and any other method causes it to be evaluated after expanding.  As it
relies on the cl-defmethod's context, I see no obvious and/or convenient
ways to use macroexpand to get the result unevaluated.

A quick grep brought up no uses of this macro, so I feel that this
change shouldn't effect many people, if any at all, although feel free
to correct me if this is not the case.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-Quote-cl-generic-current-method-specializers-inside-.patch
Content-Description: The patch

From a5b3065b8db59570cd98e8799c0ba0b0c46b9d6f Mon Sep 17 00:00:00 2001
From: Thuna <thuna.cing@HIDDEN>
Date: Sun, 1 Oct 2023 21:15:29 +0200
Subject: [PATCH] Quote cl-generic-current-method-specializers inside method
 body

* lisp/emacs-lisp/cl-generic.el (cl--generic-lambda): Quote spec-args
when using cl-generic-current-method-specializers inside a method
body.
---
 lisp/emacs-lisp/cl-generic.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el
index dec14bd5df6..a938195f097 100644
--- a/lisp/emacs-lisp/cl-generic.el
+++ b/lisp/emacs-lisp/cl-generic.el
@@ -393,7 +393,7 @@ cl-generic-define-context-rewriter
                   (cl--generic-split-args args))
                  (fun `(cl-function (lambda ,plain-args ,@body)))
                  (macroenv (cons `(cl-generic-current-method-specializers
-                                   . ,(lambda () spec-args))
+                                   . ,(lambda () (list 'quote spec-args)))
                                  macroexpand-all-environment)))
       (require 'cl-lib)        ;Needed to expand `cl-flet' and `cl-function'.
       (when (assq 'interactive body)
-- 
2.39.3


--=-=-=--




Acknowledgement sent to Thuna <thuna.cing@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#66342; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 4 Mar 2025 22:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.