aboutsummaryrefslogtreecommitdiffhomepage
path: root/emacs/notmuch-lib.el
diff options
context:
space:
mode:
Diffstat (limited to 'emacs/notmuch-lib.el')
-rw-r--r--emacs/notmuch-lib.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 58f3313d..65412821 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -243,6 +243,12 @@ depending on the value of `notmuch-poll-script'."
"[No Subject]"
subject)))
+(defun notmuch-sanitize (str)
+ "Sanitize control character in STR.
+
+This includes newlines, tabs, and other funny characters."
+ (replace-regexp-in-string "[[:cntrl:]\x7f\u2028\u2029]+" " " str))
+
(defun notmuch-escape-boolean-term (term)
"Escape a boolean term for use in a query.