From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.bugs Subject: bug#57397: 29.0.50; cl-letf blindly macroexpands places Date: Thu, 25 Aug 2022 06:42:17 +0200 Message-ID: <877d2xdjdi.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36390"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen , Stefan Monnier To: 57397@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 25 06:43:13 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oR4i1-0009KT-CP for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 25 Aug 2022 06:43:13 +0200 Original-Received: from localhost ([::1]:58294 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oR4i0-0005As-2g for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 25 Aug 2022 00:43:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47446) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oR4hr-0005AV-68 for bug-gnu-emacs@gnu.org; Thu, 25 Aug 2022 00:43:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58832) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oR4hq-0000u6-TC for bug-gnu-emacs@gnu.org; Thu, 25 Aug 2022 00:43:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oR4hq-0003r0-JW for bug-gnu-emacs@gnu.org; Thu, 25 Aug 2022 00:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 Aug 2022 04:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 57397 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.166140255414756 (code B ref -1); Thu, 25 Aug 2022 04:43:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 25 Aug 2022 04:42:34 +0000 Original-Received: from localhost ([127.0.0.1]:48581 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oR4hO-0003pv-Cj for submit@debbugs.gnu.org; Thu, 25 Aug 2022 00:42:34 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:43838) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oR4hJ-0003ph-QK for submit@debbugs.gnu.org; Thu, 25 Aug 2022 00:42:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41586) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oR4hJ-00058h-Ko for bug-gnu-emacs@gnu.org; Thu, 25 Aug 2022 00:42:29 -0400 Original-Received: from mout.web.de ([212.227.15.4]:36603) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oR4hH-0000p1-Q6 for bug-gnu-emacs@gnu.org; Thu, 25 Aug 2022 00:42:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1661402539; bh=ePGmqdGY6nvtUbLIkgDCu8ftZ8L7AtlXgUhZj7JdA5w=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=JdKNP1p7eqyPe70NHew1yWE1+GucXtEXistyeErrqxDYIrpVsU/UoA/flDYc75+Lm bLEOlwvft3VWMbNalSQIC5N8n1cVTFSsmUxxT9NdEY9uDd7ODLW8J0TzSFoddoZwhP o07DLXxaI1qGnYT+XISvGeIDOQ0btQRq+qqvTrkg= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Original-Received: from drachen.dragon ([84.57.248.18]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1Mgzeb-1p5sUp3kSr-00h13b; Thu, 25 Aug 2022 06:42:18 +0200 X-Provags-ID: V03:K1:Nuf46WKUER64AlBNRmKTJDtSPElXgDcUind2qlBRLXqx3tv17J1 B1WnzeE3jEqJZX896GZ3AbFNkW/iSau3twG9z6pfZnbVDPajkmF8Y8FcPGIuo6/vO/B/YfE sJ3wfiKRJisLkNfnpyfUwbs7DOFQEdMzy/qWVuRVXU7IvJTrYBjHFaWDtT4xiEoHKZ1fsdT 2AReSVjHGNZ5zELPy7IiA== X-UI-Out-Filterresults: notjunk:1;V03:K0:RTYroL8rGWc=:kxyejes7JF/o+MQSYZitHI 6ZLhKqYqqmNDdamMaXoCIU7Xj7ANW4UMxMR1x9lx8fVhgWwJnz1FYKpW3GVAT2q5J33b6ELY4 cKOe3q29yGvhL3//KOA4HJ4PoUvpm9MfOQ7Bt4PCimKgm7pG6UOBbF+4Ggx1sIS8Jp/tnrQ7E NouKRI4AVLxzOo9ypswXtd+KAfzwDfC7to7Jz56UUFhTfLPbxMTY645HhBgMFJTZHOQ9dzD0k PoR8wcbRUfSVBnGtnQmQgzmyiPWC3Kg+sf0GCvUR/NuM2eaHOmb3NQvl3Wei9keCHy0sezJj8 tPd1F89HxOq8ayRrqnhNaKMJ/SMHpSRLHB7gE65pH1mZudcHp9aUCdJkolV8iXzuzLx643UiU 8svEOA1OqYFY+g09Q+g2O0+IO6FMiSSdvAF+nEygvbzzd80lWbbN9RWPimhI5AA28+8rmRmjW Mhgw1G0j6oqEoOshBXyJcsocl6VsKzTa0mfudupE6RKWdCX6cSFrKha4TnZ9GLnsqhGuwplRJ WW0hbAgakPr5PpjXVeOotxY8xpihXLTOQ/GtYn0dNYasgEdeiK9V6+mFtoU2biwTiFuJ4Lmwn maIX8kMqgtCNTwB4SU1rZgV3+eIofUUb5cqsAuNePmHrmt9xk/G+jKwtmGehNpePy/kRbo6FT zYV0heUNN8x/9CaTeog9LyS8uOpRIf3flzQ+Bpp+vS82ryVJR4b0va1ycwrvQwUeFfINpVtI0 aL3DD1D60JSdVuIFfGvFz0u9F7L5SNpZ+0FbF1enItB7i9RnuqjJ5Mj1XrIf9HbAQ5K29V8f Received-SPF: pass client-ip=212.227.15.4; envelope-from=michael_heerdegen@web.de; helo=mout.web.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:240681 Archived-At: Hello, background: to get rid of warnings about the recently obsoleted generalized variables in my init file... because I'm lazy and wanted to try (and there were only two) I blindly replaced them with synthetic places - like this: #+begin_src emacs-lisp (defun test1 (b query) (cl-letf (((buffer-local-value 'buffer-save-without-query b) (or buffer-save-without-query query))) (with-current-buffer b (save-buffer)))) ;; ~~> (defun test2 (b query) (cl-letf (((gv-synthetic-place (buffer-local-value 'buffer-save-without-query b) (lambda (v) `(setq-local buffer-save-without-query ,v))) (or buffer-save-without-query query))) (with-current-buffer b (save-buffer)))) #+end_src [ I know it is an nonsense example wrt what it does and how it does it, that doesn't matter. ] This should get rid of the warning - but in this case it doesn't (in the other it did). The reason is that Stefan made cl-letf (the helper cl--letf more precisely), macroexpand each place: | 91a7f934ac * lisp/emacs-lisp/cl-macs.el: Fix bug#26073. to support symbol macros better: #+begin_src emacs-lisp (defun cl--letf (bindings simplebinds binds body) ;; It's not quite clear what the semantics of cl-letf should be...10.. (if (null bindings) (if (and (null binds) (null simplebinds)) (macroexp-progn body)..20..) (let* ((binding (car bindings)) (place (macroexpand (car binding) macroexpand-all-environment)));<--!! (gv-letplace (getter setter) place..12..)))) #+end_src I think this is an error in the general case. Maybe it's enough to expand only symbol macros? It's at least always wrong when (car PLACE) is a macro name with a gv spec defined. TIA, Michael. In GNU Emacs 29.0.50 (build 2, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw scroll bars) of 2022-08-25 built on drachen Repository revision: bd5b704447ac5ec0559a824209bb01b271d29959 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 System Description: Debian GNU/Linux 11 (bullseye) Configured using: 'configure --with-x-toolkit=lucid'