From: Lars Ingebrigtsen Date: Mon, 21 Dec 2020 21:41:37 +0000 (+0100) Subject: Make string-clean-whitespace work on non-ASCII whitespace, too X-Git-Tag: emacs-28.0.90~4624 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=768522750ddbf68eb86b336fb41df9ec2fae6988;p=emacs.git 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. --- diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el index 80d4cb9b650..4d1a73a251a 100644 --- a/lisp/emacs-lisp/subr-x.el +++ b/lisp/emacs-lisp/subr-x.el @@ -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.