Subject: bug#12065: 24.1; `custom-magic-show': set to "no", cannot get back again

From: [email-masked]
Date: Fri, 05 Aug 2016 20:25:23 -0400

Drew Adams <[email-masked]> writes:
> The point of this bug is that using the Value menu is a one-way
> street, exceptionally, in the case of this one option.  That's
> not normal - why should this option be an exception to how
> Emacs Customize works?  And if you change the value to short
> or long there is no such problem.

I thought maybe the point of that option is to hide the button.  It's
easy enough to exclude the button from hiding, just move that code
outside of the conditional:

diff --git i/lisp/cus-edit.el w/lisp/cus-edit.el
index ef12745..de219cb 100644
--- i/lisp/cus-edit.el
+++ w/lisp/cus-edit.el
@@ -2053,24 +2053,24 @@ custom-magic-value-create
 	(setq text (concat (match-string 1 text)
 			   (symbol-name category)
 			   (match-string 2 text))))
+      (insert "   ")
+      (when (and (eq category 'group)
+                 (not (and (eq custom-buffer-style 'links)
+                           (> (widget-get parent :custom-level) 1))))
+        (insert-char ?\s (* custom-buffer-indent
+                            (widget-get parent :custom-level))))
+      (push (widget-create-child-and-convert
+             widget 'choice-item
+             :help-echo "Change the state of this item."
+             :format (if hidden "%t" "%[%t%]")
+             :button-prefix 'widget-push-button-prefix
+             :button-suffix 'widget-push-button-suffix
+             :mouse-down-action 'widget-magic-mouse-down-action
+             :tag " State ")
+            children)
       (when (and custom-magic-show
 		 (or (not hidden)
 		     (memq category custom-magic-show-hidden)))
-	(insert "   ")
-	(when (and (eq category 'group)
-		   (not (and (eq custom-buffer-style 'links)
-			     (> (widget-get parent :custom-level) 1))))
-	  (insert-char ?\s (* custom-buffer-indent
-			      (widget-get parent :custom-level))))
-	(push (widget-create-child-and-convert
-	       widget 'choice-item
-	       :help-echo "Change the state of this item."
-	       :format (if hidden "%t" "%[%t%]")
-	       :button-prefix 'widget-push-button-prefix
-	       :button-suffix 'widget-push-button-suffix
-	       :mouse-down-action 'widget-magic-mouse-down-action
-	       :tag " State ")
-	      children)
 	(insert ": ")
 	(let ((start (point)))
 	  (if (eq custom-magic-show 'long)
@@ -2080,8 +2080,8 @@ custom-magic-value-create
 		 (insert " (lisp)"))
 		((eq form 'mismatch)
 		 (insert " (mismatch)")))
-	  (put-text-property start (point) 'face 'custom-state))
-	(insert "\n"))
+	  (put-text-property start (point) 'face 'custom-state)))
+      (insert "\n")
       (when (and (eq category 'group)
 		 (not (and (eq custom-buffer-style 'links)
 			   (> (widget-get parent :custom-level) 1))))