Skip to content

Commit

Permalink
Avoid string-trim for older Emacs
Browse files Browse the repository at this point in the history
  • Loading branch information
greghendershott committed Jun 14, 2024
1 parent ed6e5ab commit 00cb581
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions racket-package.el
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,16 @@
(while (and (not (eobp))
(not (looking-at (rx "[" (1+ digit) " auto-installed packages not shown]"))))
(cl-flet ((get (beg end)
(string-trim
(buffer-substring-no-properties (+ (point) beg)
(+ (point) end)))))
(let ((str (buffer-substring-no-properties (+ (point) beg)
(+ (point) end))))
;; string-trim not available in older Emacs, so...
(string-match (rx bos
(*? (any " "))
(group (*? anything))
(*? (any " "))
eos)
str)
(match-string 1 str))))
(pcase-let* ((name* (get package-ofs checksum-ofs))
(`(,name . ,status) (if (string-match-p (rx (1+ any) "*" eos)
name*)
Expand Down

0 comments on commit 00cb581

Please sign in to comment.