summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2020-12-21 22:41:37 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2020-12-21 22:41:37 +0100
commit768522750ddbf68eb86b336fb41df9ec2fae6988 (patch)
tree7ed67227cdce6271cba677c0eae772c6197f619c /lisp/emacs-lisp
parentc9a95237a8e5d2c2e8ca3d6c97de8c7b5c1daaac (diff)
downloademacs-768522750ddbf68eb86b336fb41df9ec2fae6988.tar.gz
emacs-768522750ddbf68eb86b336fb41df9ec2fae6988.tar.bz2
emacs-768522750ddbf68eb86b336fb41df9ec2fae6988.zip
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.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/subr-x.el4
1 files changed, 3 insertions, 1 deletions
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.