bug#81560: 31.0.91; dframe-update-speed specifies :type integer

Daniel Mendler via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <[email protected]> Thu, 06 Aug 2026 13:01:03 +0200
Newsgroups gmane.emacs.bugs
Message-ID <[email protected]>
Eli Zaretskii <[email protected]> writes:

>> From: Daniel Mendler <[email protected]>
>> Cc: [email protected]
>> Date: Wed, 05 Aug 2026 19:26:13 +0200
>> 
>> Eli Zaretskii <[email protected]> writes:
>> 
>> >> Date: Wed, 05 Aug 2026 17:42:10 +0200
>> >> From: Daniel Mendler via "Bug reports for GNU Emacs,
>> >>  the Swiss army knife of text editors" <[email protected]>
>> >> 
>> >> The speedbar uses the customizable variable `dframe-update-speed' to
>> >> check for updates. This variable has variable :type `integer' but
>> >> shorter delays are supported, e.g., 0.5. I suggest to change the
>> >> variable :type to `number'.
>> >
>> > Actually, 'number' is also inaccurate: the value can be in the format
>> > of the value returned by current-idle-time, because the value is
>> > passed to run-with-idle-timer.
>> 
>> So is there a type which you think is appropriate?
>
> If we change no other code, then perhaps allowing a list of
> appropriate lengths in addition to a number?  IOW, a custom validation
> function.

I think the type number is appropriate. There are plenty of examples...

(defcustom eldoc-idle-delay 0.50
  "Number of seconds of idle time to wait before displaying documentation.
If user input arrives before this interval of time has elapsed after the
last input event, no documentation will be displayed.

If this variable is set to 0, display the documentation without any delay."
  :type 'number)

(defcustom show-paren-delay 0.125
  "Time in seconds to delay before showing a matching paren.
If you change this without using customize while `show-paren-mode' is
active, you must toggle the mode off and on again for this to take effect."
  :type '(number :tag "seconds")
  :initialize 'custom-initialize-default
  :set (lambda (sym val)
	 (if (not show-paren-mode)
	     (set sym val)
	   (show-paren-mode -1)
	   (set sym val)
	   (show-paren-mode 1))))

(defcustom blink-cursor-delay 0.5
  "Seconds of idle time before the first blink of the cursor.
Values smaller than 0.2 sec are treated as 0.2 sec."
  :type 'number
  :group 'cursor
  :set (lambda (symbol value)
         (set-default symbol value)
         (when blink-cursor-idle-timer (blink-cursor--start-idle-timer))))

(defcustom blink-cursor-interval 0.5
  "Length of cursor blink interval in seconds."
  :type 'number
  :group 'cursor
  :set (lambda (symbol value)
         (set-default symbol value)
         (when blink-cursor-timer (blink-cursor--start-timer))))

(defcustom tooltip-delay 0.7
  "Seconds to wait before displaying a tooltip the first time."
  :type 'number)

Daniel