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

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

bug#6572: 24.0.50; error string from `custom-variable-set'


From: Drew Adams
Subject: bug#6572: 24.0.50; error string from `custom-variable-set'
Date: Tue, 6 Jul 2010 08:59:19 -0700

If the defcustom :type is (restricted-sexp...), and you try to customize
to a value that does not respect this :type, you get a generic error
message: "The specified value is not valid".
 
This message could & should be more specific, referencing the sexp that
defines the restriction the value should respect.  E.g. if :type is:
 
(restricted-sexp :match-alternatives 'natnump)
 
Then the message would be more helpful if it said something like this:
 
"Specified value does not satisfy `natnump'"
 
If :type is:
 
(restricted-sexp :match-alternatives
                 (lambda (x) (and (foop x) (not (barp x)))))
 
Then this message is more helpful:
 
"Specified value does not satisfy
 `(lambda (x) (and (foop x) (not (barp x))))'"
 
If :type is:
 
(restricted-sexp :match-alternatives (integerp 't 'nil))
 
Then this message is more helpful:
 
"Specified value does not satisfy `(integerp 't 'nil)'"
 
In all cases, it is better to give the user some indication of what the
value should be, even if that is via a Lisp sexp.
 
Yes, the doc string should make clear the permissible values, but this
additional info in the message can also help.  It is at least as helpful
as the ubiquitous message "(wrong-type-argument integerp "abc")".
 

In GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600)
 of 2010-06-28 on 3249CTO
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (4.4) --no-opt --cflags -Ic:/xpm/include'
 






reply via email to

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