* 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.