From: Juri Linkov <juri@linkov.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: laszlomail@protonmail.com, 52558@debbugs.gnu.org
Subject: bug#52558: Option for easier typing of regexps
Date: Wed, 29 Dec 2021 19:17:51 +0200 [thread overview]
Message-ID: <86v8z71gao.fsf@mail.linkov.net> (raw)
In-Reply-To: <83bl0zlhgn.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 29 Dec 2021 14:32:24 +0200")
>> >> >> +(defvar replace-regexp-function nil
>> >> >> + "Function to convert a search string to a regexp to replace.
>> >> >> +It's bound to `isearch-regexp-function' when searching
>> >> >> +for a string to replace.")
>> >> >
>> >> > The first sentence is unclear: what do you mean by "convert a search
>> >> > string to a regexp to replace"? What "search string" is being
>> >> > converted to regexp, and how does "replace" enter this picture?
>> >>
>> >> It has a reference to `isearch-regexp-function' that has
>> >> a complete explanation to avoid duplication of the docstring.
>> >
>> > I don't think this is enough. First, the first sentence of the above
>> > doc string doesn't have any such reference, so Apropos commands, which
>> > show only the first sentence, will not have that reference.
>>
>> But "isearch-regexp-function" is too long for the first sentence.
>
> Yes. But I didn't mean to include that name in the first sentence, I
> meant to say that we should say there something to better explain the
> purpose.
>
>> > And second, the doc string of isearch-regexp-function says nothing
>> > about replacements.
>>
>> It should say nothing about replacements. This is explained
>> in the second sentence:
>>
>> `isearch-regexp-function' is bound to it when searching
>> for a string to replace.
>
> So we have now made a full circle, and came back to what I said
> initially: "searching for a string to replace" doesn't explain itself,
> because the relevance of this to some search of a string and to some
> replacement is not clear.
>
> How about if you try to explain it to me in your own words, without
> paying attention to the constraints of a doc string, and I will then
> try to propose a more formal wording?
query-replace uses isearch functions to search the next occurrence to replace.
The new variable replace-regexp-function is intended just to set
the value of isearch-regexp-function that is used by isearch functions.
And isearch-regexp-function already has 18 lines of its docstring
that explains all details. This is why it's important to have a link
to isearch-regexp-function in the docstring of replace-regexp-function.
next prev parent reply other threads:[~2021-12-29 17:17 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-16 17:41 bug#52558: Option for easier typing of regexps ndame via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-12-17 10:07 ` Phil Sainty
2021-12-18 16:47 ` ndame via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-12-18 4:41 ` Richard Stallman
2021-12-19 11:56 ` Lars Ingebrigtsen
2021-12-19 13:03 ` Phil Sainty
2021-12-19 14:08 ` ndame via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-12-19 16:11 ` Phil Sainty
2021-12-19 15:10 ` Michael Heerdegen
2021-12-20 4:43 ` Richard Stallman
2021-12-20 19:46 ` Jim Porter
2021-12-22 4:16 ` Richard Stallman
2021-12-19 17:01 ` Juri Linkov
2021-12-19 17:39 ` ndame via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-12-19 17:52 ` Juri Linkov
2021-12-19 17:57 ` Juri Linkov
2021-12-19 18:38 ` Juri Linkov
2021-12-19 18:48 ` Juri Linkov
2021-12-28 19:15 ` Juri Linkov
2021-12-28 20:21 ` Eli Zaretskii
2021-12-28 20:25 ` Juri Linkov
2021-12-28 20:35 ` Eli Zaretskii
2021-12-28 20:51 ` Juri Linkov
2021-12-29 12:32 ` Eli Zaretskii
2021-12-29 17:17 ` Juri Linkov [this message]
2021-12-29 18:25 ` Eli Zaretskii
2022-01-22 14:23 ` Lars Ingebrigtsen
2022-01-22 19:01 ` Juri Linkov
2022-01-23 12:36 ` Lars Ingebrigtsen
2022-01-23 18:09 ` Juri Linkov
2022-01-23 18:29 ` Lars Ingebrigtsen
2022-01-24 18:46 ` Juri Linkov
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86v8z71gao.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=52558@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=laszlomail@protonmail.com \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.