GNU bug report logs - #14187
[PATCH] Pretty-print long values in custom variables

Previous Next

Package: emacs;

Reported by: Adam Spiers <emacs <at> adamspiers.org>

Date: Thu, 11 Apr 2013 19:18:01 UTC

Severity: wishlist

Tags: patch

Fixed in version 24.4

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 14187 in the body.
You can then email your comments to 14187 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#14187; Package emacs. (Thu, 11 Apr 2013 19:18:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Adam Spiers <emacs <at> adamspiers.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 11 Apr 2013 19:18:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Adam Spiers <emacs <at> adamspiers.org>
To: bug-gnu-emacs <at> gnu.org
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





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14187; Package emacs. (Fri, 12 Apr 2013 02:00:02 GMT) Full text and rfc822 format available.

Message #8 received at 14187 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Adam Spiers <emacs <at> adamspiers.org>
Cc: 14187 <at> debbugs.gnu.org
Subject: Re: bug#14187: [PATCH] Pretty-print long values in custom variables
Date: Thu, 11 Apr 2013 21:55:05 -0400
> * 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.

Looks good, thank you, please install,


        Stefan




Reply sent to Glenn Morris <rgm <at> gnu.org>:
You have taken responsibility. (Wed, 08 May 2013 07:02:02 GMT) Full text and rfc822 format available.

Notification sent to Adam Spiers <emacs <at> adamspiers.org>:
bug acknowledged by developer. (Wed, 08 May 2013 07:02:02 GMT) Full text and rfc822 format available.

Message #13 received at 14187-done <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 14187-done <at> debbugs.gnu.org
Subject: Re: bug#14187: [PATCH] Pretty-print long values in custom variables
Date: Wed, 08 May 2013 02:59:51 -0400
Version: 24.4

Nothing happened, so I installed this.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 05 Jun 2013 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 334 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.