unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#37455: 27.0.50; insert-behind-hooks and insert-in-front-hooks in text properties do nothing when font-lock-mode is on
@ 2019-09-19  0:48 'Ihor Radchenko'
  2019-09-19 14:11 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: 'Ihor Radchenko' @ 2019-09-19  0:48 UTC (permalink / raw)
  To: 37455

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.

Steps to reproduce (the font-lock part):
1. emacs -Q
2. Insert the following elisp into scratch (the code is from https://www.reddit.com/r/emacs/comments/d5waor/how_to_use_modification_hooks_in_text_properties/):

(defun test-property ()
  (put-text-property (point) (mark) 'insert-behind-hooks
		  (list (lambda (beg end)
			     (message "before %d %d" beg end))))
  (put-text-property (point) (mark) 'insert-in-front-hooks
		  (list (lambda (beg end)
			     (message "in front %d %d" beg end)))))

1. Select the region containing all the text in the scratch buffer
2. M-: (test-property) RET
3. Try to type anything
4. No message is shown
5. Disable font-lock-mode
6. Try to type anything
7. The message is shown

Regards,
Ihor

-- 
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






^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-09-19 17:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2019-09-19 17:35     ` Eli Zaretskii

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).