unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#12670: 24.2.50; Uncustomizable defcustom
@ 2012-10-18  9:33 Katsumi Yamaoka
  2012-12-22  1:41 ` Chong Yidong
  0 siblings, 1 reply; 5+ messages in thread
From: Katsumi Yamaoka @ 2012-10-18  9:33 UTC (permalink / raw)
  To: 12670

[-- Attachment #1: Type: text/plain, Size: 610 bytes --]

Hi,

I realized that a certain defcustom form is unable to customize
a user option.  To reproduce this, evaluate the following form,
perform M-x customize-option, and press the [INS] button.

(defcustom foo nil
  "Doc"
  :type '(repeat (group (group :inline t (choice string function)))))

Then you will find a funny thing there and see it is unable to
edit.  After some investigations I found this is due to
`widget-default-get', that fails to get the default value of
components within an inlined form (I mean (bar :inline t ...)).

A patch is attached, not tested with all sorts of defcustom
forms though.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: DIFF --]
[-- Type: text/x-patch, Size: 792 bytes --]

--- wid-edit.el~	2012-04-22 21:52:01.618551000 +0000
+++ wid-edit.el	2012-10-18 09:27:17.158803700 +0000
@@ -525,9 +525,18 @@
 (defun widget-default-get (widget)
   "Extract the default external value of WIDGET."
   (widget-apply widget :value-to-external
 		(or (widget-get widget :value)
-		    (widget-apply widget :default-get))))
+		    (progn
+		      (when (widget-get widget :args)
+			(let (args)
+			  (dolist (arg (widget-get widget :args))
+			    (setq args (append args
+					       (if (widget-get arg :inline)
+						   (widget-get arg :args)
+						 (list arg)))))
+			  (widget-put widget :args args)))
+		      (widget-apply widget :default-get)))))
 
 (defun widget-match-inline (widget vals)
   "In WIDGET, match the start of VALS."
   (cond ((widget-get widget :inline)

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-01-07 11:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-18  9:33 bug#12670: 24.2.50; Uncustomizable defcustom Katsumi Yamaoka
2012-12-22  1:41 ` Chong Yidong
2012-12-22 13:35   ` Katsumi Yamaoka
2013-01-06  3:37     ` Chong Yidong
2013-01-07 11:25       ` Katsumi Yamaoka

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).