From 768522750ddbf68eb86b336fb41df9ec2fae6988 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 21 Dec 2020 22:41:37 +0100 Subject: [PATCH] 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. --- lisp/emacs-lisp/subr-x.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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. -- 2.39.5