From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: David PONCE Newsgroups: gmane.emacs.bugs Subject: bug#40788: 28.0.50; Error running timer =?UTF-8?Q?=E2=80=98custom-magic-reset=E2=80=99?= Date: Thu, 23 Apr 2020 19:39:26 +0200 (CEST) Message-ID: <1699699799.16404.1587663566588.JavaMail.www@wwinf1p24> References: <9360131a-d203-4075-78b2-f4d31d044801@orange.fr> Reply-To: David PONCE Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="74622"; mail-complaints-to="usenet@ciao.gmane.io" To: 40788@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 23 19:40:14 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jRfpd-000JHm-VF for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 23 Apr 2020 19:40:13 +0200 Original-Received: from localhost ([::1]:34270 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRfpc-0002g7-TZ for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 23 Apr 2020 13:40:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51894) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRfpT-0002br-I3 for bug-gnu-emacs@gnu.org; Thu, 23 Apr 2020 13:40:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jRfpS-0000gb-VP for bug-gnu-emacs@gnu.org; Thu, 23 Apr 2020 13:40:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44270) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jRfpS-0000fH-JL for bug-gnu-emacs@gnu.org; Thu, 23 Apr 2020 13:40:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jRfpS-0003wt-Bh for bug-gnu-emacs@gnu.org; Thu, 23 Apr 2020 13:40:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <9360131a-d203-4075-78b2-f4d31d044801@orange.fr> Resent-From: David PONCE Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 23 Apr 2020 17:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40788 X-GNU-PR-Package: emacs Original-Received: via spool by 40788-submit@debbugs.gnu.org id=B40788.158766357515138 (code B ref 40788); Thu, 23 Apr 2020 17:40:02 +0000 Original-Received: (at 40788) by debbugs.gnu.org; 23 Apr 2020 17:39:35 +0000 Original-Received: from localhost ([127.0.0.1]:55816 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jRfp0-0003w6-Qf for submit@debbugs.gnu.org; Thu, 23 Apr 2020 13:39:35 -0400 Original-Received: from smtp09.smtpout.orange.fr ([80.12.242.131]:34536 helo=smtp.smtpout.orange.fr) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jRfoz-0003vs-Nx for 40788@debbugs.gnu.org; Thu, 23 Apr 2020 13:39:34 -0400 Original-Received: from wwinf1p24 ([10.223.75.48]) by mwinf5d44 with ME id WHfS2200D12XHQS03HfStL; Thu, 23 Apr 2020 19:39:26 +0200 X-ME-Helo: wwinf1p24 X-ME-Auth: ZGFfdmlkQG9yYW5nZS5mcg== X-ME-Date: Thu, 23 Apr 2020 19:39:26 +0200 X-ME-IP: 92.129.68.39 X-Originating-IP: [92.129.68.39] X-WUM-FROM: |~| X-WUM-TO: |~| X-WUM-REPLYTO: |~| X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:178864 Archived-At: 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)))