[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Any way to control which articles Gnus summary shows by default?
From: |
Eric Abrahamsen |
Subject: |
Re: Any way to control which articles Gnus summary shows by default? |
Date: |
Mon, 09 Apr 2018 13:18:05 -0700 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Michael Heerdegen <michael_heerdegen@web.de> writes:
> Eric Abrahamsen <eric@ericabrahamsen.net> 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
- Re: Any way to control which articles Gnus summary shows by default?, (continued)
- Re: Any way to control which articles Gnus summary shows by default?, Michael Heerdegen, 2018/04/07
- Re: Any way to control which articles Gnus summary shows by default?, Michael Heerdegen, 2018/04/08
- Re: Any way to control which articles Gnus summary shows by default?, Eric Abrahamsen, 2018/04/08
- Re: Any way to control which articles Gnus summary shows by default?, Michael Heerdegen, 2018/04/08
- Re: Any way to control which articles Gnus summary shows by default?, Eric Abrahamsen, 2018/04/08
- Re: Any way to control which articles Gnus summary shows by default?, Eric Abrahamsen, 2018/04/08
- Re: Any way to control which articles Gnus summary shows by default?, Eric Abrahamsen, 2018/04/08
- Re: Any way to control which articles Gnus summary shows by default?, Michael Heerdegen, 2018/04/09
- Re: Any way to control which articles Gnus summary shows by default?, Eric Abrahamsen, 2018/04/09
- Re: Any way to control which articles Gnus summary shows by default?, Michael Heerdegen, 2018/04/09
- Re: Any way to control which articles Gnus summary shows by default?,
Eric Abrahamsen <=
- Re: Any way to control which articles Gnus summary shows by default?, Michael Heerdegen, 2018/04/10
- Re: Any way to control which articles Gnus summary shows by default?, Eric Abrahamsen, 2018/04/10
- Re: Any way to control which articles Gnus summary shows by default?, Michael Heerdegen, 2018/04/10
- Re: Any way to control which articles Gnus summary shows by default?, Eric Abrahamsen, 2018/04/10
- Re: Any way to control which articles Gnus summary shows by default?, Michael Heerdegen, 2018/04/11
- Message not available
- Re: Any way to control which articles Gnus summary shows by default?, Emanuel Berg, 2018/04/04
- Re: Any way to control which articles Gnus summary shows by default?, Eric Abrahamsen, 2018/04/06
- Message not available
- Re: Any way to control which articles Gnus summary shows by default?, Emanuel Berg, 2018/04/04
- Re: Any way to control which articles Gnus summary shows by default?, Michael Heerdegen, 2018/04/04
- Message not available
- Re: Any way to control which articles Gnus summary shows by default?, Emanuel Berg, 2018/04/04