From: Noam Postavsky <npostavs@gmail.com>
To: Shigeru Fukaya <shigeru.fukaya@gmail.com>
Cc: 17814@debbugs.gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#17814: 24.3.91; better string manipulation in subr-x
Date: Tue, 18 Sep 2018 21:37:20 -0400 [thread overview]
Message-ID: <87va72p8rz.fsf@gmail.com> (raw)
In-Reply-To: <3CCF8D06508F70shigeru.fukaya@gmail.com> (Shigeru Fukaya's message of "Sat, 21 Jun 2014 13:07:27 +0900")
close 17814
quit
Shigeru Fukaya <shigeru.fukaya@gmail.com> writes:
>>The above string-match will fail on a string that has a newline, and the
>>subsequent code will use whatever was the old match-data, resulting in
>>broken behavior.
>
> "." in "\\`[\s\t\n\r]*\\(.*?\\)[\s\t\n\r]*\\'" must be "\\(.\\|\n\\)", sorry.
>
>>Other than that, I don't have any opinion on such changes (I've never
>>heard anyone complain about code size or cpu-time of any of those
>>functions, so I think it largely doesn't matter either way).
>
> Using string-trim-to-right and string-trim-to-left creates unnecessary
> temporary string if both sides need triming may matter, then?
>
> Anyway, I think I'm just sending a small proposal. I don't care much
> if you throw it away. Thank you for spending your time.
An optimization similar to the one proposed here was done for
string-trim-to-{left,right} in [1: 1013e0392b]. I think the strim-trim
change isn't worth the extra complexity (especially since it's not even
entirely clear whether it would be faster/smaller), so I'm closing the
bug.
[1: 1013e0392b]: 2018-07-13 11:28:16 -0400
Tweak subr-x.el substring functions
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=1013e0392b78ee0e2199fb51859dc9e939315f9b
prev parent reply other threads:[~2018-09-19 1:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-19 19:10 bug#17814: 24.3.91; better string manipulation in subr-x Shigeru Fukaya
2014-06-19 20:44 ` Stefan Monnier
2014-06-20 17:14 ` Shigeru Fukaya
2014-06-20 19:14 ` Stefan Monnier
2014-06-21 4:07 ` Shigeru Fukaya
2018-09-19 1:37 ` Noam Postavsky [this message]
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=87va72p8rz.fsf@gmail.com \
--to=npostavs@gmail.com \
--cc=17814@debbugs.gnu.org \
--cc=monnier@iro.umontreal.ca \
--cc=shigeru.fukaya@gmail.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 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).