From 165675797efdddb32170ce58ddf5c8ec813f1d4a Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 3 Aug 2022 11:48:45 +0200 Subject: [PATCH] Use string-trim in newsticker--remove-whitespace * lisp/net/newst-backend.el (newsticker--remove-whitespace): Use string-trim. --- lisp/net/newst-backend.el | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lisp/net/newst-backend.el b/lisp/net/newst-backend.el index 5ae2df769a2..f65ef522f23 100644 --- a/lisp/net/newst-backend.el +++ b/lisp/net/newst-backend.el @@ -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. -- 2.39.5