diff options
author | Stefan Kangas <stefan@marxist.se> | 2022-08-03 11:48:45 +0200 |
---|---|---|
committer | Stefan Kangas <stefan@marxist.se> | 2022-08-03 11:48:45 +0200 |
commit | 165675797efdddb32170ce58ddf5c8ec813f1d4a (patch) | |
tree | ba78d42c180a99a2584f41584d278b0ef036f7f9 | |
parent | 984b8f7ed0687702c524082efb0945f6778fb370 (diff) | |
download | emacs-165675797efdddb32170ce58ddf5c8ec813f1d4a.tar.gz emacs-165675797efdddb32170ce58ddf5c8ec813f1d4a.tar.bz2 emacs-165675797efdddb32170ce58ddf5c8ec813f1d4a.zip |
Use string-trim in newsticker--remove-whitespace
* lisp/net/newst-backend.el (newsticker--remove-whitespace): Use
string-trim.
-rw-r--r-- | lisp/net/newst-backend.el | 8 |
1 files 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. |