[PATCH 05/27] emacs: remove redundant notmuch-hello-trim

Subject: [PATCH 05/27] emacs: remove redundant notmuch-hello-trim

Date: Sun, 8 Nov 2020 20:02:49 +0100

To: notmuch@notmuchmail.org

Cc:

From: Jonas Bernoulli


Use `string-trim', which exists since Emacs 24.4.
---
 emacs/notmuch-hello.el | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

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 @@ (defun notmuch-hello-nice-number (n)
 		     (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))
-- 
2.29.1
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: