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 13:18:05 -0700 Message-ID: <87po38gmma.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> <87muycibgv.fsf@ericabrahamsen.net> <87vad06tin.fsf@web.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1523305170 30086 195.159.176.226 (9 Apr 2018 20:19:30 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 9 Apr 2018 20:19:30 +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 22:19:26 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 1f5dG8-0007fl-3x for geh-help-gnu-emacs@m.gmane.org; Mon, 09 Apr 2018 22:19:24 +0200 Original-Received: from localhost ([::1]:36135 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5dID-0003uq-VI for geh-help-gnu-emacs@m.gmane.org; Mon, 09 Apr 2018 16:21:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60201) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5dHZ-0003sT-97 for help-gnu-emacs@gnu.org; Mon, 09 Apr 2018 16:20:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f5dHU-00012f-5e for help-gnu-emacs@gnu.org; Mon, 09 Apr 2018 16:20:53 -0400 Original-Received: from [195.159.176.226] (port=35691 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f5dHT-000121-Uj for help-gnu-emacs@gnu.org; Mon, 09 Apr 2018 16:20:48 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1f5dFJ-0006iM-HL for help-gnu-emacs@gnu.org; Mon, 09 Apr 2018 22:18:33 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 56 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:BWllseXz72ttWotitBDUyTBBrhE= 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:116428 Archived-At: Michael Heerdegen writes: > Eric Abrahamsen writes: > >> > 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 > ^^^^^ > listp > > Sorry, that was a typo. > >> You mean values like '(bob)? This seems to work okay: > > No, I mean something that is not a regular list like (bob . alice), or > an alist with atomic values, like > > ((a . 1) (b . 2)) > > Haven't tried it, though. The same test code switching '(bob) to '(bob . alice) also works just fine. But do keep in mind that I'm not trying to find more bugs in the current implementation -- there are all kinds of values that won't work correctly. All I'm trying to do with the current version is get it balanced between writing and restoring. The next step is to toss it out completely and write something simpler. The process as I'd like to have it looks more like (with code for backwards compatibility removed): (defun eieio-persistent-fix-value (value) (let (result) (when (consp value) (if (class-p (car value)) (setq result (eieio-persistent-make-instance (car value) (cdr value)) value nil) (while (consp value) (push (eieio-persistent-fix-value (car value)) result) (setq value (cdr value))))) (if (eieio-object-p result) result (nconc (nreverse result) (if (stringp value) (substring-no-properties value) value))))) That should be all that's needed. One of the discussions now is whether it's okay to just check (class-p (car value)), or whether there should be a more explicit flag saying "this list should actually be turned into an object". Eric