From dc7466df67defe01e0b6529394a5941970576fd1 Mon Sep 17 00:00:00 2001 From: Adam Spiers Date: Tue, 7 May 2013 23:59:41 -0700 Subject: [PATCH] * lisp/cus-edit.el (custom-save-variables): Pretty-print long values. Fixes: debbugs:14187 --- lisp/ChangeLog | 5 +++++ lisp/cus-edit.el | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) 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) -- 2.39.2