From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Robert Pluim 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: Fri, 24 Apr 2020 13:56:10 +0200 Message-ID: References: <9360131a-d203-4075-78b2-f4d31d044801@orange.fr> <1699699799.16404.1587663566588.JavaMail.www@wwinf1p24> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="21698"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 40788@debbugs.gnu.org To: David PONCE Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Apr 24 13:57:17 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 1jRwxI-0005U1-D1 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 Apr 2020 13:57:16 +0200 Original-Received: from localhost ([::1]:33152 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRwxH-0001N9-0m for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 Apr 2020 07:57:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55002) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRwx5-0001Mw-2c for bug-gnu-emacs@gnu.org; Fri, 24 Apr 2020 07:57:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jRwx4-00075G-Aw for bug-gnu-emacs@gnu.org; Fri, 24 Apr 2020 07:57:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45057) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jRwx3-000755-UR for bug-gnu-emacs@gnu.org; Fri, 24 Apr 2020 07:57:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jRwx3-0006l5-Tw for bug-gnu-emacs@gnu.org; Fri, 24 Apr 2020 07:57:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 24 Apr 2020 11:57:01 +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.158772938125931 (code B ref 40788); Fri, 24 Apr 2020 11:57:01 +0000 Original-Received: (at 40788) by debbugs.gnu.org; 24 Apr 2020 11:56:21 +0000 Original-Received: from localhost ([127.0.0.1]:56603 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jRwwO-0006kA-UD for submit@debbugs.gnu.org; Fri, 24 Apr 2020 07:56:21 -0400 Original-Received: from mail-wm1-f46.google.com ([209.85.128.46]:52650) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jRwwM-0006jy-Ll for 40788@debbugs.gnu.org; Fri, 24 Apr 2020 07:56:19 -0400 Original-Received: by mail-wm1-f46.google.com with SMTP id 188so10123571wmc.2 for <40788@debbugs.gnu.org>; Fri, 24 Apr 2020 04:56:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :mime-version; bh=qOg53V8Z22O9gReQx0BpBEoSnAKw4qUIqXLLWTgTu8c=; b=R2VkhGf7bqqeoqVsUColgw/1yWOJW6OPyLQXB9ImRy3riQwPsqT2I9F7QBFHxEeTyb n3TwDEH4yce/mpYgj8foQkh99MpFCeDrgl2THelMTqFtStiSr4LqvzGdq5Gb5AxppqWm 0zl1ShmJQ+K+yTY6eTHz7Pwpr1mxq37qRU8qbvW4zmHM+m5Yum+OAYYekGVtgXbln9C9 0Thcw0/nYvxi4N3DHt0ygsRvECtC88ynYiVWBA95lRvz7MReaXmHBvg0d9HNqIvhOEP9 X4R+gLECD4EJn81yK5qb2t0cYU4AJmRaXD65LduXOpuMiMAgO3nT1XqkVY6Rak3hQahb wfVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version; bh=qOg53V8Z22O9gReQx0BpBEoSnAKw4qUIqXLLWTgTu8c=; b=oLkUuy/aWxLAX57beME24VPSVWQCou+H3Cho0ulh7GsykImb6p/1izjJQ3TIs+8ESP V5nZ3W6dl1N3F5EJ2Nazg0wJ+c6+54VIRnMwKorItgo5bryoBuApd1iaaQ1xx5PsYRUS DYeGnWCaIpupXSBjEFZelAAndyo8HkxO0mWc4bGzHPfXp63/z0p+2sWeoww/BiOfkx2g SnUXmoRxDlQ7C2vqnErNQE7Tg/NsuAM2QLPXcs6K3RFp4QYhQMzB6u82trqruoPb8/Zu XlnwEfG0ZhIuTux9f5e16OA5YykR3nyA9dLFumxm7EbFCC9mCsFaZpVYQm+OxMrz1nym t9ng== X-Gm-Message-State: AGi0PuatUPcSD+SNZBoYInGFKb/VtyDuiaW0Zrwf1EQ62palgQs83Mbs PVNrZaQ/6C4hrYt3qi3QteG7tT9lotY= X-Google-Smtp-Source: APiQypKdL3yjXG45cmlB/4BiLiEmW+mhjZOSV2YT+0md+qKH/R1k6zBmEU0Ed3gYz2IyK6bkOqpUvg== X-Received: by 2002:a1c:dc8b:: with SMTP id t133mr9893444wmg.117.1587729372419; Fri, 24 Apr 2020 04:56:12 -0700 (PDT) Original-Received: from rpluim-mac ([2a01:e34:ecfc:a860:bd9a:ec93:82f0:3a9a]) by smtp.gmail.com with ESMTPSA id u188sm2032256wmg.37.2020.04.24.04.56.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Apr 2020 04:56:11 -0700 (PDT) In-Reply-To: <1699699799.16404.1587663566588.JavaMail.www@wwinf1p24> (David PONCE's message of "Thu, 23 Apr 2020 19:39:26 +0200 (CEST)") 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:178910 Archived-At: >>>>> On Thu, 23 Apr 2020 19:39:26 +0200 (CEST), David PONCE said: David> Hello again, David> Below is a possible patch that seems to have fixed the issue for me. David> But I am not sure the approach is correct Rather than defining a new function, you can add an argument to the existing one. Something like (untested) diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index d3d17fda7a..93012b134f 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -2102,11 +2102,12 @@ custom-magic-value-create (insert " ")) (widget-put widget :children children)))) -(defun custom-magic-reset (widget) +(defun custom-magic-reset (widget &optional buffer) "Redraw the :custom-magic property of WIDGET." - (let ((magic (widget-get widget :custom-magic))) - (when magic - (widget-value-set magic (widget-value magic))))) + (with-current-buffer (or buffer (current-buffer)) + (let ((magic (widget-get widget :custom-magic))) + (when magic + (widget-value-set magic (widget-value magic)))))) ;;; The `custom' Widget. @@ -2217,7 +2218,7 @@ custom-notify ;; 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 widget (current-buffer)) (apply 'widget-default-notify widget args)))) (defun custom-redraw (widget)