From: Robert Pluim <rpluim@gmail.com>
To: David Ponce <da_vid@orange.fr>
Cc: 40788@debbugs.gnu.org
Subject: bug#40788: 28.0.50; Error running timer ‘custom-magic-reset’
Date: Tue, 21 Jul 2020 10:39:26 +0200 [thread overview]
Message-ID: <m2tuy1ntxd.fsf@gmail.com> (raw)
In-Reply-To: <444f86ec-6d0b-7134-5bb1-165549a7acb3@orange.fr> (David Ponce's message of "Fri, 24 Apr 2020 17:56:42 +0200")
>>>>> On Fri, 24 Apr 2020 17:56:42 +0200, David Ponce <da_vid@orange.fr> said:
David> On 24/04/2020 13:56, Robert Pluim wrote:
>>>>>>> On Thu, 23 Apr 2020 19:39:26 +0200 (CEST), David PONCE <da_vid@orange.fr> 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)
next prev parent reply other threads:[~2020-07-21 8:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-23 5:10 bug#40788: 28.0.50; Error running timer ‘custom-magic-reset’ David Ponce
2020-04-23 17:39 ` David PONCE
2020-04-24 11:56 ` Robert Pluim
2020-04-24 15:56 ` David Ponce
2020-07-21 8:39 ` Robert Pluim [this message]
2020-07-21 14:20 ` Eli Zaretskii
2020-07-21 14:39 ` Robert Pluim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2tuy1ntxd.fsf@gmail.com \
--to=rpluim@gmail.com \
--cc=40788@debbugs.gnu.org \
--cc=da_vid@orange.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).