Skip to content

Commit 9e41a53

Browse files
committed
Use cl-lib (fixes haskell#6)
1 parent c72e467 commit 9e41a53

File tree

6 files changed

+9
-7
lines changed

6 files changed

+9
-7
lines changed

haskell-snippets.el

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
;; URL: https://github.com/haskell/haskell-snippets
77
;; Keywords: snippets, haskell
88
;; Version: 0.1.0
9-
;; Package-Requires: ((yasnippet "0.8.0"))
9+
;; Package-Requires: ((cl-lib "0.5") (yasnippet "0.8.0"))
1010

1111
;; Permission is hereby granted, free of charge, to any person obtaining
1212
;; a copy of this software and associated documentation files (the
@@ -68,6 +68,9 @@
6868

6969
;;; Code:
7070

71+
(require 'cl-lib)
72+
(require 'yasnippet)
73+
7174
(setq haskell-snippets-dir
7275
(file-name-directory load-file-name))
7376

@@ -81,7 +84,6 @@
8184
(eval-after-load 'yasnippet
8285
'(haskell-snippets-initialize))
8386

84-
(require 'yasnippet)
8587
(provide 'haskell-snippets)
8688

8789
;;; haskell-snippets.el ends here

snippets/haskell-mode/import.qualified

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# --
77
import qualified ${1:Module} as ${2:${1:$(let ((name (car (last (split-string yas-text "\\\.")))))
88
(if (= 0 (length name)) ""
9-
(subseq name 0 1)))}}$0
9+
(cl-subseq name 0 1)))}}$0

snippets/haskell-mode/lang-pragma

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
# contributor: Luke Hoersten <luke@hoersten.org>
66
# --
77
{-# LANGUAGE `(when (boundp 'haskell-ghc-supported-extensions)
8-
(some #'(lambda (fn) (funcall fn "Extension: " haskell-ghc-supported-extensions))
8+
(cl-some #'(lambda (fn) (funcall fn "Extension: " haskell-ghc-supported-extensions))
99
yas-prompt-functions))` #-}

snippets/haskell-mode/module

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
module ${1:`(if (not buffer-file-name) "Module"
99
(let ((name (file-name-sans-extension (buffer-file-name)))
1010
(case-fold-search nil))
11-
(if (search "src/" name)
11+
(if (cl-search "src/" name)
1212
(replace-regexp-in-string "/" "."
1313
(replace-regexp-in-string "^\/[^A-Z]*" ""
1414
(car (last (split-string name "src")))))

snippets/haskell-mode/module.exports

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
module ${1:`(if (not buffer-file-name) "Module"
99
(let ((name (file-name-sans-extension (buffer-file-name)))
1010
(case-fold-search nil))
11-
(if (search "src/" name)
11+
(if (cl-search "src/" name)
1212
(replace-regexp-in-string "/" "."
1313
(replace-regexp-in-string "^\/[^A-Z]*" ""
1414
(car (last (split-string name "src")))))

snippets/haskell-mode/opt-pragma

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
# contributor: Luke Hoersten <luke@hoersten.org>
66
# --
77
{-# OPTIONS_GHC `(when (boundp 'haskell-ghc-supported-options)
8-
(some #'(lambda (fn) (funcall fn "GHC Option: " haskell-ghc-supported-options))
8+
(cl-some #'(lambda (fn) (funcall fn "GHC Option: " haskell-ghc-supported-options))
99
yas-prompt-functions))` #-}

0 commit comments

Comments
 (0)