Skip to content

Commit 8bb2f05

Browse files
committed
Remove dependency on s.el and require Emacs 26 or higher
1 parent 4eb431a commit 8bb2f05

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

Eask

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"Dispatch major mode for *.dist files")
44

55
(website-url "https://github.com/emacs-php/dist-file-mode.el")
6-
(keywords "")
6+
(keywords "files" "convenience")
77

88
(package-file "dist-file-mode.el")
99

@@ -12,8 +12,6 @@
1212
(source 'gnu)
1313
(source 'melpa)
1414

15-
(depends-on "emacs" "24")
16-
(depends-on "cl-lib" "0.5")
17-
(depends-on "s" "1.9.0")
15+
(depends-on "emacs" "26")
1816

1917
(setq network-security-level 'low) ; see https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-932956432

dist-file-mode.el

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
;; Version: 0.9.0
88
;; Keywords: files, convenience
99
;; Homepage: https://github.com/emacs-php/dist-file-mode.el
10-
;; Package-Requires: ((emacs "24") (cl-lib "0.5") (s "1.9.0"))
10+
;; Package-Requires: ((emacs "26"))
1111
;; License: GPL-3.0-or-later
1212

1313
;; This program is free software; you can redistribute it and/or modify
@@ -33,18 +33,19 @@
3333
;; This command removes `.dist' from file name and choises the appropriate major mode.
3434

3535
;;; Code:
36+
(eval-when-compile
37+
(require 'cl-lib))
3638
(require 'rx)
37-
(require 's)
3839

3940
(defvar dist-file-suffixes
4041
'(".dist"))
4142

4243
(defun dist-file-canonical-filename (filename)
43-
"Return `FILENAME' without `.dist' suffix."
44+
"Return FILENAME without `.dist' suffix."
4445
(cl-loop for suffix in dist-file-suffixes
45-
if (s-ends-with? suffix filename)
46+
if (string-suffix-p suffix filename)
4647
return (replace-regexp-in-string
47-
(eval `(rx ,suffix string-end)) "" buffer-file-name)
48+
(rx-to-string `(: ,suffix string-end)) "" filename)
4849
finally return filename))
4950

5051
(defun dist-file-match-major-mode (filename)

0 commit comments

Comments
 (0)