all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: help-gnu-emacs@gnu.org
Subject: Re: Any way to control which articles Gnus summary shows by default?
Date: Mon, 09 Apr 2018 09:36:00 -0700	[thread overview]
Message-ID: <87muycibgv.fsf@ericabrahamsen.net> (raw)
In-Reply-To: 87k1tgtqny.fsf@web.de

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> 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




  reply	other threads:[~2018-04-09 16:36 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.11583.1522744082.27995.help-gnu-emacs@gnu.org>
2018-04-03 23:17 ` Any way to control which articles Gnus summary shows by default? Emanuel Berg
2018-04-03 23:28   ` Emanuel Berg
2018-04-04  7:00   ` Michael Heerdegen
2018-04-04  7:30     ` Eric Abrahamsen
2018-04-04 10:59       ` Michael Heerdegen
2018-04-04 11:31         ` Eric Abrahamsen
2018-04-04 14:41           ` Michael Heerdegen
2018-04-04 14:46             ` Michael Heerdegen
2018-04-06 14:52             ` Michael Heerdegen
2018-04-06 15:22               ` Eric Abrahamsen
2018-04-06 17:53                 ` Eric Abrahamsen
2018-04-06 18:06                   ` Eric Abrahamsen
2018-04-07  9:26                     ` Michael Heerdegen
2018-04-07 12:33                       ` Michael Heerdegen
2018-04-07  9:23                   ` Michael Heerdegen
2018-04-08 14:17                   ` Michael Heerdegen
2018-04-08 15:03                     ` Eric Abrahamsen
2018-04-08 15:46                       ` Michael Heerdegen
2018-04-08 16:57                         ` Eric Abrahamsen
2018-04-08 19:01                         ` Eric Abrahamsen
2018-04-08 23:59                           ` Eric Abrahamsen
2018-04-09 14:12                             ` Michael Heerdegen
2018-04-09 16:36                               ` Eric Abrahamsen [this message]
2018-04-09 19:59                                 ` Michael Heerdegen
2018-04-09 20:18                                   ` Eric Abrahamsen
2018-04-10 12:15                                     ` Michael Heerdegen
2018-04-10 16:27                                       ` Eric Abrahamsen
2018-04-10 20:12                                         ` Michael Heerdegen
2018-04-10 22:29                                           ` Eric Abrahamsen
2018-04-11 17:05                                             ` Michael Heerdegen
     [not found]     ` <mailman.11665.1522827199.27995.help-gnu-emacs@gnu.org>
2018-04-04 12:43       ` Emanuel Berg
2018-04-06 17:53         ` Eric Abrahamsen
2018-07-24  3:10       ` Robert Girault
     [not found]   ` <mailman.11664.1522825278.27995.help-gnu-emacs@gnu.org>
2018-04-04 12:51     ` Emanuel Berg
2018-04-04 14:33       ` Michael Heerdegen
     [not found]       ` <mailman.11689.1522852442.27995.help-gnu-emacs@gnu.org>
2018-04-04 14:48         ` Emanuel Berg
2018-04-03  8:27 Michael Heerdegen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87muycibgv.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.