diff --git a/haskell-snippets.el b/haskell-snippets.el index 945b462..39b431e 100644 --- a/haskell-snippets.el +++ b/haskell-snippets.el @@ -6,7 +6,7 @@ ;; URL: https://github.com/haskell/haskell-snippets ;; Keywords: snippets, haskell ;; Version: 0.1.0 -;; Package-Requires: ((yasnippet "0.8.0")) +;; Package-Requires: ((cl-lib "0.5") (yasnippet "0.8.0")) ;; Permission is hereby granted, free of charge, to any person obtaining ;; a copy of this software and associated documentation files (the @@ -68,6 +68,9 @@ ;;; Code: +(require 'cl-lib) +(require 'yasnippet) + (setq haskell-snippets-dir (file-name-directory load-file-name)) @@ -81,7 +84,6 @@ (eval-after-load 'yasnippet '(haskell-snippets-initialize)) -(require 'yasnippet) (provide 'haskell-snippets) ;;; haskell-snippets.el ends here diff --git a/snippets/haskell-mode/import.qualified b/snippets/haskell-mode/import.qualified index a8f728f..5165158 100644 --- a/snippets/haskell-mode/import.qualified +++ b/snippets/haskell-mode/import.qualified @@ -6,4 +6,4 @@ # -- import qualified ${1:Module} as ${2:${1:$(let ((name (car (last (split-string yas-text "\\\."))))) (if (= 0 (length name)) "" - (subseq name 0 1)))}}$0 \ No newline at end of file + (cl-subseq name 0 1)))}}$0 \ No newline at end of file diff --git a/snippets/haskell-mode/lang-pragma b/snippets/haskell-mode/lang-pragma index 58eed27..a4965e7 100644 --- a/snippets/haskell-mode/lang-pragma +++ b/snippets/haskell-mode/lang-pragma @@ -5,5 +5,5 @@ # contributor: Luke Hoersten # -- {-# LANGUAGE `(when (boundp 'haskell-ghc-supported-extensions) - (some #'(lambda (fn) (funcall fn "Extension: " haskell-ghc-supported-extensions)) + (cl-some #'(lambda (fn) (funcall fn "Extension: " haskell-ghc-supported-extensions)) yas-prompt-functions))` #-} \ No newline at end of file diff --git a/snippets/haskell-mode/module b/snippets/haskell-mode/module index 2192745..12bdc90 100644 --- a/snippets/haskell-mode/module +++ b/snippets/haskell-mode/module @@ -8,7 +8,7 @@ module ${1:`(if (not buffer-file-name) "Module" (let ((name (file-name-sans-extension (buffer-file-name))) (case-fold-search nil)) - (if (search "src/" name) + (if (cl-search "src/" name) (replace-regexp-in-string "/" "." (replace-regexp-in-string "^\/[^A-Z]*" "" (car (last (split-string name "src"))))) diff --git a/snippets/haskell-mode/module.exports b/snippets/haskell-mode/module.exports index affd0db..7f636c2 100644 --- a/snippets/haskell-mode/module.exports +++ b/snippets/haskell-mode/module.exports @@ -8,7 +8,7 @@ module ${1:`(if (not buffer-file-name) "Module" (let ((name (file-name-sans-extension (buffer-file-name))) (case-fold-search nil)) - (if (search "src/" name) + (if (cl-search "src/" name) (replace-regexp-in-string "/" "." (replace-regexp-in-string "^\/[^A-Z]*" "" (car (last (split-string name "src"))))) diff --git a/snippets/haskell-mode/opt-pragma b/snippets/haskell-mode/opt-pragma index 7aa7aba..77fbedd 100644 --- a/snippets/haskell-mode/opt-pragma +++ b/snippets/haskell-mode/opt-pragma @@ -5,5 +5,5 @@ # contributor: Luke Hoersten # -- {-# OPTIONS_GHC `(when (boundp 'haskell-ghc-supported-options) - (some #'(lambda (fn) (funcall fn "GHC Option: " haskell-ghc-supported-options)) + (cl-some #'(lambda (fn) (funcall fn "GHC Option: " haskell-ghc-supported-options)) yas-prompt-functions))` #-} \ No newline at end of file