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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to save custom variable programmatically?


From: Jean Louis
Subject: Re: How to save custom variable programmatically?
Date: Wed, 11 Nov 2020 00:46:03 +0300
User-agent: Mutt/2.0 (3d08634) (2020-11-07)

* 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 via email to

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