bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#6017: 23.1.96; savehist-printable for hash tables


From: Stefan Monnier
Subject: bug#6017: 23.1.96; savehist-printable for hash tables
Date: Fri, 23 Apr 2010 14:15:45 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> IIUC, starting with Emacs 23.2, we can prin1 and read hash tables. If
> that's correct, then `savehist-printable' could presumably be updated to
> add this sexp to the cond: (hash-table-p value). IOW:
 
> (defun savehist-printable (value)
>   "Return non-nil if VALUE is printable."
>   (cond
>    ((stringp value))
>    ((numberp value))
>    ((symbolp value))
>    ((hash-table-p value))
>    (t
>     (with-temp-buffer
>       (condition-case nil
>    (let ((print-readably t) (print-level nil))
>    (prin1 value (current-buffer))
>    (read (point-min-marker))
>    t)
>  (error nil))))))

That won't check whether the contents of the has-table are
themsevles printable.


        Stefan







reply via email to

[Prev in Thread] Current Thread [Next in Thread]