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

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

bug#23975: 25.0.94: defcustom error message is wrong when :type field ha


From: Lars Ingebrigtsen
Subject: bug#23975: 25.0.94: defcustom error message is wrong when :type field has a :match attribute
Date: Fri, 04 Sep 2020 14:12:44 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Mauro Aranda <maurooaranda@gmail.com> writes:

> I wonder if we could just document the :type-error property.  So
> anybody that uses a custom :match function with additional checks can
> put there the information they like to show the user when something goes
> wrong.  So the defcustom posted would be something like:
>
> (defcustom bounded-num 999
>   "Positive, bounded number"
>   :type '(integer :match (lambda (widget value) (and (integerp value)
>                                                                               
>     (> value 0)
>                                                                               
>     (< value 1000)))
>                         :type-error "Value should be an integer between 0 and 
> 1000"))
>
> That's easy, and would solve the main problem here.  WDYT?

I think that's a very good idea.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

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