From: Jonas Bernoulli Date: Mon, 16 Nov 2020 21:28:21 +0000 (+0100) Subject: emacs: remove redundant notmuch-hello-trim X-Git-Tag: 0.32_rc0~196 X-Git-Url: https://git.notmuchmail.org/git?a=commitdiff_plain;ds=inline;h=8d701cdc997a1310efb2b6e08b95d705da9062e6;p=notmuch emacs: remove redundant notmuch-hello-trim Use `string-trim', which exists since Emacs 24.4. --- diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index bb60a890..b67a5e19 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@ -387,15 +387,9 @@ afterwards.") (format "%s%03d" notmuch-hello-thousands-separator elem)) (cdr result))))) -(defun notmuch-hello-trim (search) - "Trim whitespace." - (if (string-match "^[[:space:]]*\\(.*[^[:space:]]\\)[[:space:]]*$" search) - (match-string 1 search) - search)) - (defun notmuch-hello-search (&optional search) (unless (null search) - (setq search (notmuch-hello-trim search)) + (setq search (string-trim search)) (let ((history-delete-duplicates t)) (add-to-history 'notmuch-search-history search))) (notmuch-search search notmuch-search-oldest-first))