1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Use string-trim in newsticker--remove-whitespace

* lisp/net/newst-backend.el (newsticker--remove-whitespace): Use
string-trim.
This commit is contained in:
Stefan Kangas 2022-08-03 11:48:45 +02:00
parent 984b8f7ed0
commit 165675797e

View 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.