Skip to content

Commit 962dd5f

Browse files
committed
chore: Remove dependency s.el
1 parent 99d75ff commit 962dd5f

3 files changed

Lines changed: 13 additions & 18 deletions

File tree

lisp/_prepare.el

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ dash separator. For example, the following:
6969
will return `lint-checkdoc' with a dash between two subcommands."
7070
(let* ((script-dir (file-name-directory eask--script))
7171
(script-file (file-name-sans-extension (file-name-nondirectory eask--script)))
72-
(module-name (s-replace eask-lisp-root "" script-dir))
73-
(module-name (s-replace "/" "" module-name)))
72+
(module-name (eask-s-replace eask-lisp-root "" script-dir))
73+
(module-name (eask-s-replace "/" "" module-name)))
7474
;; Ignore if it's inside core module
7575
(if (member module-name '("core" "checker")) script-file
7676
(concat module-name "-" script-file))))
@@ -148,6 +148,12 @@ the `eask-start' execution.")
148148
(mapc (lambda (elm) (setq result (max result (length (eask-2str elm))))) sequence)
149149
result))
150150

151+
(defun eask-s-replace (old new s)
152+
"Replace OLD with NEW in S each time it occurs."
153+
(if (fboundp #'string-replace)
154+
(string-replace old new s)
155+
(replace-regexp-in-string (regexp-quote old) new s t t)))
156+
151157
;;
152158
;;; Archive
153159

@@ -592,7 +598,7 @@ Eask file in the workspace."
592598

593599
(defun eask-root-del (filename)
594600
"Remove Eask file root path from FILENAME."
595-
(when (stringp filename) (s-replace eask-file-root "" filename)))
601+
(when (stringp filename) (eask-s-replace eask-file-root "" filename)))
596602

597603
(defun eask-file-load (location &optional noerror)
598604
"Load Eask file in the LOCATION."
@@ -793,7 +799,7 @@ Eask file in the workspace."
793799
(when (and location
794800
(gnutls-available-p)
795801
(not (eask-network-insecure-p)))
796-
(setq location (s-replace "https://" "http://" location)))
802+
(setq location (eask-s-replace "https://" "http://" location)))
797803
(add-to-list 'package-archives (cons name location) t))
798804

799805
(defun eask-f-source-priority (archive-id &optional priority)
@@ -987,8 +993,8 @@ Standard is, 0 (error), 1 (warning), 2 (info), 3 (log), 4 or above (debug)."
987993

988994
(defun eask--msg-paint-kwds (string)
989995
"Paint keywords from STRING."
990-
(let* ((string (s-replace "" (ansi-green "") string))
991-
(string (s-replace "" (ansi-red "") string)))
996+
(let* ((string (eask-s-replace "" (ansi-green "") string))
997+
(string (eask-s-replace "" (ansi-red "") string)))
992998
string))
993999

9941000
(defun eask--format-paint-kwds (msg &rest args)
@@ -1292,7 +1298,6 @@ Standard is, 0 (error), 1 (warning), 2 (info), 3 (log), 4 or above (debug)."
12921298
(with-eval-after-load 'ansi (eask-load "extern/ansi")) ; override
12931299
(eask-load "extern/package")
12941300
(eask-load "extern/package-build")
1295-
(eask-load "extern/s")
12961301

12971302
;;
12981303
;;; Requirement

lisp/core/create.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
(defun eask--replace-string-in-buffer (old new)
2626
"Replace OLD to NEW in buffer."
2727
(let ((str (buffer-string)))
28-
(setq str (s-replace old new str))
28+
(setq str (eask-s-replace old new str))
2929
(delete-region (point-min) (point-max))
3030
(insert str)))
3131

lisp/extern/s.el

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)