From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.help Subject: Re: Any way to control which articles Gnus summary shows by default? Date: Mon, 09 Apr 2018 09:36:00 -0700 Message-ID: <87muycibgv.fsf@ericabrahamsen.net> References: <86lge3ric2.fsf@zoho.com> <87vad78nh2.fsf@web.de> <87sh8bsa2c.fsf@ericabrahamsen.net> <87in97jkzk.fsf@web.de> <87lge3ryvn.fsf@ericabrahamsen.net> <87sh8bm3u1.fsf@web.de> <874lkogzel.fsf@web.de> <87lge0pdfg.fsf@ericabrahamsen.net> <87efjsdxx0.fsf@ericabrahamsen.net> <87d0z9zss2.fsf@web.de> <87r2npoi40.fsf@ericabrahamsen.net> <878t9xzoot.fsf@web.de> <87woxhmsim.fsf@ericabrahamsen.net> <87h8olmer2.fsf@ericabrahamsen.net> <87k1tgtqny.fsf@web.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1523291838 27643 195.159.176.226 (9 Apr 2018 16:37:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 9 Apr 2018 16:37:18 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Apr 09 18:37:14 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f5Zn5-00072y-Cg for geh-help-gnu-emacs@m.gmane.org; Mon, 09 Apr 2018 18:37:11 +0200 Original-Received: from localhost ([::1]:51037 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5ZpB-0002ot-0V for geh-help-gnu-emacs@m.gmane.org; Mon, 09 Apr 2018 12:39:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40131) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5Zog-0002o9-M7 for help-gnu-emacs@gnu.org; Mon, 09 Apr 2018 12:38:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f5Zob-0007XS-KO for help-gnu-emacs@gnu.org; Mon, 09 Apr 2018 12:38:50 -0400 Original-Received: from [195.159.176.226] (port=51962 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f5Zob-0007Wa-Df for help-gnu-emacs@gnu.org; Mon, 09 Apr 2018 12:38:45 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1f5ZmQ-0006DX-8U for help-gnu-emacs@gnu.org; Mon, 09 Apr 2018 18:36:30 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 64 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:4hRvuYHZH/98RICQEvDGz5UVo6w= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:116420 Archived-At: Michael Heerdegen writes: > Eric Abrahamsen writes: > >> And the solution needs to be making the process equally recursive, >> because right now it's entirely possible that other packages could start >> using eieio-persistent with weird data structures, and fall afoul of >> this asymmetry. It's not just about quotes: if another package starts >> stashing EIEIO objects inside nested hash tables, they will be written >> correctly, but read incorrectly. > > I think I would make it so that what is written in the save file is an > expression that, when read _and_ evaluated, would return the recovered > object. The approach on the object-write side would not be much > different than now, but the restoring part would be trivial, so code > changes would become less problematic. Part of the principle of the thing is that `eval' is never called, as a nod to code safety. Object creation is the only actual code to run, and it should be done by feeding the serialization to EIEIO functions, rather than `eval'ling anything. >> My next stab at a fix is in the attached patch. Michael, assuming I >> haven't exhausted your patience, > > My patience here lasts as long as necessary, don't worry :-) That's good! >> would you mind giving this a try? I do believe this is the right >> solution, or at least the best minimal solution. > > So far this fixes quote accumulation completely for me - Great! I > didn't yet try to use the registry explicitly, so I can't say whether > your fix works correctly. Anyway - thanks so far! That's good to hear, though I've thought this was fixed a couple of times already, so I'm not celebrating yet! > FWIW, when I read the sources, I got the impression that all conses are > handled as if they were true lists. Trying to save conses whose cdr is > not consp will probably error, since the current code always seems to > try to iterate over list elements. You mean values like '(bob)? This seems to work okay: (defclass persist-test (eieio-persistent) ((slot1 :initarg :slot1 :type list))) (setq test (make-instance 'persist-test :file (concat user-emacs-directory "persist-test.dat") :slot1 '(bob))) (eieio-persistent-save test) (setq test2 (eieio-persistent-read (concat user-emacs-directory "persist-test.dat"))) (slot-value test2 'slot1) Did you mean something else? Eric