From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Newsgroups: gmane.emacs.help Subject: Re: print hash table to disk and reread in hash table Date: Wed, 27 Aug 2008 22:27:47 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <34f9604c-a23b-4ad9-9c84-f45884a6df23@x16g2000prn.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1219902188 4585 80.91.229.12 (28 Aug 2008 05:43:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Aug 2008 05:43:08 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Aug 28 07:44:02 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KYaIZ-00081E-UZ for geh-help-gnu-emacs@m.gmane.org; Thu, 28 Aug 2008 07:44:00 +0200 Original-Received: from localhost ([127.0.0.1]:55708 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KYaHb-0006H3-Lh for geh-help-gnu-emacs@m.gmane.org; Thu, 28 Aug 2008 01:42:59 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!z6g2000pre.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 36 Original-NNTP-Posting-Host: 24.6.185.159 Original-X-Trace: posting.google.com 1219901267 14690 127.0.0.1 (28 Aug 2008 05:27:47 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 28 Aug 2008 05:27:47 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: z6g2000pre.googlegroups.com; posting-host=24.6.185.159; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.22, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:161703 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:57064 but is there a function or lib to save hashtable to disk? i.e. sometimes called serializing? Xah =E2=88=91 http://xahlee.org/ =E2=98=84 On Aug 27, 10:21=C2=A0pm, Thierry Volpiatto wrote: > Xah writes: > > if i have a hash table in elisp, is there a way to save it to disk and > > reread in when starting emacs? > > What you can do is creating a named hash-table at each time you start > emacs and load a file containing (puthash that...) (puthash this...) > etc... Here an example of one of my files: > > ,---- > | ;;; dvc-bookmarks-cache -*- mode: emacs-lisp; coding: utf-8; -*- > | (puthash 'MAIL '((color . dvc-excluded) (state . "open") (time-stamp . = "2008.06.23")) dvc-bookmarks-cache) > | (puthash 'CONFIG '((color . dvc-source) (state . "open") (time-stamp . = "2008.06.23")) dvc-bookmarks-cache) > | (puthash 'DVC '((color . dvc-mark) (state . "open") (time-stamp . "2008= .08.15")) dvc-bookmarks-cache) > | (puthash 'SOURCES '((color . dvc-unknown) (state . "open") (time-stamp = . "2008.06.23")) dvc-bookmarks-cache) > `---- > > The hash-table here is `dvc-bookmark-cache' > > -- > A + Thierry Volpiatto > Location: Saint-Cyr-Sur-Mer - France