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: patch; dated Wed, 4 Oct 2023 14:20:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
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: Thu, 5 Oct 2023 22:00:02 UTC

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