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 07:21:41 +0200 Message-ID: <87od3dbtp6.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=us-ascii X-Trace: ger.gmane.org 1219901154 2799 80.91.229.12 (28 Aug 2008 05:25:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Aug 2008 05:25:54 +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 07:26:47 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 1KYa1a-0004df-IO for geh-help-gnu-emacs@m.gmane.org; Thu, 28 Aug 2008 07:26:26 +0200 Original-Received: from localhost ([127.0.0.1]:48689 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KYa0b-0000qX-U0 for geh-help-gnu-emacs@m.gmane.org; Thu, 28 Aug 2008 01:25:25 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KYa06-0000pM-Mv for help-gnu-emacs@gnu.org; Thu, 28 Aug 2008 01:24:54 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KYa05-0000ni-4K for help-gnu-emacs@gnu.org; Thu, 28 Aug 2008 01:24:53 -0400 Original-Received: from [199.232.76.173] (port=42549 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KYa04-0000nB-Hc for help-gnu-emacs@gnu.org; Thu, 28 Aug 2008 01:24:52 -0400 Original-Received: from fk-out-0910.google.com ([209.85.128.191]:43012) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KYa04-0001HL-Cz for help-gnu-emacs@gnu.org; Thu, 28 Aug 2008 01:24:52 -0400 Original-Received: by fk-out-0910.google.com with SMTP id 18so147656fkq.10 for ; Wed, 27 Aug 2008 22:24:47 -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; bh=kJiX5ko/PRIKX0dhkK9iN77InHba9p11rqtRl7G6+Gs=; b=Drd7NTxN5CEVEBsE/UpYvz/P52kEfhl9mIaPa628qIwjq6GjyecC+GL52uvoQT2yj+ LTHM5pW1x7BNBS6IXJ3F8AgUkRAi2Nfq3ia4usn3iq8tTaUp/5o0x2JdQnC8fF85a9pF lNdffHqu7O5D8yUugDs+7zbWYUt6qn7E3iw3c= 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; b=PqqDqw5voPSTdi45wUNPNkKRyMVszEDzrZoPZAmp029GKzN72qb32rk1r6sx47Kxhk t5HE8jbUYtVZsjQJhmoY0GCVBvKA6FRMH2rmnrUezfUbX9y5W5uPb1fMMZS9RNo9n/wU YBOdEiUR1nkMeBRwnkr3QlglswQp5CTj0G2a0= Original-Received: by 10.180.215.9 with SMTP id n9mr1292797bkg.59.1219901087248; Wed, 27 Aug 2008 22:24:47 -0700 (PDT) Original-Received: from tux.homenetwork ( [79.85.211.122]) by mx.google.com with ESMTPS id y37sm403231iky.8.2008.08.27.22.24.45 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 27 Aug 2008 22:24:46 -0700 (PDT) In-Reply-To: <34f9604c-a23b-4ad9-9c84-f45884a6df23@x16g2000prn.googlegroups.com> (Xah's message of "Wed, 27 Aug 2008 18:01:58 -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:57062 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