From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Re: Info mutilates user overlays. Date: Wed, 1 Oct 2003 16:11:11 -0500 (CDT) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200310012111.h91LBBG03258@raven.dms.auburn.edu> References: <200310010216.h912Ge027788@raven.dms.auburn.edu> <200310011449.h91EnBN28933@raven.dms.auburn.edu> <200310011914.h91JEZU01874@raven.dms.auburn.edu> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1065047488 29007 80.91.224.253 (1 Oct 2003 22:31:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 1 Oct 2003 22:31:28 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Oct 02 00:31:23 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1A4pVD-0000kF-00 for ; Thu, 02 Oct 2003 00:31:23 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1A4pVD-00041s-00 for ; Thu, 02 Oct 2003 00:31:23 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1A4os4-0003pz-KB for emacs-devel@quimby.gnus.org; Wed, 01 Oct 2003 17:50:56 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1A4oru-0003oj-Ek for emacs-devel@gnu.org; Wed, 01 Oct 2003 17:50:46 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1A4orO-0003hT-C2 for emacs-devel@gnu.org; Wed, 01 Oct 2003 17:50:45 -0400 Original-Received: from [199.232.41.8] (helo=mx20.gnu.org) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1A4oSX-0007YM-Cm for emacs-devel@gnu.org; Wed, 01 Oct 2003 17:24:33 -0400 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by mx20.gnu.org with esmtp (Exim 4.24) id 1A4oJK-0003Rv-Nf for emacs-devel@gnu.org; Wed, 01 Oct 2003 17:15:02 -0400 Original-Received: from raven.dms.auburn.edu (raven.dms.auburn.edu [131.204.53.29]) by manatee.dms.auburn.edu (8.12.10/8.12.10) with ESMTP id h91LF0AJ018209; Wed, 1 Oct 2003 16:15:00 -0500 (CDT) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.6+Sun/8.11.6) id h91LBBG03258; Wed, 1 Oct 2003 16:11:11 -0500 (CDT) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: monnier@IRO.UMontreal.CA In-reply-to: (message from Stefan Monnier on 01 Oct 2003 15:54:34 -0400) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:16836 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:16836 Stefan Monnier wrote: Please: *how* do you highlight ? Did you create some commands similar to what is available under M-g but using overlays, or do you add the overlay from a hook, or ... The user would use some interactive command, say `M-x scan-buf-char-property-regions', or a key sequence bound to it. I have a command `scan-buf-update-char-region-overlays' that updates _all_ highlighting produced by the previous and similar commands, in the accessible portion of the current buffer. (Except that I still have to make the updating work better for narrowed buffers with different pieces highlighted differently.) Maybe just adding the updating command to the right hook might solve the problem. I will take a look whether any hook is automatically called in the given situation. Otherwise, the user could call the updating command, if he wants the highlighting restored. I keep track of the overlays by giving them a "private" 'scan-buf-char-property-regions property, so I know which overlays were made by the function and I can delete them as necessary. The highlighting is actually _meant_ to be temporary (to get an idea of which text properties are present in the buffer), but it is somewhat inconvenient if it disappears after, say, quickly following a reference and then a quick `l' to get back. As I said though, updating everything is convenient for the user and could be made automatic using some hook. I could set a timer, but in read-only buffers that would lead to a lot of completely needless deletion and re-creation of overlays, generating garbage to be collected and it will normally be obvious to the user when the buffer has changed and needs to be updated. Sincerely, Luc.