]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/cus-edit.el (custom-save-variables): Pretty-print long values.
authorAdam Spiers <emacs@adamspiers.org>
Wed, 8 May 2013 06:59:41 +0000 (23:59 -0700)
committerGlenn Morris <rgm@gnu.org>
Wed, 8 May 2013 06:59:41 +0000 (23:59 -0700)
Fixes: debbugs:14187
lisp/ChangeLog
lisp/cus-edit.el

index 45f74725c15880ae436cd4db8b9b19f0dd0e7607..76ae9231820d052d76e53e844299a405ad74b889 100644 (file)
@@ -1,3 +1,8 @@
+2013-05-08  Adam Spiers  <emacs@adamspiers.org>
+
+       * cus-edit.el (custom-save-variables):
+       Pretty-print long values.  (Bug#14187)
+
 2013-05-08  Glenn Morris  <rgm@gnu.org>
 
        * progmodes/m4-mode.el (m4-program): Assume it is in PATH.
index ac9408b1081343386f1fe58104b9bbf5a13e8fc1..d4966078e1d0167feaeb8e33ebfb179d00589591 100644 (file)
@@ -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)