Skip to content

Commit 6d0eaa3

Browse files
committed
Remove s-chop-(pre|suf)fix with string-remove-(pre|suf)fix
1 parent 5ca4263 commit 6d0eaa3

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

clj-refactor.el

+20-20
Original file line numberDiff line numberDiff line change
@@ -1830,7 +1830,7 @@ the alias in the project."
18301830
(let ((short (thread-last (buffer-substring-no-properties
18311831
(cljr--point-after 'paredit-backward)
18321832
(1- (point)))
1833-
(s-chop-prefix "::"))))
1833+
(string-remove-prefix "::"))))
18341834
(unless (or (cljr--resolve-alias short)
18351835
(cljr--js-alias-p short))
18361836
(if-let ((aliases (ignore-errors (cljr--get-aliases-from-middleware)))
@@ -1896,8 +1896,8 @@ form."
18961896

18971897
(defun cljr--excluded-from-project-clean-p (filename)
18981898
(member (s-with filename
1899-
(s-chop-prefix (cljr--project-dir))
1900-
(s-chop-prefix "/"))
1899+
(string-remove-prefix (cljr--project-dir))
1900+
(string-remove-prefix "/"))
19011901
cljr-project-clean-exceptions))
19021902

19031903
;;;###autoload
@@ -1948,7 +1948,7 @@ See: https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-project-clean"
19481948
"Strips metadata and comments"
19491949
(with-temp-buffer
19501950
(let ((names (list)))
1951-
(insert (thread-last deps (s-chop-prefix "[") (s-chop-suffix "]")))
1951+
(insert (thread-last deps (string-remove-prefix "[") (string-remove-suffix "]")))
19521952
(goto-char (point-min))
19531953
(while (not (cljr--empty-buffer-p))
19541954
(push (cljr--extract-next-dependency-name) names))
@@ -2026,8 +2026,8 @@ See: https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-sort-project-dep
20262026
(cljr--point-after 'paredit-forward))
20272027
cljr--get-sorted-dependency-names
20282028
(cljr--sort-dependency-vectors (thread-last (clojure-delete-and-extract-sexp)
2029-
(s-chop-prefix "[")
2030-
(s-chop-suffix "]")))
2029+
(string-remove-prefix "[")
2030+
(string-remove-suffix "]")))
20312031
insert))
20322032
(indent-region (point-min) (point-max))
20332033
(save-buffer)))
@@ -2385,7 +2385,7 @@ See: https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-promote-function
23852385
(defun cljr--project-relative-path (path)
23862386
"Denormalize PATH to make to make it relative to the project
23872387
root."
2388-
(s-chop-prefix (cljr--project-dir) path))
2388+
(string-remove-prefix (cljr--project-dir) path))
23892389

23902390
(defun cljr--get-valid-filename (hash)
23912391
"Get :file value from the hash table and convert path if necessary."
@@ -2708,17 +2708,17 @@ Date. -> Date
27082708
~@sym => sym"
27092709
(cond
27102710
((string-suffix-p "." name)
2711-
(thread-last name (s-chop-suffix ".") cljr--normalize-symbol-name))
2711+
(thread-last name (string-remove-suffix ".") cljr--normalize-symbol-name))
27122712
((string-prefix-p "#'" name)
2713-
(thread-last name (s-chop-prefix "#'") cljr--normalize-symbol-name))
2713+
(thread-last name (string-remove-prefix "#'") cljr--normalize-symbol-name))
27142714
((string-prefix-p "'" name)
2715-
(thread-last name (s-chop-prefix "'") cljr--normalize-symbol-name))
2715+
(thread-last name (string-remove-prefix "'") cljr--normalize-symbol-name))
27162716
((string-prefix-p "~" name)
2717-
(thread-last name (s-chop-prefix "~") cljr--normalize-symbol-name))
2717+
(thread-last name (string-remove-prefix "~") cljr--normalize-symbol-name))
27182718
((string-prefix-p "~@" name)
2719-
(thread-last name (s-chop-prefix "~@") cljr--normalize-symbol-name))
2719+
(thread-last name (string-remove-prefix "~@") cljr--normalize-symbol-name))
27202720
((string-prefix-p "@" name)
2721-
(thread-last name (s-chop-prefix "@") cljr--normalize-symbol-name))
2721+
(thread-last name (string-remove-prefix "@") cljr--normalize-symbol-name))
27222722
(t name)))
27232723

27242724
(defun cljr--call-middleware-to-resolve-missing (symbol)
@@ -3255,7 +3255,7 @@ See: https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-create-fn-from-e
32553255
(let ((keyfn (cadr args)))
32563256
(cljr--insert-example-fn (cider-symbol-at-point)
32573257
(if (cljr--keywordp keyfn)
3258-
(list (s-chop-prefix ":" keyfn))
3258+
(list (string-remove-prefix ":" keyfn))
32593259
(list 0))
32603260
path)))
32613261

@@ -3265,7 +3265,7 @@ See: https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-create-fn-from-e
32653265
(cider-symbol-at-point))))
32663266
(cljr--insert-example-fn (cider-symbol-at-point)
32673267
(if (cljr--keywordp last-path-entry)
3268-
(list (s-chop-prefix ":" last-path-entry))
3268+
(list (string-remove-prefix ":" last-path-entry))
32693269
(list 0))
32703270
path)))
32713271

@@ -3286,7 +3286,7 @@ See: https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-create-fn-from-e
32863286
(= 3 (length args))))
32873287
(param-name (if making-comparator?
32883288
(when (cljr--keywordp (car args))
3289-
(s-chop-prefix ":" (car args)))
3289+
(string-remove-prefix ":" (car args)))
32903290
(when-let (coll-name (cljr--guess-param-name (car (last args))))
32913291
(inflection-singularize-string coll-name)))))
32923292
(cljr--insert-example-fn fn-name
@@ -3374,9 +3374,9 @@ See: https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-create-fn-from-e
33743374
((and fn-call (string-suffix-p "." fn-call))
33753375
(s-dashed-words (car (last (s-split "\\." fn-call t)))))
33763376
((and fn-call (string-prefix-p "create-" fn-call))
3377-
(s-chop-prefix "create-" fn-call))
3377+
(string-remove-prefix "create-" fn-call))
33783378
((and fn-call (string-prefix-p ".get" fn-call))
3379-
(s-dashed-words (s-chop-prefix ".get" fn-call)))
3379+
(s-dashed-words (string-remove-prefix ".get" fn-call)))
33803380
((string= "get-in" fn-call)
33813381
(cljr--find-param-name-from-get-in prepped-form))
33823382
((string= "get" fn-call)
@@ -3428,7 +3428,7 @@ See: https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-create-fn-from-e
34283428
(paredit-backward-down)
34293429
(cider-symbol-at-point))))
34303430
(when (cljr--keywordp last-path-entry)
3431-
(s-chop-prefix ":" last-path-entry))))
3431+
(string-remove-prefix ":" last-path-entry))))
34323432

34333433
(defun cljr--find-param-name-from-get (form)
34343434
(let ((key (cljr--with-string-content form
@@ -3437,7 +3437,7 @@ See: https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-create-fn-from-e
34373437
(cljr--skip-past-whitespace-and-comments)
34383438
(cljr--extract-sexp))))
34393439
(when (cljr--keywordp key)
3440-
(s-chop-prefix ":" key))))
3440+
(string-remove-prefix ":" key))))
34413441

34423442
(defun cljr--insert-example-fn (name args path)
34433443
"Create a new function from NAME and ARGS.

0 commit comments

Comments
 (0)