From: Adam Spiers Date: Wed, 8 May 2013 06:59:41 +0000 (-0700) Subject: * lisp/cus-edit.el (custom-save-variables): Pretty-print long values. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~2026^2~252 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=dc7466df67defe01e0b6529394a5941970576fd1;p=emacs.git * lisp/cus-edit.el (custom-save-variables): Pretty-print long values. Fixes: debbugs:14187 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 45f74725c15..76ae9231820 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-05-08 Adam Spiers + + * cus-edit.el (custom-save-variables): + Pretty-print long values. (Bug#14187) + 2013-05-08 Glenn Morris * progmodes/m4-mode.el (m4-program): Assume it is in PATH. diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index ac9408b1081..d4966078e1d 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -4531,7 +4531,15 @@ This function does not save the buffer." (princ " '(") (prin1 symbol) (princ " ") - (prin1 (car value)) + (let ((val (prin1-to-string (car value)))) + (if (< (length val) 60) + (insert val) + (newline-and-indent) + (let ((beginning-of-val (point))) + (insert val) + (save-excursion + (goto-char beginning-of-val) + (indent-pp-sexp 1))))) (when (or now requests comment) (princ " ") (prin1 now)