emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#14187: closed ([PATCH] Pretty-print long values in


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#14187: closed ([PATCH] Pretty-print long values in custom variables)
Date: Wed, 08 May 2013 07:02:02 +0000

Your message dated Wed, 08 May 2013 02:59:51 -0400
with message-id <address@hidden>
and subject line Re: bug#14187: [PATCH] Pretty-print long values in custom 
variables
has caused the debbugs.gnu.org bug report #14187,
regarding [PATCH] Pretty-print long values in custom variables
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
14187: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14187
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: [PATCH] Pretty-print long values in custom variables Date: Thu, 11 Apr 2013 20:13:29 +0100
* cus-edit.el (custom-save-variables): When a custom value is over 60
characters long, insert it using indent-pp-sexp so that the value is
more legible through being split over multiple lines.  This is
particularly useful when `custom-file' is tracked by a version control
system, since then the diffs become much more manageable.
---
 lisp/cus-edit.el | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index d19e2de..8a018cb 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -4529,7 +4529,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)
-- 
1.8.2.1.347.gbef22ca




--- End Message ---
--- Begin Message --- Subject: Re: bug#14187: [PATCH] Pretty-print long values in custom variables Date: Wed, 08 May 2013 02:59:51 -0400 User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
Version: 24.4

Nothing happened, so I installed this.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]