Subject: 28.0.50; Error running timer ‘custom-magic-reset’

From: David PONCE <[email-masked]>
Date: Thu, 23 Apr 2020 19:39:26 +0200 (CEST)

Hello again,

Below is a possible patch that seems to have fixed the issue for me.
But I am not sure the approach is correct 

Thanks!

diff --git a/installs/emacs/lisp/cus-edit.el b/emacs.d/cus-edit.el
index d3d17fd..eec7ef0 100644
--- a/installs/emacs/lisp/cus-edit.el
+++ b/emacs.d/cus-edit.el
@@ -2217,9 +2217,16 @@ and `face'."
;; commands like `M-u' (that work on a region in the buffer)
;; will upcase the wrong part of the buffer, since more text has
;; been inserted before point.
- (run-with-idle-timer 0.0 nil #'custom-magic-reset widget)
+ (run-with-idle-timer 0.0 nil #'custom-magic-reset-async (current-buffer) widget)
(apply 'widget-default-notify widget args))))

+(defun custom-magic-reset-async (buffer widget)
+ "Redraw the :custom-magic property of WIDGET.
+Called asynchronously thru an idle timer, ensure redrawing will happen in the
+origin custom BUFFER."
+ (set-buffer buffer)
+ (custom-magic-reset widget))
+
(defun custom-redraw (widget)
"Redraw WIDGET with current settings."
(let ((line (count-lines (point-min) (point)))