]> git.notmuchmail.org Git - notmuch/commitdiff
emacs: remove redundant notmuch-hello-trim
authorJonas Bernoulli <jonas@bernoul.li>
Mon, 16 Nov 2020 21:28:21 +0000 (22:28 +0100)
committerDavid Bremner <david@tethera.net>
Sun, 6 Dec 2020 20:17:24 +0000 (16:17 -0400)
Use `string-trim', which exists since Emacs 24.4.

emacs/notmuch-hello.el

index bb60a890f85e1a1e8680363f136d15761b4c728e..b67a5e1993aabdf775604c11fe8374b890dd651c 100644 (file)
@@ -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))