Make string-clean-whitespace work on non-ASCII whitespace, too

* lisp/emacs-lisp/subr-x.el (string-clean-whitespace): Also clean
up non-ASCII whitespace.
This commit is contained in:
Lars Ingebrigtsen 2020-12-21 22:41:37 +01:00
parent c9a95237a8
commit 768522750d

View file

@ -269,7 +269,9 @@ carriage return."
All sequences of whitespaces in STRING are collapsed into a
single space character, and leading/trailing whitespace is
removed."
(string-trim (replace-regexp-in-string "[ \t\n\r]+" " " string)))
(let ((blank "[[:blank:]\n]+"))
(string-trim (replace-regexp-in-string blank " " string)
blank blank)))
(defun string-fill (string length)
"Try to word-wrap STRING so that no lines are longer than LENGTH.