From: Drew Adams <drew.adams@oracle.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: "63398-done@debbugs.gnu.org" <63398-done@debbugs.gnu.org>
Subject: bug#63398: 28.2; Doc or behavior of replacement commands (e.g. `replace-string')
Date: Wed, 10 May 2023 14:20:10 +0000 [thread overview]
Message-ID: <SJ0PR10MB5488D266CEE978330C5DE839F3779@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <83fs848fzu.fsf@gnu.org>
> The manual says "try", and for a good reason. There's a heuristics
> involved that tries to DTRT. The "when the NEWSTRING argument is all
> or partly lower case" part is relevant.
Yes, I assumed that. But seeing "try" still can make
a reader wonder.
> What you expect will happen
> if the original text doesn't include digits, as in
>
> Testing
> testing
>
> M-x replace-string RET testing RET foobar RET
Yes, I know. That's why I included the digits - it's
this case that seems not to follow what the doc says.
Are you perhaps connecting this with your previous
sentence, about success of a "trial" depending on
NEWSTRING being partly or all lower case? Are you
saying that if there are non-letter chars then what
the doc says might not happen because trying doesn't
succeed?
I guess it's not clear to me whether you're saying
that the behavior isn't what it should be (per the
doc) in this case, but that's unavoidable or OK, or
you're saying that the behavior does follow the doc,
and the doc is trying to say that the behavior
follows what it says only if there are no digits?
There are several variables that can affect the
behavior, which makes trying to describe (doc) and
trying to understand (reader) the behavior not so
easy.
FWIW, this was raised by a user question on reddit:
https://www.reddit.com/r/emacs/comments/13d1a5x/replacestring_keeping_case_of_the_matched_string
You closed this as fixed, but I still find the doc
- or the behavior - unclear wrt this example.
Could you maybe (e.g. here) explain a bit more how
the behavior fits the description?
> > [It's also not very good to refer to argument NEWSTRING in a topic/node
> > that doesn't define it. Users have to look backward through the doc to
> > see if they can find out which argument this is talking about.]\
>
> Fixed.
Thx.
> In your post the em dash was the ASCII character '-',
Dunno how that happened; sorry. It's an em dash in
the Emacs text. And with a fixed-width font (default,
emacs -Q) the problem I cited is real.
> but on my system it is an actual em dash -- a much
> longer character, thus the confusion
> is unlikely.
How can it be a longer char, if the font is fixed width?
> As for why there are no spaces -- that's our style.
That's fine, provide the em space is actually longer
than the fixed width.
(Typographic practice varies, but a thin space is often
or typically used on each side of an em dash.)
next prev parent reply other threads:[~2023-05-10 14:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-09 20:13 bug#63398: 28.2; Doc or behavior of replacement commands (e.g. `replace-string') Drew Adams
2023-05-10 13:37 ` Eli Zaretskii
2023-05-10 14:20 ` Drew Adams [this message]
2023-05-10 15:27 ` Eli Zaretskii
2023-05-10 15:50 ` Drew Adams
2023-05-10 16:46 ` Juri Linkov
2023-05-10 17:03 ` Drew Adams
2023-05-11 6:23 ` 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
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=SJ0PR10MB5488D266CEE978330C5DE839F3779@SJ0PR10MB5488.namprd10.prod.outlook.com \
--to=drew.adams@oracle.com \
--cc=63398-done@debbugs.gnu.org \
--cc=eliz@gnu.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).