From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.devel Subject: Re: Q: Invisible text spec + define minor mode macro Date: Wed, 21 Apr 2021 22:14:07 +0200 Message-ID: References: <83eef4q9or.fsf@gnu.org> <871rb3s9dq.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14763"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (windows-nt) Cc: emacs-devel@gnu.org To: Tassilo Horn Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Apr 21 22:14:50 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lZJFK-0003k3-9i for ged-emacs-devel@m.gmane-mx.org; Wed, 21 Apr 2021 22:14:50 +0200 Original-Received: from localhost ([::1]:54278 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZJFJ-0007i2-9t for ged-emacs-devel@m.gmane-mx.org; Wed, 21 Apr 2021 16:14:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53338) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZJEj-0007IC-MQ for emacs-devel@gnu.org; Wed, 21 Apr 2021 16:14:13 -0400 Original-Received: from mail-db8eur05olkn2108.outbound.protection.outlook.com ([40.92.89.108]:13952 helo=EUR05-DB8-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZJEh-0001lE-Rk; Wed, 21 Apr 2021 16:14:13 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IjGfNDJLJrDfVxT7taPs/42OpHIsObov99RvKDPGX4jorXzjljxWphhND92zy5HcS6Bb1V8c1VRU/S4niyfoFyqWtJDi0sAl5dmJ4RDrKonXsNSPB5QO65BT0cySvfnZ8f5Cn5CZ42Bic9jAkQLz5EvTFIF9gUeWySo7m/WAc+LCXIWdbgnodU+18Qgszb4eD7wKoya530tDq2p0iMAFWPm7manoNbZsQDkqgxhmjnV7X/qS716oMHpHnFI49G875QWiCY8HWxRw4smnjrQ6Fk+j6ndrFVDL6j4Ihzm4c0IQbpEGl5FwAP70HVPHaRQA56lx2PzJZH+nzOT4yKt12g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0c06Tnl8t7nIYWDXngzeZk3I5dZaCgoQWK3XuIWnHRQ=; b=mf7nK5BsBit8MfHv1Yv8aBaqShAwbYXCu5yyyJs0paHQr/7JdpKnTzZSh7R0AXM13ALUS9ddyXSFsXhNBlc8svDklJM3lL+B/YGd0LyYmXTuSo3DpSHwz5nMe51fFbQzAov2ITSRNeYijba2r4Xwmp1IZUK1ScJdNZXfM0B8Jgy7+qwoXamvcCcPkV/14oeXTejTvKhwx/zvX4xHIznFamzUTkGDiE6L2OWSJmuxVooVGlBnLFeBSossmOoWYW/tu5NFsWdcEdJAEdgHi8XjfN30q7CIzp3if5+wwarpRDAruekQz/7kkgRtrqsIv6JkB/31apCpXsnUE17bNJHhyQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0c06Tnl8t7nIYWDXngzeZk3I5dZaCgoQWK3XuIWnHRQ=; b=kF4hueQK4nIKdlWI3odcNM9828EqEU41XR+cFjLwWsi/xMDh/kpa0qFpMaWZDnwNCgUEpQlcilY4YX//oXGP5fr4ro9jm9pRFCqEhi+zdaRy8h1VCpsVjn9C+Eurc0f+GqNdL1R+aJtIPKb7VkN1ENGyZc4N7oqJxsYLn+71R4iPzD4GRtDzyAAPGVYq0/AUGVXIO9DFLxVlTN5poKHaqCia2C6ghz9WpR4A+PxHYqESvRX/XkF+QQT4Dyw/JliwxYyRxkB/wyutZWzdM4xZjXkGtoIS9ICdQH46Pr9Xp9vVeA4K1Qxx8G6EwuUnHNJKoQlH9OrDdu8YQYl3gXFnRg== Original-Received: from DB8EUR05FT012.eop-eur05.prod.protection.outlook.com (2a01:111:e400:fc0f::44) by DB8EUR05HT134.eop-eur05.prod.protection.outlook.com (2a01:111:e400:fc0f::210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21; Wed, 21 Apr 2021 20:14:09 +0000 Original-Received: from DB9PR09MB4986.eurprd09.prod.outlook.com (2a01:111:e400:fc0f::4a) by DB8EUR05FT012.mail.protection.outlook.com (2a01:111:e400:fc0f::257) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21 via Frontend Transport; Wed, 21 Apr 2021 20:14:09 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:987E04DA3F8E3884DD05B71AA962602E0A7EFC14F17E51BC0FFA00335C5D9596; UpperCasedChecksum:0B1710BC7FD2AF93736CEDD9589A89E77F10A9F199C02BBA2C9285268463CE50; SizeAsReceived:8749; Count:47 Original-Received: from DB9PR09MB4986.eurprd09.prod.outlook.com ([fe80::8199:d67e:e470:b73e]) by DB9PR09MB4986.eurprd09.prod.outlook.com ([fe80::8199:d67e:e470:b73e%7]) with mapi id 15.20.4065.020; Wed, 21 Apr 2021 20:14:09 +0000 In-Reply-To: <871rb3s9dq.fsf@gnu.org> (Tassilo Horn's message of "Wed, 21 Apr 2021 21:25:58 +0200") X-TMN: [LMOE0AUeebxQ89CH9aZBmgv79CoMnnBS] X-ClientProxiedBy: AM6P191CA0104.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:8a::45) To DB9PR09MB4986.eurprd09.prod.outlook.com (2603:10a6:10:2a9::19) X-Microsoft-Original-Message-ID: <82eef3wg34.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from HP-Laptop.homepc (81.232.177.30) by AM6P191CA0104.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:8a::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21 via Frontend Transport; Wed, 21 Apr 2021 20:14:08 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 47 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: d9057782-ae60-4f2e-0426-08d905020589 X-MS-TrafficTypeDiagnostic: DB8EUR05HT134: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: u+ZKT10sYvLW08v3ydzacfpxo+/3Akez5D9rtf10+SkKWJAD0+77SA3Oc70FMDZ/VxgiRXDMelLx/ekRFKTdm8I+HjN9XSE0aSVS7d3cmtsLWBXkvvQvBV4PDRrYIvLf+wbQB+dLEiT/S7x6eIiKNF5ihhDFwmi4bS/NcmOTID3O6oahU3XVa90I+QZeb0yKyStRC97u7MO1uW3vaJ/a6B4s25TB0pFXYZYzR3iPEseRyaZd7N94GTKWMZKEEmEWG/GNGMzEyW5QYoTsN+Ob1UBRFHC2zP3PqXh8pb+/055EgStaYe+4ekr97eOx/g0DD6YYrDO1dLMfxe4sUQruYo7wDfr4pW9FS/xftol1qSPyG5Fr7ViB66Xh8CvUgL9Gs/qHCrJKcahPtliPq/rBTw== X-MS-Exchange-AntiSpam-MessageData: NCuLIEqYnZS1QupJlS3uioxwIXShIywTT5SkKLjuWWNFrjUcFqj26Wny3SUubLjJVzal4KSILl4CBp/GSGTdAuhb262fY6A2pACyO/GBcrEqvrDHdL/RQx86R3zU1v5h6CsfvUkTHf+sHB47zYtI3A== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: d9057782-ae60-4f2e-0426-08d905020589 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Apr 2021 20:14:09.4497 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: DB8EUR05FT012.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8EUR05HT134 Received-SPF: pass client-ip=40.92.89.108; envelope-from=arthur.miller@live.com; helo=EUR05-DB8-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:268253 Archived-At: Tassilo Horn writes: > Arthur Miller writes: > > Hi Arthur, > >> After playing a bit more: if I scroll through entire file before I >> enable my mode, then entire file is processed correctly. But if file >> is not scrolled through, then only 3=C2=BD screen pages are processed. = Has >> nothing to do with regex I use, just with text being shown on screen >> or not. I don't find anything in docs about that. A bug? Or >> undocumented behaviour? Or something else I am missing here? > > I've tried it and can confirm your observations. Your code is correct, > though. The funcion `hbm--update-line' is called 400 times at the right > positions and puts the 'invisible text property there. > > Then I augmented that function to spit out the `buffer-substring' where > it puts the property, and that showed that lines became invisible where > the text was already fontified such as > > #("#+end_src" 0 4 (fontified t font-lock-fontified t > font-lock-multiline t face org-block-end-line wrap-prefix #("#" 0 1 > (face org-block-end-line font-lock-multiline t font-lock-fontified t > fontified t))) 4 9 (fontified t font-lock-fontified t > font-lock-multiline t face org-block-end-line wrap-prefix #("#" 0 1 > (face org-block-end-line font-lock-multiline t font-lock-fontified t > fontified t)))) > > and stopped working at the next line > > #("#+begin_src emacs-lisp" 0 22 (fontified nil)) > > which is not yet fontified. And indeed, as soon as you disable > `font-lock-mode' your minor mode starts working fine. (With > `font-lock-mode', you can "unhide" a line also by editing in it which > will trigger refontification of that region.) > > The problem is in Org: it has tons of fontification functions such as > `org-fontify-meta-lines-and-blocks' which calls > `org-fontify-meta-lines-and-blocks-1' which removes `display', > `invisible', and `intangible' text properties. > > So it seems you cannot use those properties in a sensible way in org > files... > > Bye, > Tassilo Thank you very much for looking through it and clarifying what happens. Eli also explained in the bug repport what is going on. I will try with custom visibility spec instead and see if I can keep my property that way :). Thanks!