help-gnu-emacs
[Top][All Lists]
Advanced

[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: Michael Heerdegen
Subject: Re: Any way to control which articles Gnus summary shows by default?
Date: Tue, 10 Apr 2018 14:15:37 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> 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)))))

There must be something missing: VALUEs that are not consp are never
handled by this.

A minor problem with that approach is that `eieio-persistent-fix-value'
(I would rather call it "eieio-persistent-restore-value") can't
distinguish between objects and data that looks like an object.

Say the object write part converts some OBJECT to some list
REPRESENTATION.  Now it may occur that the user wants to save some data
that by accident is a list that looks like REPRESENTATION.  When the
saved data is to be restored, there is no mean to decide whether what
has been save was the OBJECT or a the list REPRESENTATION.  With other
words, there is a problem if the object-write function is not injective.
One can use special names so that collisions are less likely to happen,
but who knows in which ways people will use this stuff in the future.

Solving that problem would imply that lists are not represented by
themselves when saving.


Michael.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]