From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sean Allred Newsgroups: gmane.emacs.devel Subject: Re: Incorporating caching into defgroup/defcustom/defvar for Emacs 25 Date: Sun, 1 Feb 2015 10:56:42 -0600 Message-ID: References: <6AD4DF07-EFCD-48F4-AEE6-333F8D27BA87@seanallred.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1422809822 325 80.91.229.3 (1 Feb 2015 16:57:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 1 Feb 2015 16:57:02 +0000 (UTC) To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 01 17:57:02 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YHxpV-0001g4-6j for ged-emacs-devel@m.gmane.org; Sun, 01 Feb 2015 17:57:01 +0100 Original-Received: from localhost ([::1]:51080 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHxpU-0005RL-KH for ged-emacs-devel@m.gmane.org; Sun, 01 Feb 2015 11:57:00 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56161) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHxpH-0005RG-MW for emacs-devel@gnu.org; Sun, 01 Feb 2015 11:56:48 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YHxpE-00082c-Dt for emacs-devel@gnu.org; Sun, 01 Feb 2015 11:56:47 -0500 Original-Received: from sub4.mail.dreamhost.com ([69.163.253.135]:33595 helo=homiemail-a74.g.dreamhost.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHxpE-00082O-8W for emacs-devel@gnu.org; Sun, 01 Feb 2015 11:56:44 -0500 Original-Received: from homiemail-a74.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a74.g.dreamhost.com (Postfix) with ESMTP id 497E067C072 for ; Sun, 1 Feb 2015 08:56:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=seanallred.com; h= content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; s= seanallred.com; bh=Wwljbbq1Mpgb+SpJkYGa1+VZugc=; b=Fkuqt2zvjvl1y kBH742WuaNdQFS/FVT8XUJb/BaJY5DGKFMve49bMvAse48tudX4hPgPOD9nKUKqb aTI8Afx2EKYS0FxJsW5CIVWPGsUfaLP1SRiOCkjvIxS5WOi1J/H+1+l8kWT2SsnH up/8+4wXe8IKePfEyjjijIbyfWMelo= Original-Received: from [192.168.1.135] (71-90-77-44.dhcp.ftbg.wi.charter.com [71.90.77.44]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: code@seanallred.com) by homiemail-a74.g.dreamhost.com (Postfix) with ESMTPSA id 1BE7C67C06E for ; Sun, 1 Feb 2015 08:56:43 -0800 (PST) In-Reply-To: <6AD4DF07-EFCD-48F4-AEE6-333F8D27BA87@seanallred.com> X-Mailer: Apple Mail (2.2070.6) X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] [fuzzy] X-Received-From: 69.163.253.135 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:182195 Archived-At: Actually, I=E2=80=99ve 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.=20 >=20 > 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.=20= >=20 > 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.=20= Specifically, his point about defcustom is a good one. Such variables = shouldn=E2=80=99t be cached in the same sense. stash.el was and is = designed as a patch for the lack of =E2=80=9Cinternal persistent = variables=E2=80=9D. The additional keyword(s?) to defgroup and a defvar* = macro would suffice. Best, Sean=