Skip to content

Commit 518178b

Browse files
committed
Replace purescript-trim with string-trim
This is a common helper Emacs had for a while, no need to keep our own function.
1 parent f315556 commit 518178b

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

purescript-indent.el

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@
9191
(require 'purescript-vars)
9292
(require 'purescript-string)
9393
(require 'cl-lib)
94+
(eval-when-compile
95+
(when (< emacs-major-version 28)
96+
(require 'subr-x)))
9497

9598
(defgroup purescript-indent nil
9699
"PureScript indentation."
@@ -655,8 +658,8 @@ symbols in the sexp."
655658
(string-match "where[ \t]*" purescript-indent-current-line-first-ident))
656659
(diff-first ; not a function def with the same name
657660
(or (null valname-string)
658-
(not (string= (purescript-trim valname-string)
659-
(purescript-trim purescript-indent-current-line-first-ident)))))
661+
(not (string= (string-trim valname-string)
662+
(string-trim purescript-indent-current-line-first-ident)))))
660663

661664
;; (is-type-def
662665
;; (and rpurs-sign (eq (char-after rpurs-sign) ?\:)))

purescript-mode.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ Brings up the documentation for purescript-mode-hook."
439439
(message "%s"
440440
(concat (car lines)
441441
(if (and (cdr lines) (stringp (cadr lines)))
442-
(format " [ %s .. ]" (purescript-string-take (purescript-trim (cadr lines)) 10))
442+
(format " [ %s .. ]" (purescript-string-take (string-trim (cadr lines)) 10))
443443
""))))))
444444

445445
(defun purescript-current-line-string ()

purescript-string.el

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
11
;;; purescript-string.el --- string manipulation utilties -*- lexical-binding: t -*-
2-
;;;###autoload
3-
(defun purescript-trim (string)
4-
(replace-regexp-in-string
5-
"^[ \t\n]+" ""
6-
(replace-regexp-in-string
7-
"[ \t\n]+$" ""
8-
string)))
9-
102
;;;###autoload
113
(defun purescript-string-take (string n)
124
"Take n chars from string."

0 commit comments

Comments
 (0)