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: Re: replace.el changes... Date: 23 Jun 2004 01:36:42 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <87llihotdc.fsf@mail.jurta.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1087947438 30991 80.91.224.253 (22 Jun 2004 23:37:18 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 22 Jun 2004 23:37:18 +0000 (UTC) Cc: juri@jurta.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Wed Jun 23 01:37: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 1BcupF-0007LF-00 for ; Wed, 23 Jun 2004 01:37:13 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BcupE-0007Bs-00 for ; Wed, 23 Jun 2004 01:37:12 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BcuqY-0006Xd-Ul for emacs-devel@quimby.gnus.org; Tue, 22 Jun 2004 19:38:34 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BcuqQ-0006XM-Vf for emacs-devel@gnu.org; Tue, 22 Jun 2004 19:38:27 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BcuqQ-0006X3-CG for emacs-devel@gnu.org; Tue, 22 Jun 2004 19:38:26 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BcuqQ-0006X0-A7 for emacs-devel@gnu.org; Tue, 22 Jun 2004 19:38:26 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Bcuot-0003H1-4M for emacs-devel@gnu.org; Tue, 22 Jun 2004 19:36:51 -0400 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.34) id 1Bcuom-0004Ec-6q; Tue, 22 Jun 2004 19:36:44 -0400 Original-To: rms@gnu.org In-Reply-To: Original-Lines: 52 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 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:25199 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:25199 Richard Stallman writes: > If a replacement has already been done, the stored information in the > history does not contain the highlighted region. > > Could you please be more explicit? What is "the history" that you > refer to? Does it have a name? `stack'. It contains point and match-data for previous replacements that did not yet happen (and for those that did happen, just t instead of the match data). You can revisit previous replacements by using ^. > Where is it documented? Nowhere. It's in the code of perform-replace, and it may be the return value under certain conditions. The return value is just documented as being non-nil or nil under circumstances. I have not seen any use of that return value, and actually the description of the return value is incorrect, anyway: "This function returns nil if and only if there were no matches to make, or the user didn't cancel the call." Actually, the function returns nil if and only of there were no matches to make, or the user _did_ cancel the call. > It is actually not documented to be useful, except as being nil or > non-nil. And even then, it is only documented for perform-replace > itself (the internal routine doing the job). > > If it is not documented, people can't complain if we change it. Oh, of course they can't complain. There is just a non-zero risk of things breaking. I could not see any direct use of the return value of perform-replace (which is just documented as being non-nil under certain conditions), but perform-replace is called as the last thing in many replacement routines, so all of them return its return value, too. Now none of those callers actually documents _any_ return value at all, so we get into trouble only if people actually read the code and deduced things about it. But I have not made a complete survey of all uses of _callers_ of perform-replace. I consider it highly unlikely that there is any that would not only use the return value, but even use details of it. But highly unlikely is not impossible. I judged the risk small enough that the code I posted uses a different format of the list. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum