[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 7685227: Make string-clean-whitespace work on non-ASCII whitespac
From: |
Lars Ingebrigtsen |
Subject: |
master 7685227: Make string-clean-whitespace work on non-ASCII whitespace, too |
Date: |
Mon, 21 Dec 2020 16:41:46 -0500 (EST) |
branch: master
commit 768522750ddbf68eb86b336fb41df9ec2fae6988
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
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 80d4cb9..4d1a73a 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.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 7685227: Make string-clean-whitespace work on non-ASCII whitespace, too,
Lars Ingebrigtsen <=