[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Incorporating caching into defgroup/defcustom/defvar for Emacs 25
From: |
Artur Malabarba |
Subject: |
Re: Incorporating caching into defgroup/defcustom/defvar for Emacs 25 |
Date: |
Mon, 2 Feb 2015 11:16:43 -0200 |
2015-02-02 13:03 GMT+00:00 Stephen J. Turnbull <address@hidden>:
> Artur Malabarba writes:
> > On 2 Feb 2015 01:07, "Stephen J. Turnbull" <address@hidden> wrote:
>
> > > Why not? Custom provides a "reset" functionality if the user *wants*
> > > to reset. It's not clear to me that a user wouldn't want changes to
> > > customizable variables to persist.
> >
> > I wasn't saying defcustoms shouldn't be persistent, I was just
> > saying they already have a great mechanism for that so they don't
> > need to use this caching mechanism that is being suggested for
> > internal variables.
>
> Yes, they might. A user who is testing out a new custom setting might
> like the setting to persist without explicitly saving it if Emacs
> crashes or he runs out of memory and needs to stop and restart Emacs,
> or something like that.
>
> > > What does stash provide that a session manager such as desktop.el
> > > doesn't? That wasn't clear to me from your long email.
> >
> > With stash, a package can specify that a global variable is supposed to be
> > persistent, and this variable will automatically be saved/loaded from disk.
> >
> > I understand desktop.el provides similar functionality, but, IIUC,
> > desktop.el is more of a user interface. By that I mean sessions are
> > only saved/loaded if desktop-mode is enabled,
>
> The people I know who use desktop generally enable it in init.el. The
> only way to disable it AFAIK is -q.
>
> > Stash provides a simple abstraction for a variable that will be
> > persistent accross sessions. You just declare a variable to be
> > persistent (Sean suggested a `defvar*' macro,
>
> Ah, OK, so the important thing is that the programmer controls it, not
> the user.
Precisely.
Re: Incorporating caching into defgroup/defcustom/defvar for Emacs 25, Stefan Monnier, 2015/02/02