diff options
author | Lucien Cartier-Tilet <lucien@phundrak.com> | 2022-12-28 19:13:01 +0100 |
---|---|---|
committer | Lucien Cartier-Tilet <lucien@phundrak.com> | 2022-12-28 19:14:03 +0100 |
commit | b8c96a6e680a4f0ddcfef88191f22a579dd04c2c (patch) | |
tree | eea4634daa1f6c35d5724f8ae6bef43e1239155e | |
parent | 6544f84aa5adaa76ea8901f185e940ee868a471f (diff) |
Remove s.el dependency
-rw-r--r-- | Cask | 1 | ||||
-rw-r--r-- | f.el | 16 |
2 files changed, 10 insertions, 7 deletions
@@ -6,6 +6,5 @@ (development (depends-on "ert-runner") (depends-on "ert-async") - (depends-on "s") (depends-on "dash") (depends-on "undercover")) @@ -5,7 +5,7 @@ ;; Author: Johan Andersson <johan.rejeep@gmail.com> ;; Maintainer: Lucien Cartier-Tilet <lucien@phundrak.com> ;; Version: 0.20.0 -;; Package-Requires: ((emacs "24.1") (s "1.7.0") (dash "2.2.0")) +;; Package-Requires: ((emacs "24.1") (dash "2.2.0")) ;; Keywords: files, directories ;; Homepage: http://github.com/rejeep/f.el @@ -86,8 +86,11 @@ path the new root of the generated path." (defun f-split (path) "Split PATH and return list containing parts." - (let ((parts (split-string path (f-path-separator) 'omit-nulls))) - (if (string= (s-left 1 path) (f-path-separator)) + (let ((parts (split-string path (f-path-separator) 'omit-nulls)) + (first-char (if (> (length path) 1) + (substring path 0 1) + path))) + (if (string= first-char (f-path-separator)) (push (f-path-separator) parts) parts))) @@ -142,7 +145,8 @@ ignored." (defun f-swap-ext (path ext) "Return PATH but with EXT as the new extension. EXT must not be nil or empty." - (if (s-blank-p ext) + (if (or (null ext) + (string= "" ext)) (error "Extension cannot be empty or nil") (concat (f-no-ext path) "." ext))) @@ -188,8 +192,8 @@ ending slash." (--map (cons (car it) (concat - (f-filename (s-chop-suffix (cdr it) - (car it))) + (f-filename (string-remove-suffix (cdr it) + (car it))) (f-path-separator) (cdr it))) conf-files) conf-files)) |