From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: match-data confusion... Date: 18 Jun 2004 12:10:42 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1087553478 20387 80.91.224.253 (18 Jun 2004 10:11:18 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 18 Jun 2004 10:11:18 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Fri Jun 18 12:11:13 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 1BbGL3-0005Mx-00 for ; Fri, 18 Jun 2004 12:11:13 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BbGL3-0004ky-00 for ; Fri, 18 Jun 2004 12:11:13 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BbGM8-0000zS-Dv for emacs-devel@quimby.gnus.org; Fri, 18 Jun 2004 06:12:20 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BbGM2-0000wK-IM for emacs-devel@gnu.org; Fri, 18 Jun 2004 06:12:14 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BbGM1-0000u7-Ei for emacs-devel@gnu.org; Fri, 18 Jun 2004 06:12:13 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BbGM1-0000tX-1c for emacs-devel@gnu.org; Fri, 18 Jun 2004 06:12:13 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BbGKa-00059U-Er for emacs-devel@gnu.org; Fri, 18 Jun 2004 06:10:44 -0400 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.34) id 1BbGKZ-00041i-NN for emacs-devel@gnu.org; Fri, 18 Jun 2004 06:10:44 -0400 Original-To: emacs-devel@gnu.org Original-Lines: 35 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:25078 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:25078 I am having a problem with getting stuff right in replace.el. The problem is that (match-data t) is basically dangerous since it is lacking the information to restore last_thing_searched. But that means that (set-match-data (match-data t)) is not a noop, even if the buffer is not changed in between since the restored match-data stops being adjust when buffer changes occur before it. Two possible amendments: one thing would be to add the buffer itself as a list element into match-data. That might be an incompatible change, however. The second one would be to allow an optional argument to set-match-data that specifies a buffer, so that (set-match-data (match-data t) buffer) will set last_thing_searched to the specified buffer again. As it is, I will probably have to write a special purpose function in replace.el for now that looks like (defun replace-set-match-data (match-data) (if (integerp (car match-data)) (let ((marker (make-marker))) (set-marker marker (car match-data)) (set-match-data (cons marker (cdr match-data))) (set-marker marker nil)) (set-match-data match-data))) which is pretty ugly and relies on some internals to stay the way they are now. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum