all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jean Louis <bugs@gnu.support>
To: Marcin Borkowski <mbork@mbork.pl>
Cc: Michael Heerdegen <michael_heerdegen@web.de>, help-gnu-emacs@gnu.org
Subject: Re: How to save custom variable programmatically?
Date: Wed, 11 Nov 2020 00:46:03 +0300	[thread overview]
Message-ID: <X6sKG2q/bLHZfH9W@protected.rcdrun.com> (raw)
In-Reply-To: <87wnytoses.fsf@mbork.pl>

* Marcin Borkowski <mbork@mbork.pl> [2020-11-10 23:42]:
> 
> On 2020-11-10, at 20:19, Jean Louis <bugs@gnu.support> wrote:
> 
> > * Michael Heerdegen <michael_heerdegen@web.de> [2020-11-10 17:36]:
> >> Jean Louis <bugs@gnu.support> writes:
> >> 
> >> > If there is anyway of storing data from Emacs that is standard I do
> >> > not know about it. Welcoming tips.
> >> 
> >> The eieio-persistent class is made for that purpose.
> >> 
> >> You make your data/database/whatever an object of a class you define as
> >> you like, and make that class inherit from eieio-persistent.  Then your
> >> data is savable out of the box.
> >> 
> >>   (info "(eieio) eieio-persistent")
> >> 
> >> Do you need an example?
> >
> > Thank you. If you have ready simplest example it may be useful for
> > review.
> >
> > My strategy is to minimize number of packages used as dependencies so
> > I try to use what is built in or to re-use what is inside of Emacs.
> 
> You might get inspired by an old post of mine here:
> http://mbork.pl/2018-09-10_Persisting_Emacs_variables

Nice post and Wiki. Reference taken. I can read the flow somehow. You
watching in the file by trying to read ^(setq if variable exists, if I
get it well. It relies on personal use case and common usage of
setq. What if variable is b that is set with:

(set (quote b) 1)

or

(setq a 1 b 2)

or

(setq a 1
      b 2
      c 3)

or

(setf b 1)

For me personally I save major information in the database. But to
make simpler package for users to do one thing do well I like to find
solutions that is preferrably built-in and well proven.



  reply	other threads:[~2020-11-10 21:46 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-10  7:51 How to save custom variable programmatically? Jean Louis
2020-11-10 10:43 ` Robert Pluim
2020-11-10 13:42   ` Jean Louis
2020-11-10 11:23 ` Michael Heerdegen
2020-11-10 13:55   ` Jean Louis
2020-11-10 14:36     ` Michael Heerdegen
2020-11-10 19:19       ` Jean Louis
2020-11-10 20:42         ` Marcin Borkowski
2020-11-10 21:46           ` Jean Louis [this message]
2020-11-11 21:20             ` Marcin Borkowski
2020-11-10 20:43         ` Michael Heerdegen
2020-11-10 21:52           ` Jean Louis
2020-11-11 18:00             ` Michael Heerdegen
2020-11-11 18:05               ` Jean Louis
2020-11-17 12:24             ` Michael Heerdegen
2020-11-17 15:07               ` Jean Louis
2020-11-10 21:15         ` Michael Heerdegen
2020-11-10 21:55           ` Jean Louis
2020-11-11 10:55             ` Michael Heerdegen
2020-11-17 15:44           ` Jean Louis
2020-11-17 16:38             ` Michael Heerdegen
2020-11-17 21:30               ` Stefan Monnier
2020-11-10 16:24 ` Drew Adams
2020-11-10 19:23   ` Jean Louis

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=X6sKG2q/bLHZfH9W@protected.rcdrun.com \
    --to=bugs@gnu.support \
    --cc=help-gnu-emacs@gnu.org \
    --cc=mbork@mbork.pl \
    --cc=michael_heerdegen@web.de \
    /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.