unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Sean Allred <code@seanallred.com>
To: emacs-devel <emacs-devel@gnu.org>
Subject: Re: Incorporating caching into defgroup/defcustom/defvar for Emacs 25
Date: Sun, 1 Feb 2015 10:56:42 -0600	[thread overview]
Message-ID: <D95CEDAD-4194-423A-82D5-D599972FF0AD@seanallred.com> (raw)
In-Reply-To: <6AD4DF07-EFCD-48F4-AEE6-333F8D27BA87@seanallred.com>

Actually, I’ve just read a message from Artur on the matter:

> The way I see it, emacs has a great interface for persistent customizable options (defcustom) and it has defvar for internal non-persistent variables. But it doesn't have anything for internal persistent variables. You can call custom-save-variable on an internal variable, but then it's up to you to check the value on initialization, and it's also a little awkward to use this for very large variables (since they'll clog up the user's custom-file, which is probably also the init file). That's why several packages (ido, bookmark, etc) end up manually writing/reading variables to/from disk. 
> 
> Thus, there's clearly the need for stashes, persistent internal variables. These are not customizable variables, because we already have defcustom for that.
> However, similar to a defcustom, a defstash also belongs to a group. This grouping is not used for customization (stashes don't show up in the customize interface), but it is used to group stashes in the file system. Each group corresponds to a subdirectory, and all stashes from that group go in that directory. This would be specified by passing the :stash-directory keyword to defgroup. This keyword (and one or two others) would be the only changes necessary outside the stash.el file. 
> 
> Obviously, groups with no stashes will not have a directory. Also, groups with only one or two stashes may opt to not use a subdirectory. 


Specifically, his point about defcustom is a good one. Such variables shouldn’t be cached in the same sense. 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.

Best,
Sean


  reply	other threads:[~2015-02-01 16:56 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 [this message]
2015-02-02  1:07   ` Stephen J. Turnbull
2015-02-02 10:08     ` Artur Malabarba
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=D95CEDAD-4194-423A-82D5-D599972FF0AD@seanallred.com \
    --to=code@seanallred.com \
    --cc=emacs-devel@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 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).