From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: Persistence of variables Date: Wed, 28 Mar 2018 15:09:01 +0200 Organization: Aioe.org NNTP Server Message-ID: <86woxwtkia.fsf@zoho.com> References: <87a7v20xlf.fsf@mbork.pl> <83a7v1lxxz.fsf@gnu.org> <87605p28ma.fsf@mbork.pl> <874ll94uvs.fsf@ericabrahamsen.net> <77e3430c-8533-4962-92fa-3b87e2226563@default> <20180321151926.GF12393@tuxteam.de> <87sh8txefj.fsf@fastmail.fm> <867epxuk1e.fsf@zoho.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1522242621 30653 195.159.176.226 (28 Mar 2018 13:10:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 28 Mar 2018 13:10:21 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Mar 28 15:10:17 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f1AqG-0007sO-Et for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Mar 2018 15:10:16 +0200 Original-Received: from localhost ([::1]:39201 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f1AsJ-0001LO-Qv for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Mar 2018 09:12:23 -0400 Original-Path: usenet.stanford.edu!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 50 Original-NNTP-Posting-Host: Mq3CdlVpWThKpW6fSn+6ow.user.gioia.aioe.org Original-X-Complaints-To: abuse@aioe.org Cancel-Lock: sha1:YoKqWeiTfMuun0184znFGVf+x4E= X-Notice: Filtered by postfilter v. 0.8.3 Mail-Copies-To: never Original-Xref: usenet.stanford.edu gnu.emacs.help:222169 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:116287 Archived-At: Marcin Borkowski wrote: > I think you misunderstood me. Storing data in > a file is natural. Having a separate file for > just one variable looks like an overkill. Then create a file in your home dir called .pervert - the persistent variable register. It can be an XML file or just a text file like this caliber 5.56 insulation none tire 650B LSD ALD-52 ("just a text file" doesn't make it any less of a database than an XML ditto by the way) Now write a parser that will search the file for e.g. the key "tire" and return the data item "650B". Because you said you at this point only have a single variable, you don't need to worry about sorting (at least not for the sake of an algorithm parsing it being too slow), but it can be nice to have it sorted anyway - and easy to do like any Emacs buffer, even automatically on insert - nice because you might come to realize this file is handy also for manual [1] use, e.g. when writing to the math faculty and having to look up pi (3.1415..) and so on :) No, seriously! I'm pretty sure someone already did an Emacs framework/interface to populate, change, and retrieve data from such a text DB file? [1] Remember the words (mantra/motto) of the UK intelligence service: Knowledge gives strength to the hands. -- underground experts united http://user.it.uu.se/~embe8573