From: Eli Zaretskii <eliz@gnu.org>
To: Jonathan Kyle Mitchell <kyle@jonathanmitchell.org>
Cc: k.michal@zoho.com, 32038@debbugs.gnu.org
Subject: bug#32038: 27.0.50; Emacs hangs when using :propertize mode line construct and not providing a property value
Date: Wed, 04 Jul 2018 18:07:23 +0300 [thread overview]
Message-ID: <83po03niok.fsf@gnu.org> (raw)
In-Reply-To: <871scj7kxy.fsf@jonathanmitchell.org> (message from Jonathan Kyle Mitchell on Tue, 03 Jul 2018 22:12:57 -0500)
> From: Jonathan Kyle Mitchell <kyle@jonathanmitchell.org>
> Date: Tue, 03 Jul 2018 22:12:57 -0500
> Cc: 32038@debbugs.gnu.org
>
> I think I found a way to make redisplay ignore any malformed property list by
> putting a single check around Fset_text_properties in xdisp.c. The text of the
> modeline is still set according to the provided string, but the property list
> is ignored if it doesn't have an even number of elements. It doesn't
> infinitely loop anymore given a malformed property list.
Thanks, but I think we should log the error in *Messages*, because
otherwise the error will go unnoticed.
> + if (EQ (Fmod (Flength (props), make_number (2)),
> + make_number (0)))
We are on the C level, so it is easier/simpler to do this instead:
ptrdiff_t seqlen = XFASTINT (Flength (props));
if (seqlen % 2 == 0)
Fset_text_properties (...);
More importantly, Flength can signal an error if PROPS is too long, so
I'm not sure the idea of your patch is 100% correct, because the code
you propose can still signal an error. An alternative would be to
call Fset_text_properties via internal_condition_case_n, like we do in
safe__call.
next prev parent reply other threads:[~2018-07-04 15:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-02 16:15 bug#32038: 27.0.50; Emacs hangs when using :propertize mode line construct and not providing a property value Michał Kondraciuk
2018-07-03 1:24 ` Jonathan Kyle Mitchell
2018-07-03 4:46 ` Jonathan Kyle Mitchell
2018-07-04 3:12 ` Jonathan Kyle Mitchell
2018-07-04 15:07 ` Eli Zaretskii [this message]
2018-07-05 4:14 ` Jonathan Kyle Mitchell
2018-07-14 11:30 ` Eli Zaretskii
2018-07-15 17:21 ` Jonathan Kyle Mitchell
2018-07-21 16:39 ` bug#32237: 27.0.50; Function in before-change-functions is called with first argument greater than the second Michał Kondraciuk
2018-07-21 18:06 ` Eli Zaretskii
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83po03niok.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=32038@debbugs.gnu.org \
--cc=k.michal@zoho.com \
--cc=kyle@jonathanmitchell.org \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.