X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=emacs%2Fnotmuch-lib.el;h=65412821251dfa189e16e8f5274f3755bb4a9111;hp=58f3313d0bb92102bb1841fa3320ead9e68f36d7;hb=a7964c86d12558396cda0f297ebf8dcc602bab61;hpb=45444eebe5c618d08ab168c49201bcd3cc235506 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.