GNU bug report logs -
#36372
27.0.50; replace-regexp-in-string skips START first chars in return value
Previous Next
Reported by: Mattias Engdegård <mattiase <at> acm.org>
Date: Tue, 25 Jun 2019 12:41:02 UTC
Severity: normal
Found in version 27.0.50
Done: Mattias Engdegård <mattiase <at> acm.org>
Bug is archived. No further changes may be made.
Full log
Message #41 received at 36372 <at> debbugs.gnu.org (full text, mbox):
26 juni 2019 kl. 16.51 skrev Eli Zaretskii <eliz <at> gnu.org>:
>>
>> So it isn't used in-tree at all. Since it's an (in my opinion) pretty
>> useless parameter as it's currently implemented, I think we should
>> deprecate the parameter and remove the documentation.
>
> I disagree. This has been in Emacs since 2000, it's too late to
> remove it. We must assume that whoever wrote the code (which operated
> like that from the get-go) actually meant for it to operate like that.
It may be too late to change, but that doesn't mean that we have to agree with your last statement: it looks like a mistake from the very beginning to me. Given the seventh argument's infrequency of use (and the lack of tests), this is perfectly plausible.
By the way, I found no use of the START argument in GNU ELPA either so I started searching all elisp code on my disk, and found exactly one, in company-coq.
Clément, apologies for dragging you into the discussion, but when you woke up this morning, you probably didn't know that you were possibly the only man in history to use the last argument to replace-regexp-in-string.
Now I would be curious to know:
(1) Does this code, in company-coq--loc-fully-qualified-name, actually work the way you intended? (Looks like it.)
(2) Did you learn how the START parameter affects the return value by reading the doc string, the manual, the source code, or by testing?
(3) Are you aware of other code using the START parameter to replace-regexp-in-string?
Clearly this is anecdotal evidence but we have little else.
This bug report was last modified 5 years and 331 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.