Function: savehist-printable

savehist-printable is a byte-compiled function defined in savehist.el.gz.

Signature

(savehist-printable VALUE)

Documentation

Return non-nil if VALUE is printable.

Source Code

;; Defined in /usr/src/emacs/lisp/savehist.el.gz
(defun savehist-printable (value)
  "Return non-nil if VALUE is printable."
  (cond
   ;; Quick response for oft-encountered types known to be printable.
   ((numberp value))
   ((symbolp value))
   ;; String without properties
   ((and (stringp value)
	 (equal-including-properties value (substring-no-properties value))))
   (t
    ;; For others, check explicitly.
    (with-temp-buffer
      (condition-case nil
	  (let ((print-level nil))
	    ;; Print the value into a buffer...
	    (prin1 value (current-buffer))
	    ;; ...and attempt to read it.
	    (read (point-min-marker))
	    ;; The attempt worked: the object is printable.
	    t)
	;; The attempt failed: the object is not printable.
	(error nil))))))