From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: 'Ihor Radchenko' Newsgroups: gmane.emacs.bugs 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: Thu, 19 Sep 2019 08:48:57 +0800 Message-ID: <87tv99az5y.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="149178"; mail-complaints-to="usenet@blaine.gmane.org" To: 37455@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Sep 19 02:53:12 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iAkh5-000cg9-BG for geb-bug-gnu-emacs@m.gmane.org; Thu, 19 Sep 2019 02:53:11 +0200 Original-Received: from localhost ([::1]:36522 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iAkh3-0004XH-TI for geb-bug-gnu-emacs@m.gmane.org; Wed, 18 Sep 2019 20:53:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42387) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iAkgx-0004Vq-Kn for bug-gnu-emacs@gnu.org; Wed, 18 Sep 2019 20:53:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iAkgw-0007bR-Ee for bug-gnu-emacs@gnu.org; Wed, 18 Sep 2019 20:53:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46158) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iAkgw-0007bH-BG for bug-gnu-emacs@gnu.org; Wed, 18 Sep 2019 20:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iAkgw-0005qN-6x for bug-gnu-emacs@gnu.org; Wed, 18 Sep 2019 20:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: 'Ihor Radchenko' Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Sep 2019 00:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 37455 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.156885436122435 (code B ref -1); Thu, 19 Sep 2019 00:53:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Sep 2019 00:52:41 +0000 Original-Received: from localhost ([127.0.0.1]:54979 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iAkga-0005pl-1c for submit@debbugs.gnu.org; Wed, 18 Sep 2019 20:52:40 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:43587) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iAkgY-0005pd-Ac for submit@debbugs.gnu.org; Wed, 18 Sep 2019 20:52:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42291) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iAkgX-0004Cj-2a for bug-gnu-emacs@gnu.org; Wed, 18 Sep 2019 20:52:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iAkgV-00076l-Mw for bug-gnu-emacs@gnu.org; Wed, 18 Sep 2019 20:52:36 -0400 Original-Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]:43728) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iAkgV-00076L-HI for bug-gnu-emacs@gnu.org; Wed, 18 Sep 2019 20:52:35 -0400 Original-Received: by mail-pg1-x52b.google.com with SMTP id u72so822713pgb.10 for ; Wed, 18 Sep 2019 17:52:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=Tx5gWOKwk6YCpF12So3iOa6G9FCfP+jUOmzBM1in57w=; b=esIUR4K0zWi8Q/f/TIFrlgdNK47ZMITNv7cioCByaju32lxhLG2YlkdEf3Ht9bd7wr emFBGny2y0RCd3np1Dkt8DKRQ/cjJlXgbQdWwQ8gM7X9eqJd9s7TM0FHz9cT0ZEYibLY z49dl60/Lqv5JkaExzvuwHTsu2MZ8PFDsJgcprLUzg4mqIcOovqvqB2BniEDA5COUqtL xEMPGWWO0aJ/9gva8WXqDAZQPANnwrG4RhHs112fUmGpva9TGffnojJP4yUCAOZ6oHab PSGyz16i960IELzFEX0wt6ybkiuJktRvXzdbS/nal6uZfnIf3AqjFnBhfXvRmjVQXKJ/ MQHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=Tx5gWOKwk6YCpF12So3iOa6G9FCfP+jUOmzBM1in57w=; b=ujDAJT9F0bpJY7Jd723kcW1FIEwwKnGG8VJY2qD1dUOJJOdTej+TNQlpocyxtNijA6 AZmDdp4OYOWGHRfQIET9Fe58z6h6f5nwSK2D4kunC3otPuJ/f1UbrJS7ceNwUe2qHPV1 2Yy2VYtDg9/2YzFkgH5SEBnrYPDbrleu2q1XCCBZ0iGEfJhzaIJxa10+9Yi45noD57lc dBZLUv711qZu56CspJqpURxTD4WePAQ+w3yB9yxjFMFRd0COtYUKzSJ2F0u/6rb8lWMf c6rGe8Yy+RTTn4WrbRZ9rkYfrRwu4FYHTiv0eBX/SfJsYGoPRZUYOwypZr7wXDy23UCY P/dA== X-Gm-Message-State: APjAAAXaQdKD0qK3y/v6wUP2/tZ+seFi98MXVTka9lEiT5MX/W73nnrj W3ep1JOFHUFVL92MCJvhrVB4+29PJAU= X-Google-Smtp-Source: APXvYqxCNgc8j1QPwef9Vnv4OphpVAzk1o2di38c9zClcmqSI0mMeoYmkbgbkVReDpVkR9ZSP9gE4Q== X-Received: by 2002:a63:9557:: with SMTP id t23mr6518813pgn.236.1568854353985; Wed, 18 Sep 2019 17:52:33 -0700 (PDT) Original-Received: from localhost ([45.56.153.56]) by smtp.gmail.com with ESMTPSA id r18sm10906409pfc.3.2019.09.18.17.52.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Sep 2019 17:52:33 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:166696 Archived-At: 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