unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Artur Malabarba <bruce.connor.am@gmail.com>
To: "Stephen J. Turnbull" <stephen@xemacs.org>
Cc: Sean Allred <code@seanallred.com>, emacs-devel <emacs-devel@gnu.org>
Subject: Re: Incorporating caching into defgroup/defcustom/defvar for Emacs 25
Date: Mon, 2 Feb 2015 10:08:44 +0000	[thread overview]
Message-ID: <CAAdUY-KHhWGFQJNd_PvYyky75mcDTLJuZxq_wR4LVD-5Q9TPfw@mail.gmail.com> (raw)
In-Reply-To: <87a90xqfxg.fsf@uwakimon.sk.tsukuba.ac.jp>

[-- Attachment #1: Type: text/plain, Size: 2189 bytes --]

On 2 Feb 2015 01:07, "Stephen J. Turnbull" <stephen@xemacs.org> wrote:
>
> Sean Allred writes:
>
>  > Specifically, his point about defcustom is a good one. Such
>  > variables shouldn’t be cached in the same sense.
>
> 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.

Similarly, internal variables can't use the defcustom mechanism (at least,
not without modifications) because (1) they'll show up in the customize
interface and (2) they'll clutter up the user's init file.

>
>  > stash.el was and is designed as a patch for the lack of “internal
>  > persistent variables”. The additional keyword(s?) to defgroup and a
>  > defvar* macro would suffice.
>
> 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, and desktop-mode might just be
disabled because the user doesn't want to restore open buffers/files. Some
packages need a way to store persistent data regardless of desktop-mode
(see abbrevs and bookmarks, for instance), and so far they've all been
doing that manually.

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, but I prefer something more specific like
`defstash') and its value will be saved to disk during a session and loaded
from disk at the start of each session (very similar to what desktop.el
does, but without relying on desktop-mode).

[-- Attachment #2: Type: text/html, Size: 2554 bytes --]

  reply	other threads:[~2015-02-02 10:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-01 16:46 Incorporating caching into defgroup/defcustom/defvar for Emacs 25 Sean Allred
2015-02-01 16:56 ` Sean Allred
2015-02-02  1:07   ` Stephen J. Turnbull
2015-02-02 10:08     ` Artur Malabarba [this message]
2015-02-02 13:03       ` Stephen J. Turnbull
2015-02-02 13:06         ` David Kastrup
2015-02-02 13:16         ` Artur Malabarba
2015-02-02 14:24       ` Drew Adams
2015-02-02 18:26 ` Stefan Monnier
2015-02-02 20:48   ` Artur Malabarba
2015-02-02 23:30     ` Stefan Monnier

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=CAAdUY-KHhWGFQJNd_PvYyky75mcDTLJuZxq_wR4LVD-5Q9TPfw@mail.gmail.com \
    --to=bruce.connor.am@gmail.com \
    --cc=code@seanallred.com \
    --cc=emacs-devel@gnu.org \
    --cc=stephen@xemacs.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).