From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Masatake YAMATO Newsgroups: gmane.emacs.devel Subject: Re: overlay-start > overlay-end Date: Tue, 23 Mar 2004 17:45:01 +0900 (JST) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <20040323.174501.129085852.jet@gyve.org> References: <20040322.170035.233401763.jet@gyve.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1080033145 24090 80.91.224.253 (23 Mar 2004 09:12:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 23 Mar 2004 09:12:25 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue Mar 23 10:12:16 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1B5hxI-0003Nn-00 for ; Tue, 23 Mar 2004 10:12:16 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1B5hxI-00077N-00 for ; Tue, 23 Mar 2004 10:12:16 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B5hty-000589-Uq for emacs-devel@quimby.gnus.org; Tue, 23 Mar 2004 04:08:50 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1B5htA-00057Z-VJ for emacs-devel@gnu.org; Tue, 23 Mar 2004 04:08:00 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1B5hn6-0004K5-Ln for emacs-devel@gnu.org; Tue, 23 Mar 2004 04:02:15 -0500 Original-Received: from [210.130.136.40] (helo=r-maa.spacetown.ne.jp) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B5hX5-0001OE-Hg; Tue, 23 Mar 2004 03:45:11 -0500 Original-Received: from localhost ([219.120.63.249]) by r-maa.spacetown.ne.jp (8.11.6) with ESMTP id i2N8j3H18603; Tue, 23 Mar 2004 17:45:03 +0900 (JST) Original-To: rms@gnu.org In-Reply-To: X-Mailer: Mew version 4.0.62 on Emacs 21.3.50 / Mule 5.0 (SAKAKI) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 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:20773 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:20773 > + /* Canonicalize the order of start and end. */ > + if (tail) > + { > > This fixes just one overlay. What if there are several > such overlays? I think it is necessary to have a loop > here, to fix as many broken overlays as there may be. Thank you for suggestion. I found a function for the purpose: fix_overlays_in_range. I put it inside `fix_overlays_before'. Instead I put it to the upper level function. BTW, how do you think changing function names: fix_overlays_in_range => fix_start_end_in_overlays fix_overlays_before => fix_order_of_overlays_in_buffer Both functions fix orders. However the scope(target?) of order is different; fix_overlays_in_range fixes the order inside an overlay and fix_overlays_before fixed the order insdie buffer's overlay list. The function names don't show the difference of scope. Regards, Masatake YAMATO cvs diff: warning: unrecognized response `access control disabled, clients can connect from any host' from cvs server Index: src/insdel.c =================================================================== RCS file: /cvsroot/emacs/emacs/src/insdel.c,v retrieving revision 1.176 diff -u -r1.176 insdel.c --- src/insdel.c 1 Sep 2003 15:45:52 -0000 1.176 +++ src/insdel.c 23 Mar 2004 08:37:12 -0000 @@ -441,9 +441,13 @@ } /* Adjusting only markers whose insertion-type is t may result in - disordered overlays in the slot `overlays_before'. */ + - disordered start and end in overlays, and + - disordered overlays in the slot `overlays_before' of current_buffer. */ if (adjusted) - fix_overlays_before (current_buffer, from, to); + { + fix_overlays_in_range(from, to); + fix_overlays_before (current_buffer, from, to); + } } /* Adjust point for an insertion of NBYTES bytes, which are NCHARS characters.