(prin1
(seq-keep
(lambda (sym)
- (when (and (boundp sym) (not (memq sym savehist-ignored-variables)))
- (cons sym (symbol-value sym))))
+ (and (boundp sym)
+ (not (memq sym savehist-ignored-variables))
+ (readablep (symbol-value sym))
+ (cons sym (symbol-value sym))))
(cons 'savehist-minibuffer-history-variables
(append savehist-minibuffer-history-variables
savehist-additional-variables)))
Does nothing if Savehist mode is off."
(when savehist-mode (savehist-save)))
-(define-obsolete-function-alias 'savehist-trim-history #'identity "27.1")
-
-(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))))))
-
(defun savehist-minibuffer-hook ()
(unless (or (eq minibuffer-history-variable t)
;; If `read-string' is called with a t HISTORY argument