Avoid beginning/end of buffer errors when moving across display strings.
[bpt/emacs.git] / lisp / cus-edit.el
index ac9408b..d496607 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)