Skip to content

Commit

Permalink
chore: Remove dependency s.el
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Dec 28, 2022
1 parent 99d75ff commit 962dd5f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 18 deletions.
19 changes: 12 additions & 7 deletions lisp/_prepare.el
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ dash separator. For example, the following:
will return `lint-checkdoc' with a dash between two subcommands."
(let* ((script-dir (file-name-directory eask--script))
(script-file (file-name-sans-extension (file-name-nondirectory eask--script)))
(module-name (s-replace eask-lisp-root "" script-dir))
(module-name (s-replace "/" "" module-name)))
(module-name (eask-s-replace eask-lisp-root "" script-dir))
(module-name (eask-s-replace "/" "" module-name)))
;; Ignore if it's inside core module
(if (member module-name '("core" "checker")) script-file
(concat module-name "-" script-file))))
Expand Down Expand Up @@ -148,6 +148,12 @@ the `eask-start' execution.")
(mapc (lambda (elm) (setq result (max result (length (eask-2str elm))))) sequence)
result))

(defun eask-s-replace (old new s)
"Replace OLD with NEW in S each time it occurs."
(if (fboundp #'string-replace)
(string-replace old new s)
(replace-regexp-in-string (regexp-quote old) new s t t)))

;;
;;; Archive

Expand Down Expand Up @@ -592,7 +598,7 @@ Eask file in the workspace."

(defun eask-root-del (filename)
"Remove Eask file root path from FILENAME."
(when (stringp filename) (s-replace eask-file-root "" filename)))
(when (stringp filename) (eask-s-replace eask-file-root "" filename)))

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

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

(defun eask--msg-paint-kwds (string)
"Paint keywords from STRING."
(let* ((string (s-replace "" (ansi-green "") string))
(string (s-replace "" (ansi-red "") string)))
(let* ((string (eask-s-replace "" (ansi-green "") string))
(string (eask-s-replace "" (ansi-red "") string)))
string))

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

;;
;;; Requirement
Expand Down
2 changes: 1 addition & 1 deletion lisp/core/create.el
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
(defun eask--replace-string-in-buffer (old new)
"Replace OLD to NEW in buffer."
(let ((str (buffer-string)))
(setq str (s-replace old new str))
(setq str (eask-s-replace old new str))
(delete-region (point-min) (point-max))
(insert str)))

Expand Down
10 changes: 0 additions & 10 deletions lisp/extern/s.el

This file was deleted.

0 comments on commit 962dd5f

Please sign in to comment.