From: ishi soichi <soichi777@gmail.com>
To: Teemu Likonen <tlikonen@iki.fi>
Cc: help-gnu-emacs@gnu.org
Subject: Re: loading hash-table from a file?
Date: Thu, 5 Jan 2012 18:13:15 +0900 [thread overview]
Message-ID: <CAEjRLuQNpSezQNK3rdkVxvjgCiu_FiDxwmBwo1geUpjxCC6jwg@mail.gmail.com> (raw)
In-Reply-To: <87mxa2o6o3.fsf@imladris.arda>
[-- Attachment #1: Type: text/plain, Size: 649 bytes --]
Thanks everyone. I think I works well!
soichi
2012/1/5 Teemu Likonen <tlikonen@iki.fi>
> * 2012-01-05T10:35:18+02:00 * Valentin Baciu wrote:
>
> > In my Emacs 24, I can read back a printed (simple) hash table. I am
> > not sure weather using more complex data types as values will also
> > work.
> >
> > ;; Writing the hash table to a "database" file
> >
> > (with-current-buffer (find-file-noselect "/tmp/x")
> > (let ((h (make-hash-table)))
> > (puthash 'a 0 h)
> > (puthash 'b 1 h)
> > (insert (format "%s" h))
> > (save-buffer)))
>
> Use the %S format character to print objects in machine-readable (i.e.,
> READ) format.
>
[-- Attachment #2: Type: text/html, Size: 1048 bytes --]
next prev parent reply other threads:[~2012-01-05 9:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-05 5:16 loading hash-table from a file? ishi soichi
2012-01-05 8:35 ` Valentin Baciu
2012-01-05 9:11 ` Teemu Likonen
2012-01-05 9:13 ` ishi soichi [this message]
2012-01-05 9:07 ` Eric Abrahamsen
2012-01-06 16:43 ` Thierry Volpiatto
2012-01-07 2:16 ` Eric Abrahamsen
2012-01-05 9:24 ` Teemu Likonen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAEjRLuQNpSezQNK3rdkVxvjgCiu_FiDxwmBwo1geUpjxCC6jwg@mail.gmail.com \
--to=soichi777@gmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=tlikonen@iki.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.