]> git.eshelyaron.com Git - emacs.git/commitdiff
Use string-trim in newsticker--remove-whitespace
authorStefan Kangas <stefan@marxist.se>
Wed, 3 Aug 2022 09:48:45 +0000 (11:48 +0200)
committerStefan Kangas <stefan@marxist.se>
Wed, 3 Aug 2022 09:48:45 +0000 (11:48 +0200)
* lisp/net/newst-backend.el (newsticker--remove-whitespace): Use
string-trim.

lisp/net/newst-backend.el

index 5ae2df769a23e05d74bf8c0cf058c0a321feab6c..f65ef522f23ab5470902a5a6ff334de95b2a4e5a 100644 (file)
@@ -1552,12 +1552,8 @@ argument, which is one of the items in ITEMLIST."
 
 (defun newsticker--remove-whitespace (string)
   "Remove leading and trailing whitespace from STRING."
-  ;; we must have ...+ but not ...* in the regexps otherwise xemacs loops
-  ;; endlessly...
-  (when (and string (stringp string))
-    (replace-regexp-in-string
-     "[ \t\r\n]+$" ""
-     (replace-regexp-in-string "^[ \t\r\n]+" "" string))))
+  (when (stringp string)
+    (string-trim string)))
 
 (defun newsticker--do-forget-preformatted (item)
   "Forget pre-formatted data for ITEM.