From: Lars Ingebrigtsen Date: Tue, 22 Dec 2020 03:24:25 +0000 (+0100) Subject: Further string-clean-whitespace tweaks X-Git-Tag: emacs-28.0.90~4620 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d2b86118629562600c07dbc5befa78ac8b860b68;p=emacs.git Further string-clean-whitespace tweaks * lisp/emacs-lisp/subr-x.el (string-clean-whitespace): Put \r back, which was mistakenly removed. --- diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el index aa39fc1538f..6f4f7ed5dce 100644 --- a/lisp/emacs-lisp/subr-x.el +++ b/lisp/emacs-lisp/subr-x.el @@ -269,7 +269,7 @@ carriage return." All sequences of whitespaces in STRING are collapsed into a single space character, and leading/trailing whitespace is removed." - (let ((blank "[[:blank:]\n]+")) + (let ((blank "[[:blank:]\r\n]+")) (string-trim (replace-regexp-in-string blank " " string t t) blank blank))) diff --git a/test/lisp/emacs-lisp/subr-x-tests.el b/test/lisp/emacs-lisp/subr-x-tests.el index ab5a5bfa641..2e16cd0f30b 100644 --- a/test/lisp/emacs-lisp/subr-x-tests.el +++ b/test/lisp/emacs-lisp/subr-x-tests.el @@ -584,7 +584,7 @@ (ert-deftest subr-clean-whitespace () (should (equal (string-clean-whitespace " foo ") "foo")) - (should (equal (string-clean-whitespace " foo \n\t Bar") "foo Bar"))) + (should (equal (string-clean-whitespace " foo \r\n\t  Bar") "foo Bar"))) (ert-deftest subr-string-fill () (should (equal (string-fill "foo" 10) "foo"))