Subject: bug#37455: 27.0.50; insert-behind-hooks and insert-in-front-hooks in text properties do nothing when font-lock-mode is on

From: Ihor Radchenko <[email-masked]>
Date: Fri, 20 Sep 2019 00:46:52 +0800

Thanks!
I can confirm that the hooks work as expected in master.

Also, a word about the property names (from reddit comment by @00-11
https://www.reddit.com/r/emacs/comments/d5waor/how_to_use_modification_hooks_in_text_properties/f0q54zn/):

"Too bad they have names that end in -hooks, which is misleading. Even
if they were actually hooks (which are variables), because their
functions take arguments they would be considered "abnormal
hooks", and abnormal hooks are conventionally named with the
suffix -functions (not -hooks). Following that convention would
also be less misleading, lessening the suggestion that they're
hooks."

Would it make sense to change the text and overlay property names to
something like insert-in-front-functions, insert-behind-functions, and
modification-functions?

Regards,
Ihor

Eli Zaretskii <[email-masked]> writes:

>> From: 'Ihor Radchenko' <[email-masked]>
>> Date: Thu, 19 Sep 2019 08:48:57 +0800
>> 
>> Expected behaviour:
>> 
>> According to the manual, adding insert-in-front-hooks or
>> insert-behind-hooks text properties should trigger the functions listed
>> in the hooks when the text is inserted in front/behind the text.
>> 
>> Observed behaviour:
>> 
>> The functions never run unless I type very fast (with my own config) or
>> when font-lock-mode is enabled.
>
> We have too many hooks, and they fight each other.  Recursively.
>
> Should be fixed now on the master branch.  Thanks.

-- 
Ihor Radchenko,
PhD,
Center for Advancing Materials Performance from the Nanoscale (CAMP-nano)
State Key Laboratory for Mechanical Behavior of Materials, Xi'an Jiaotong University, Xi'an, China
Email: [email-masked], [email-masked]