all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 37455@debbugs.gnu.org
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
Date: Fri, 20 Sep 2019 00:46:52 +0800	[thread overview]
Message-ID: <87ef0cb5dv.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me> (raw)
In-Reply-To: <83pnjwtlxy.fsf@gnu.org>

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 <eliz@gnu.org> writes:

>> From: 'Ihor Radchenko' <yantar92@gmail.com>
>> 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: yantar92@gmail.com, ihor_radchenko@alumni.sutd.edu.sg





  reply	other threads:[~2019-09-19 16:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-19  0:48 bug#37455: 27.0.50; insert-behind-hooks and insert-in-front-hooks in text properties do nothing when font-lock-mode is on 'Ihor Radchenko'
2019-09-19 14:11 ` Eli Zaretskii
2019-09-19 16:46   ` Ihor Radchenko [this message]
2019-09-19 17:35     ` 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=87ef0cb5dv.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me \
    --to=yantar92@gmail.com \
    --cc=37455@debbugs.gnu.org \
    --cc=eliz@gnu.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.