From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: compare-windows - synchronize points Date: Wed, 13 Aug 2003 23:07:04 -0400 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <87adagx8x8.fsf@mail.jurta.org> <87oeyuuuvz.fsf@mail.jurta.org> Reply-To: rms@gnu.org NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1060830691 21175 80.91.224.253 (14 Aug 2003 03:11:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 14 Aug 2003 03:11:31 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Aug 14 05:11:29 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 19n8WP-0003tI-00 for ; Thu, 14 Aug 2003 05:11:29 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 19n8Wi-00029F-00 for ; Thu, 14 Aug 2003 05:11:52 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19n8UZ-00064H-N8 for emacs-devel@quimby.gnus.org; Wed, 13 Aug 2003 23:09:35 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19n8UM-00063v-0K for emacs-devel@gnu.org; Wed, 13 Aug 2003 23:09:22 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19n8Tq-00062E-GL for emacs-devel@gnu.org; Wed, 13 Aug 2003 23:09:21 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19n8Tq-000628-Ay for emacs-devel@gnu.org; Wed, 13 Aug 2003 23:08:50 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.20) id 19n8S8-0002b9-UQ; Wed, 13 Aug 2003 23:07:04 -0400 Original-To: Juri Linkov In-reply-to: <87oeyuuuvz.fsf@mail.jurta.org> (message from Juri Linkov on 13 Aug 2003 05:57:36 +0300) 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:15936 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:15936 I've used it also on human-language texts with differences in some words and with the value of compare-windows-sync set to `forward-sentence', and on Lisp programs with the value set to 'end-of-defun'. I think that end-of-defun would move too far--the end of the defun can easily be 100 lines down. This would be quite likely to overlook further interesting differences. > Another idea I have for syncing up is that a program could use a > simple quadratic algorithm to find the first matching 4-character > string in the two buffers, and move there. This might get painfully > slow when there are substantial insertions, though. If it tried syncing up by comparing entire lines, it could handle even quite large changes fairly fast. Would you like to give that a try? Currently the variable compare-windows-sync has no -function suffix, because it can hold whether a function or a regexp. Have you found the regexp case to be useful in any real situation?