From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thomas Lord Newsgroups: gmane.emacs.help Subject: are there hooks for text becoming visible or hidden in a given window? Date: Thu, 24 Feb 2022 14:25:39 -0800 Message-ID: <06e7c939da37479902e9a935fbaf487a@basiscraft.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2926"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Roundcube Webmail/1.3.17 To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 24 23:26:15 2022 Return-path: Envelope-to: geh-help-gnu-emacs@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 1nNMYv-0000bI-FX for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 24 Feb 2022 23:26:13 +0100 Original-Received: from localhost ([::1]:58174 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nNMYt-00043p-PG for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 24 Feb 2022 17:26:11 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:52126) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nNMYV-00043Q-5I for help-gnu-emacs@gnu.org; Thu, 24 Feb 2022 17:25:47 -0500 Original-Received: from d.mail.sonic.net ([64.142.111.50]:49736) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nNMYS-00012N-Lw for help-gnu-emacs@gnu.org; Thu, 24 Feb 2022 17:25:46 -0500 Original-Received: from webmail.sonic.net (webmail.b.apps.sonic.net [64.142.122.9]) (authenticated bits=0) by d.mail.sonic.net (8.16.1/8.16.1) with ESMTPA id 21OMPdHC029490; Thu, 24 Feb 2022 14:25:40 -0800 X-Sonic-Auth: mYILDSeZaBIaj8vKZjgNY3jgl7GGHJxq/3SfiSPtOJAjDNVnihsjE4EZ4ahjFdcF2k1b4RfgEYqohrVcHoDzQZqSrq5bSWvU2MARJ3katvA= X-Sonic-CAuth: UmFuZG9tSVYFjcotIo7+P4iMw0YZL3+yuAnahGTGohnJU9ZuePKx3Ua4GX5j3K614wJGryt24sJpPnwU6/H5N0vlp6mZ8TS5z6sjcY6R8n0= X-Sonic-ID: C;WH1WssCV7BG4h4TqnrBhEg== M;MMxcssCV7BG4h4TqnrBhEg== X-Sonic-Spam-Details: -0.0/5.0 by cerberusd Received-SPF: none client-ip=64.142.111.50; envelope-from=lord@basiscraft.com; helo=d.mail.sonic.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:136182 Archived-At: Dear Emacs Lisp hackers, Is there a way to mark a region of text in a buffer, so that when that text becomes visible in any window, or when it stops being visible, a hook is called and provided the location of the text in the buffer, and the window in which its visibility has changed? I would like to implement a feature that when certain text changes visibility, the contents of separate buffer are automatically changed. For example, if a markdown image link scrolls into view in one buffer, the image itself would appear in a second window, but disappear from the second window if the link is deleted or scrolled outside of the window. I couldn't find anything like this and I don't see a clean alternative. Watching scroll events would only cover part of the problem and I'm worried about the interactive performance of having to frequently search the range of visible text for text with a certain property or within a certain overlay. Thanks, -t