From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joost Kremers Newsgroups: gmane.emacs.devel Subject: Re: Q: Invisible text spec + define minor mode macro Date: Wed, 21 Apr 2021 11:36:10 +0200 Message-ID: <871rb4x8uj.fsf@fastmail.fm> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40265"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.5.11; emacs 27.2 Cc: emacs-devel@gnu.org To: Arthur Miller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Apr 21 11:54:23 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 1lZ9Ys-000AMZ-KF for ged-emacs-devel@m.gmane-mx.org; Wed, 21 Apr 2021 11:54:22 +0200 Original-Received: from localhost ([::1]:40322 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZ9Yr-0000Qk-M5 for ged-emacs-devel@m.gmane-mx.org; Wed, 21 Apr 2021 05:54:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44482) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZ9XZ-0008Av-Uk for emacs-devel@gnu.org; Wed, 21 Apr 2021 05:53:01 -0400 Original-Received: from out3-smtp.messagingengine.com ([66.111.4.27]:43957) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZ9XV-0000tW-Iy for emacs-devel@gnu.org; Wed, 21 Apr 2021 05:53:01 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 005AA5C0061; Wed, 21 Apr 2021 05:52:57 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 21 Apr 2021 05:52:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= references:from:to:cc:subject:date:in-reply-to:message-id :mime-version:content-type; s=fm3; bh=jYiQdn1emXnjzQ5YcmDTn/CGQx is6IfDlX+SshMSHrs=; b=sE+1LbbmQy7NhuYbwMs+Yi8NaLNx8UWSdD8DdXuL1d 4JPy5hzlVCIrP0dQ11BQWpiGIaGph9HG7MYfYXf6Nz5cjO5FNLhF8+EWKdGN6UvD 6nVc7KxYbuhpTGeyyelVu3cXc5DGUHKx3IPVmc4qKSIoVa5XuWhIC9gZS9eL2k0P y3RRFSbRhJ2kZUOHdJuBSEaHnHHbRwZ+Cxmgqa5KGPAHR1j3vKroJOWy30v7uoNW E0S3DO1HLMs3sGllNBwQmJxrQJQO8W9FHqL9OqeVKUrPiiEMEUUoU7I8rLFWLbR7 yIFl+jyIg/IYRbO6DGiVcicmL531fXVhr1jwzUT/iehg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=jYiQdn 1emXnjzQ5YcmDTn/CGQxis6IfDlX+SshMSHrs=; b=P09Gb30Lmk+j41e9OvxTnp 0TCoEzOTD4KLxcvWTD+UODBX3VhvvlI9chuRp6Z1ufvGMvhyFX2DSM3Kmt0/EDkd O3XrDpEjzMk0Z/qhsitGgGvZtxEdGE+yLQ8X0yeBy6yXUK3aDp01zPbBPO9vWwIM e2tQkqy1JUqNv09BHVqpr8uiZS/GHonqJb1oW0HPUzSAO/PmBgtb7pLFUvYjrnuW HkXmMb+pGleVtC3ZtQYueIrezM2u2WFYlh6719x+mYP9kT+fEAtH0jNTvQLjNq1I PAn/eXIKnVGi3MOddFlkbFpSx/Ts+BATMXia+KAfKgXVt+IxWaST3Tb8PAWDEVfQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvddtkedgvdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfhgfhffvufffjgfkgggtsehttdertddtredtnecuhfhrohhmpeflohhoshht ucfmrhgvmhgvrhhsuceojhhoohhsthhkrhgvmhgvrhhssehfrghsthhmrghilhdrfhhmqe enucggtffrrghtthgvrhhnpedviefhteeuveekudetheduieehvdelgfeijeehvdetfeeg leelhefhjeduieejveenucfkphepfedurddujedrvdehuddrudektdenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehjohhoshhtkhhrvghmvghr shesfhgrshhtmhgrihhlrdhfmh X-ME-Proxy: Original-Received: from Lenovo.fastmail.com (ip1f11fbb4.dynamic.kabel-deutschland.de [31.17.251.180]) by mail.messagingengine.com (Postfix) with ESMTPA id 1814B108005B; Wed, 21 Apr 2021 05:52:55 -0400 (EDT) In-reply-to: Received-SPF: pass client-ip=66.111.4.27; envelope-from=joostkremers@fastmail.fm; helo=out3-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=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:268224 Archived-At: On Wed, Apr 21 2021, Arthur Miller wrote: > I am not sure what is going on here. I have this minor mode defined, > as shown yesterday, where I just iterate through a buffer and try to > make certain lines invisible. Wouldn't it be easier to use the font lock mechanism for this? That way, you basically only need to worry about getting the regexp right. Finding matches, updating the display, etc. is all handled by Emacs. The `invisible' property is not normally handled by font lock, I guess, but there is a variable `font-lock-extra-managed-props', which, by the looks of it, should be able to remedy that. Mind you, I only understand the basics of the font lock mechanism and I haven't tried this, so it's possible this is a silly suggestion. It's just the first thing I'd try... -- Joost Kremers Life has its moments