emacs-devel
[Top][All Lists]
Advanced

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

Re: Incorporating caching into defgroup/defcustom/defvar for Emacs 25


From: Sean Allred
Subject: Re: Incorporating caching into defgroup/defcustom/defvar for Emacs 25
Date: Sun, 1 Feb 2015 10:56:42 -0600

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

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