From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!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: Tue, 21 Jul 2020 10:39:26 +0200 Message-ID: References: <9360131a-d203-4075-78b2-f4d31d044801@orange.fr> <1699699799.16404.1587663566588.JavaMail.www@wwinf1p24> <444f86ec-6d0b-7134-5bb1-165549a7acb3@orange.fr> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32851"; 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 Tue Jul 21 10:40:10 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 1jxnoo-0008RR-13 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 21 Jul 2020 10:40:10 +0200 Original-Received: from localhost ([::1]:32810 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jxnon-0005LG-3R for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 21 Jul 2020 04:40:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42300) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jxnog-0005L9-BA for bug-gnu-emacs@gnu.org; Tue, 21 Jul 2020 04:40:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54609) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jxnog-0000nl-1t for bug-gnu-emacs@gnu.org; Tue, 21 Jul 2020 04:40:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jxnof-0000zn-V0 for bug-gnu-emacs@gnu.org; Tue, 21 Jul 2020 04:40: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: Tue, 21 Jul 2020 08:40: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.15953207773791 (code B ref 40788); Tue, 21 Jul 2020 08:40:01 +0000 Original-Received: (at 40788) by debbugs.gnu.org; 21 Jul 2020 08:39:37 +0000 Original-Received: from localhost ([127.0.0.1]:37922 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jxnoH-0000z5-4M for submit@debbugs.gnu.org; Tue, 21 Jul 2020 04:39:37 -0400 Original-Received: from mail-wr1-f65.google.com ([209.85.221.65]:42518) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jxnoE-0000yr-1l for 40788@debbugs.gnu.org; Tue, 21 Jul 2020 04:39:35 -0400 Original-Received: by mail-wr1-f65.google.com with SMTP id o11so20322434wrv.9 for <40788@debbugs.gnu.org>; Tue, 21 Jul 2020 01:39:33 -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=enLiYmIFVb5kZ+omWy7jU4RjY/DnVoM90eoaNbFPWMc=; b=CzveQ2CmP9SsBHijsqPrxACBF0Ne1kS0gBEbdLvlZlDbY2GqG/fdIOtbwC8um1tqYF 3oPmlwUZm190mCKnX2xaTYXN+HUlheUOfv0vg7ca2Q8lJkxgiFqE09eb61OvVQM0UUCx uSJdADL5SWSJOXLZ6cFGQkO/Gnkd8GyH+XZAa6hgBKyL6Y1Ty/G9/Z6dxIgtSKnZgUCf WMkS2UH3BaCqSkRKa13zTl3blr112HDFglYwineQaV4x4giE9+DdNjM/9khblFQPvwSA Uo/uM/dfrbc2dng7LqBK+jUCqbSOu93ROcZEtoulu5tGPGCTSl01MBcHRJWlscjDOrrh w2tQ== 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=enLiYmIFVb5kZ+omWy7jU4RjY/DnVoM90eoaNbFPWMc=; b=IevZrL6rfZ4fOThz9PckJU70FG/7Ngj0Y4OZ+u4Kn25SA7bdxAIBoP7/KoIIxhhbah Da6kke/KeAwMbiD0urHdIa6xj+uvjIUUH4Bt2rz9r1901CLdsoBK/qyKzFDF0zvHVLqG Vi1fjRo12m9K9016De0IR//zYEDCfoscux6CkLqMzU523QoXLOo91J/M+uBk6FVssPaU s+sBSkcig/RfTghA/IF+lbkijZKEr3l6VVTvxIwmwmChQdTtVKu8VpbKCOA2BR995r1Z Bp5J3mmFcvpAImbYNRM739fTcJWF5NyJy9A/l+V6sUBnVOJplCWsT+ASYtX7szQl/SZl 3m9Q== X-Gm-Message-State: AOAM530z4XNQ6aqTV8q4WUM84LfnxyChZ3TYyFneCAMwFudrkDHVhTQL gNNQSor5Fm4kdSZYkV8rXywUDYiY0/o= X-Google-Smtp-Source: ABdhPJyQJhFHiCOGVmNgZT7ymU196pdmcZ/nB+mUZ7Tna8QpXkLDYm/zlZAMRJ+lZxJl8J00lZv6mQ== X-Received: by 2002:adf:ec04:: with SMTP id x4mr8461409wrn.28.1595320767715; Tue, 21 Jul 2020 01:39:27 -0700 (PDT) Original-Received: from rpluim-mac ([2a01:e34:ecfc:a860:4110:9b43:efda:ca2e]) by smtp.gmail.com with ESMTPSA id 14sm2535428wmk.19.2020.07.21.01.39.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2020 01:39:26 -0700 (PDT) In-Reply-To: <444f86ec-6d0b-7134-5bb1-165549a7acb3@orange.fr> (David Ponce's message of "Fri, 24 Apr 2020 17:56:42 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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:183344 Archived-At: >>>>> On Fri, 24 Apr 2020 17:56:42 +0200, David Ponce said: David> On 24/04/2020 13:56, Robert Pluim wrote: >>>>>>> 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) David> Hi Robert, David> Sure, your patch is better :-) David> I tested it, and I confirm it fixes the issue :-) David> I also tested the below variant, because it seems to me that it is not David> necessary to set the buffer when magic is nil, as there is nothing to do. David> Please feel free to apply which version looks better to you. David> Thanks! Thanks for testing. Eli, would this be OK to go into emacs-27 ? The bug causes unintended changes to buffers unrelated to customize. David> diff --git a/home/dponce/installs/emacs/lisp/cus-edit.el b/cus-edit.el David> index d3d17fd..490d905 100644 David> --- a/home/dponce/installs/emacs/lisp/cus-edit.el David> +++ b/cus-edit.el David> @@ -2102,11 +2102,12 @@ and `face'." David> (insert " ")) David> (widget-put widget :children children)))) David> -(defun custom-magic-reset (widget) David> +(defun custom-magic-reset (widget &optional buffer) David> "Redraw the :custom-magic property of WIDGET." David> (let ((magic (widget-get widget :custom-magic))) David> (when magic David> - (widget-value-set magic (widget-value magic))))) David> + (with-current-buffer (or buffer (current-buffer)) David> + (widget-value-set magic (widget-value magic)))))) David> ;;; The `custom' Widget. David> @@ -2217,7 +2218,7 @@ and `face'." David> ;; commands like `M-u' (that work on a region in the buffer) David> ;; will upcase the wrong part of the buffer, since more text has David> ;; been inserted before point. David> - (run-with-idle-timer 0.0 nil #'custom-magic-reset widget) David> + (run-with-idle-timer 0.0 nil #'custom-magic-reset widget (current-buffer)) David> (apply 'widget-default-notify widget args)))) David> (defun custom-redraw (widget)