From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.help Subject: Re: print hash table to disk and reread in hash table Date: Thu, 28 Aug 2008 08:17:29 +0200 Message-ID: <87k5e1br46.fsf@tux.homenetwork> 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 1219904473 9049 80.91.229.12 (28 Aug 2008 06:21:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Aug 2008 06:21:13 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Xah Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Aug 28 08:22:07 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 1KYatN-0007Or-Jk for geh-help-gnu-emacs@m.gmane.org; Thu, 28 Aug 2008 08:22:01 +0200 Original-Received: from localhost ([127.0.0.1]:46698 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KYasO-0003Al-PV for geh-help-gnu-emacs@m.gmane.org; Thu, 28 Aug 2008 02:21:00 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KYas3-0003Af-Ul for help-gnu-emacs@gnu.org; Thu, 28 Aug 2008 02:20:39 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KYas1-0003AT-B1 for help-gnu-emacs@gnu.org; Thu, 28 Aug 2008 02:20:38 -0400 Original-Received: from [199.232.76.173] (port=58958 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KYas1-0003AQ-4i for help-gnu-emacs@gnu.org; Thu, 28 Aug 2008 02:20:37 -0400 Original-Received: from fk-out-0910.google.com ([209.85.128.189]:54077) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KYas1-0007x7-0Q for help-gnu-emacs@gnu.org; Thu, 28 Aug 2008 02:20:37 -0400 Original-Received: by fk-out-0910.google.com with SMTP id 18so159435fkq.10 for ; Wed, 27 Aug 2008 23:20:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references :date:in-reply-to:message-id:user-agent:mime-version:content-type :content-transfer-encoding; bh=gPA5GRS+KuZkocAagW7AtxiQ9WEmI7Hds25XyjS+IEI=; b=JTYoc+zzQ2j7u2W6drW5D0Uy/+iIPKN4SNR//UKloTO/4nfKKYIwx2BHJIuohaSgcF UvcEZRBmvbtKFd8e7JdRddzsLVVU6WTXF0vx+LsrXDZeoZE8oZMrtAk3JlEvW5FafrAs lEJ6Fw1tCh7Dgs6aPkjq/uCn38kQvj9aycp+U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type:content-transfer-encoding; b=hGKb8sgpWGiSzlS1VEBR0XA0Vk28o8BUYUXKR+WYBBW1XTfp5Ixfa249xj5+iNImgQ ukOzRxi+MLYteHOBWHZaUwHm/2hzFcPP0XBJ7bKJn8bla9QjMiz72e44pQ5IbV/8ahJa oiRFefTrvwsUYclWPvkrBWhXhy0mjCLHUAniY= Original-Received: by 10.181.15.18 with SMTP id s18mr1374105bki.77.1219904435843; Wed, 27 Aug 2008 23:20:35 -0700 (PDT) Original-Received: from tux.homenetwork ( [79.85.211.122]) by mx.google.com with ESMTPS id z40sm438892ikz.7.2008.08.27.23.20.34 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 27 Aug 2008 23:20:35 -0700 (PDT) In-Reply-To: (Xah's message of "Wed, 27 Aug 2008 22:27:47 -0700 (PDT)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) 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:57065 Xah writes: > but is there a function or lib to save hashtable to disk? i.e. > sometimes called serializing? AFAIK no, may be use some python dictionary and pickle it. > 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 . "200= 8.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 > --=20 A + Thierry Volpiatto Location: Saint-Cyr-Sur-Mer - France