aboutsummaryrefslogtreecommitdiff
path: root/sx.el
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-02-03 13:17:59 -0200
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-02-03 13:17:59 -0200
commitba4489691847ed1cff2f33f1bfa9aeda85af2a6b (patch)
tree505024a8b16a04ce266c90a3d7777f735e0ba966 /sx.el
parenta2d526c4b12ffa1cece78be7e6bfedf0b2b60576 (diff)
New function sx--squash-whitespace
Diffstat (limited to 'sx.el')
-rw-r--r--sx.el4
1 files changed, 4 insertions, 0 deletions
diff --git a/sx.el b/sx.el
index 26151b3..14af94d 100644
--- a/sx.el
+++ b/sx.el
@@ -331,6 +331,10 @@ GET-FUNC and performs the actual comparison."
(funcall ,get-func a)
(funcall ,get-func b))))
+(defun sx--squash-whitespace (string)
+ "Return STRING with consecutive whitespace squashed together."
+ (replace-regexp-in-string "[ \r\n]+" " " string))
+
;;; Printing request data
(defvar sx--overlays nil