From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Mendler Newsgroups: gmane.emacs.bugs Subject: bug#63513: [PATCH] Make persist-defvar work with records and hash tables Date: Sat, 9 Sep 2023 12:15:31 +0200 Message-ID: <80479897-500e-fe60-6586-0a44ccb5993b@daniel-mendler.de> References: <87wn1axgh6.fsf@breatheoutbreathe.in> <83jzx925lv.fsf@gnu.org> <87a5xubwoo.fsf@breatheoutbreathe.in> <87v8csku60.fsf@breatheoutbreathe.in> <83cyyz94c6.fsf@gnu.org> <87a5u2ydzg.fsf@breatheoutbreathe.in> <83msy25g0s.fsf@gnu.org> <624CBB7F-1442-400D-8D4D-1B26EBE9DACB@breatheoutbreathe.in> <877cp5bmig.fsf@breatheoutbreathe.in> <871qvz4kdw.fsf@localhost> <8734zoaolv.fsf@localhost> <87fs3o8uil.fsf@localhost> <87msxwa8kd.fsf@breatheoutbreathe.in> <87il8j7ji9.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="774"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Adam Porter , Eli Zaretskii , 63513-done@debbugs.gnu.org, Stefan Monnier , phillip.lord@russet.org.uk To: Ihor Radchenko , Joseph Turner Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 09 12:16:26 2023 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 1qev0q-000AVz-Ej for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 09 Sep 2023 12:16:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qev0U-0002oZ-GC; Sat, 09 Sep 2023 06:16:02 -0400 Original-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 1qev0R-0002oH-3a for bug-gnu-emacs@gnu.org; Sat, 09 Sep 2023 06:15:59 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qev0Q-0001ow-SW for bug-gnu-emacs@gnu.org; Sat, 09 Sep 2023 06:15:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qev0T-0002dG-JG for bug-gnu-emacs@gnu.org; Sat, 09 Sep 2023 06:16:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Mendler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Sep 2023 10:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63513 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 63513-done@debbugs.gnu.org id=D63513.169425455710108 (code D ref 63513); Sat, 09 Sep 2023 10:16:01 +0000 Original-Received: (at 63513-done) by debbugs.gnu.org; 9 Sep 2023 10:15:57 +0000 Original-Received: from localhost ([127.0.0.1]:46179 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qev0O-0002cx-Su for submit@debbugs.gnu.org; Sat, 09 Sep 2023 06:15:57 -0400 Original-Received: from server.qxqx.de ([2a01:4f8:121:346::180]:49937 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qev0J-0002ch-NA for 63513-done@debbugs.gnu.org; Sat, 09 Sep 2023 06:15:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=qxqx.de; s=mail1392553390; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Iqa9ChEwncVV2n87uiy0ol2ablJYDUEjr7pQcQu7IFg=; b=IC6AeTs09LKff9j0IAPU2GVWj/ SOvqZDI61FiS0JVb46bT64UG8JoSz5z2gR9Xe52xN9XsiABa76BorDrZvPQ6EzuAmtbMslxTnq9Qy r6b2nXkOaSvKvXJvUXedcylNc4FyZOUNIhLy1Vwl4HA2IM66hMgu1SxZs93iw7LIzXEw=; Content-Language: en-US In-Reply-To: <87il8j7ji9.fsf@localhost> 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:269845 Archived-At: On 9/9/23 12:01, Ihor Radchenko wrote: > Joseph Turner writes: > >>> Then, wouldn't it be better to contribute this function to compat.el and >>> use it from there? >> >> The new behavior of copy-tree has already been added to compat.el: >> >> https://github.com/emacs-compat/compat/pull/25 >> >> However, that change currently only exists in compat's emacs-30 branch. > > I see. > >> I did not know if it was acceptable for persist.el to require compat >> when I wrote these patches. If we agree that it is acceptable, then I'm >> happy to submit a patch to replace (persist-copy-tree ...) with >> (compat-call copy-tree ...), but we'll have to wait to apply the patch >> until after the compat.el emacs-30 branch is merged into master. > > AFAIU, the recommended way to implement compat function definitions that > are not yet added to compat.el is using `compat-defun' + `compat-call'. > Then, one can simply drop `compat-defun' after the function is finally > release with compat.el without touching the rest of the code. `compat-call` is meant to be used to call "extended functions", for example functions with additional arguments. See the Compat manual for details. The macros from compat-macs.el (`compat-defun` etc.) are internal as documented in the file compat-macs.el. These macros must not be used outside Compat. So using Compat here has to wait until compat-30.x is released. Daniel