emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master 87e422f: Beef up the Emacs string utility set a bit


From: Clément Pit-Claudel
Subject: Re: master 87e422f: Beef up the Emacs string utility set a bit
Date: Mon, 21 Dec 2020 15:44:51 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

On 12/21/20 3:34 PM, Lars Ingebrigtsen wrote:
> Clément Pit-Claudel <cpitclaudel@gmail.com> writes:
> 
>> Look for (replace-regexp-in-string "\n$" "" and variants, or
>> string-trim-right.  One common use case is in conjunction with
>> shell-command-to-string.  Even if it was in Emacs, though, I'm not
>> sure I'd find it and use it instead of string-trim-end.
> 
> I see one single instance:
> 
> ~/src/emacs/trunk/lisp/allout.el:6071:            (replace-regexp-in-string 
> "\n$" ""
> 
> Hm...  should that be "\n\\'"? 
Yup, probably.

There's another one in sml.el; I don't have a good way to check across ELPA:

                      ;; Strip the newline, to avoid adding a prompt.
                      (if (string-match "\n\\'" eol)
                          (replace-match " " t t eol) eol)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]