unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
Cc: juri@jurta.org, emacs-devel@gnu.org
Subject: Re: replace.el changes...
Date: 23 Jun 2004 01:36:42 +0200	[thread overview]
Message-ID: <x5u0x3xj05.fsf@lola.goethe.zz> (raw)
In-Reply-To: <E1BcuVe-0001ai-St@fencepost.gnu.org>

Richard Stallman <rms@gnu.org> 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

  reply	other threads:[~2004-06-22 23:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-21 14:05 replace.el changes David Kastrup
2004-06-21 14:55 ` Juri Linkov
2004-06-21 15:10   ` David Kastrup
2004-06-22  9:48     ` Juri Linkov
2004-06-22  9:55       ` David Kastrup
2004-06-22 23:16     ` Richard Stallman
2004-06-22 23:36       ` David Kastrup [this message]
2004-06-24 23:48         ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=x5u0x3xj05.fsf@lola.goethe.zz \
    --to=dak@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=juri@jurta.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).