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: Fri, 20 Sep 2019 00:46:52 +0800 Message-ID: <87ef0cb5dv.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me> References: <87tv99az5y.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me> <83pnjwtlxy.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="139317"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 37455@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Sep 19 18:51:21 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 1iAzeI-000a4Z-Sr for geb-bug-gnu-emacs@m.gmane.org; Thu, 19 Sep 2019 18:51:19 +0200 Original-Received: from localhost ([::1]:46548 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iAzeH-0004c9-7d for geb-bug-gnu-emacs@m.gmane.org; Thu, 19 Sep 2019 12:51:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46327) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iAze5-0004XS-3A for bug-gnu-emacs@gnu.org; Thu, 19 Sep 2019 12:51:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iAze3-0001fx-Qm for bug-gnu-emacs@gnu.org; Thu, 19 Sep 2019 12:51:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47501) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iAze3-0001fj-LA for bug-gnu-emacs@gnu.org; Thu, 19 Sep 2019 12:51:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iAze2-0003Il-4n for bug-gnu-emacs@gnu.org; Thu, 19 Sep 2019 12:51:03 -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 16:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37455 X-GNU-PR-Package: emacs Original-Received: via spool by 37455-submit@debbugs.gnu.org id=B37455.156891183912655 (code B ref 37455); Thu, 19 Sep 2019 16:51:02 +0000 Original-Received: (at 37455) by debbugs.gnu.org; 19 Sep 2019 16:50:39 +0000 Original-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 Original-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 Original-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) Original-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) In-Reply-To: <83pnjwtlxy.fsf@gnu.org> 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:166722 Archived-At: 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