From unknown Mon Aug 11 19:02:12 2025 X-Loop: help-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 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-GNU-PR-Keywords: To: 37455@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.156885436122435 (code B ref -1); Thu, 19 Sep 2019 00:53:02 +0000 Received: (at submit) by debbugs.gnu.org; 19 Sep 2019 00:52:41 +0000 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 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 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 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: *** X-Spam-Status: No, score=3.4 required=5.0 tests=BAYES_50, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,SPOOFED_FREEMAIL,URIBL_BLOCKED autolearn=disabled version=3.3.2 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 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 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) 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) From: 'Ihor Radchenko' 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 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::52b X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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. Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: reddit.com] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [209.51.188.17 listed in list.dnswl.org] 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (yantar92[at]gmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (yantar92[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 2.4 SPOOFED_FREEMAIL No description available. X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) 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 From unknown Mon Aug 11 19:02:12 2025 X-Loop: help-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 Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Sep 2019 14:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37455 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 'Ihor Radchenko' Cc: 37455@debbugs.gnu.org Received: via spool by 37455-submit@debbugs.gnu.org id=B37455.156890231828280 (code B ref 37455); Thu, 19 Sep 2019 14:12:01 +0000 Received: (at 37455) by debbugs.gnu.org; 19 Sep 2019 14:11:58 +0000 Received: from localhost ([127.0.0.1]:56252 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iAxA5-0007M4-Os for submit@debbugs.gnu.org; Thu, 19 Sep 2019 10:11:57 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45504) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iAxA4-0007Lr-Fh for 37455@debbugs.gnu.org; Thu, 19 Sep 2019 10:11:57 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51704) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iAx9z-000580-Bc; Thu, 19 Sep 2019 10:11:51 -0400 Received: from [176.228.60.248] (port=3952 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iAx9y-0003T5-N5; Thu, 19 Sep 2019 10:11:51 -0400 Date: Thu, 19 Sep 2019 17:11:53 +0300 Message-Id: <83pnjwtlxy.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <87tv99az5y.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me> (message from 'Ihor Radchenko' on Thu, 19 Sep 2019 08:48:57 +0800) References: <87tv99az5y.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: 'Ihor Radchenko' > 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. From unknown Mon Aug 11 19:02:12 2025 X-Loop: help-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 Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Sep 2019 16:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37455 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 37455@debbugs.gnu.org Received: via spool by 37455-submit@debbugs.gnu.org id=B37455.156891183912655 (code B ref 37455); Thu, 19 Sep 2019 16:51:02 +0000 Received: (at 37455) by debbugs.gnu.org; 19 Sep 2019 16:50:39 +0000 Received: from localhost ([127.0.0.1]:56322 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iAzde-0003I2-Rv for submit@debbugs.gnu.org; Thu, 19 Sep 2019 12:50:39 -0400 Received: from mail-pl1-f170.google.com ([209.85.214.170]:36356) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iAzdc-0003Hl-HK for 37455@debbugs.gnu.org; Thu, 19 Sep 2019 12:50:37 -0400 Received: by mail-pl1-f170.google.com with SMTP id f19so1884681plr.3 for <37455@debbugs.gnu.org>; Thu, 19 Sep 2019 09:50:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=a5TX4yK9WRwYowDg0WMYco12DwHI6P//Ad0sB4A+B1c=; b=lOaQ8ZqIOaQSubUOIu8WjF5z+ls11PxaXCAfxyorVjlnXhpmBP9xWwjW3vDsqO7CDT fSbwar0MzMZCHrqLrO6A8vT0ybUkyUkyADZQC0ILMUPz6yrMe3FL14E1fNqxZhCtCJvU sxTywc0xUb3GccfNqK2ZV9q7ZL1afpZcFMrYbaCs5zduDvuMGR7c4SIvr4SxaO01fHTS rq6MwkXABkMat9R3iV19t9qpxpzkqvQgPzbNZ3gSxN4Z9JUeSQYNMYWCLZBiGSPF6ZSb iQO5jg8Yc8h6n0H681KIdyLeGobxWZfiCl72CG1pPXP7O4fKH45/TyXTJmvWG0fKC2lW 4gxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=a5TX4yK9WRwYowDg0WMYco12DwHI6P//Ad0sB4A+B1c=; b=sd9+UaBh3ELaIVSywezH+7bTAH2LLpMQGbxhL1Rr6tmZHNUNs8ZOHzirmgjch6zI9k wHMYRK7X5B1732J2CLgrOB1FWAhQwskgrD+Qo3T8Z+VL3ebQXaPVBzE13pamKANlT3XU BLF3Noglc6uiIomL4ISPsYUOIyGug3HYseat83jWD9HzMTJNBH73zYcg5rPCHT7OgKrZ h9GwJtgEx/Q9mDcEPJNyogvOuPXfYegLxSrRFHWyVKqTMkiZ9/WCGcSEbTlSqbhQ3fzB mVIi0V+PkNGi84BfvA8ESDSXlmmQBEZ1O23Bft9CtY9LtkRXkBifWgowlfmp4h/DMHRs Mmbw== X-Gm-Message-State: APjAAAV7jlif4ay+ohboPOZoWqTHlHRzhpoxxf/OBVqJcJbVBHhp0D0g SwVPkS8nU6Cv0AlH10g0JJ4= X-Google-Smtp-Source: APXvYqxlUd3JEXQiyU3IoHNYwV03HEApR+VrqZZAejea9j19wQCO5cHrw42XxFKscRSzjUHxJSWpPw== X-Received: by 2002:a17:902:7594:: with SMTP id j20mr2112086pll.231.1568911830514; Thu, 19 Sep 2019 09:50:30 -0700 (PDT) Received: from localhost ([45.56.153.56]) by smtp.gmail.com with ESMTPSA id f6sm8830813pga.50.2019.09.19.09.50.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Sep 2019 09:50:29 -0700 (PDT) From: Ihor Radchenko In-Reply-To: <83pnjwtlxy.fsf@gnu.org> References: <87tv99az5y.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me> <83pnjwtlxy.fsf@gnu.org> Date: Fri, 20 Sep 2019 00:46:52 +0800 Message-ID: <87ef0cb5dv.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 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 writes: >> From: 'Ihor Radchenko' >> 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 From unknown Mon Aug 11 19:02:12 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: 'Ihor Radchenko' Subject: bug#37455: closed (Re: bug#37455: 27.0.50; insert-behind-hooks and insert-in-front-hooks in text properties do nothing when font-lock-mode is on) Message-ID: References: <83h858tcj2.fsf@gnu.org> <87tv99az5y.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me> X-Gnu-PR-Message: they-closed 37455 X-Gnu-PR-Package: emacs Reply-To: 37455@debbugs.gnu.org Date: Thu, 19 Sep 2019 17:36:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1568914562-18136-1" This is a multi-part message in MIME format... ------------=_1568914562-18136-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #37455: 27.0.50; insert-behind-hooks and insert-in-front-hooks in text prop= erties do nothing when font-lock-mode is on which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 37455@debbugs.gnu.org. --=20 37455: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D37455 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1568914562-18136-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 37455-done) by debbugs.gnu.org; 19 Sep 2019 17:35:19 +0000 Received: from localhost ([127.0.0.1]:56378 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iB0Kt-0004hN-D8 for submit@debbugs.gnu.org; Thu, 19 Sep 2019 13:35:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44346) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iB0Ks-0004h3-NZ for 37455-done@debbugs.gnu.org; Thu, 19 Sep 2019 13:35:18 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:54003) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iB0Kn-00013f-Ia; Thu, 19 Sep 2019 13:35:13 -0400 Received: from [176.228.60.248] (port=4984 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iB0Km-0002mR-Jx; Thu, 19 Sep 2019 13:35:13 -0400 Date: Thu, 19 Sep 2019 20:35:13 +0300 Message-Id: <83h858tcj2.fsf@gnu.org> From: Eli Zaretskii To: Ihor Radchenko In-reply-to: <87ef0cb5dv.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me> (message from Ihor Radchenko on Fri, 20 Sep 2019 00:46:52 +0800) Subject: Re: bug#37455: 27.0.50; insert-behind-hooks and insert-in-front-hooks in text properties do nothing when font-lock-mode is on References: <87tv99az5y.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me> <83pnjwtlxy.fsf@gnu.org> <87ef0cb5dv.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 37455-done Cc: 37455-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Ihor Radchenko > Cc: 37455@debbugs.gnu.org > Date: Fri, 20 Sep 2019 00:46:52 +0800 > > Thanks! > I can confirm that the hooks work as expected in master. Thanks, I'm therefore closing this bug report. > "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? I don't see a serious enough reason to change names of these properties, which were introduced in Emacs 19(!). The person who wrote that raises many similar arguments, so I'm not surprised to hear this one. IOW, this ship has sailed decades ago, and it's too late to rename it now. Thanks. ------------=_1568914562-18136-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 19 Sep 2019 00:52:41 +0000 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 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 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 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: *** X-Spam-Status: No, score=3.4 required=5.0 tests=BAYES_50, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,SPOOFED_FREEMAIL,URIBL_BLOCKED autolearn=disabled version=3.3.2 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 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 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) 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) From: 'Ihor Radchenko' To: bug-gnu-emacs@gnu.org Subject: 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 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::52b X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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. Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: reddit.com] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [209.51.188.17 listed in list.dnswl.org] 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (yantar92[at]gmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (yantar92[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 2.4 SPOOFED_FREEMAIL No description available. X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) 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 ------------=_1568914562-18136-1--