Skip to content

Commit

Permalink
Use cl-lib (fixes haskell#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
cydparser committed Sep 18, 2016
1 parent c72e467 commit 9e41a53
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions haskell-snippets.el
Expand Up @@ -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
Expand Down Expand Up @@ -68,6 +68,9 @@

;;; Code:

(require 'cl-lib)
(require 'yasnippet)

(setq haskell-snippets-dir
(file-name-directory load-file-name))

Expand All @@ -81,7 +84,6 @@
(eval-after-load 'yasnippet
'(haskell-snippets-initialize))

(require 'yasnippet)
(provide 'haskell-snippets)

;;; haskell-snippets.el ends here
2 changes: 1 addition & 1 deletion snippets/haskell-mode/import.qualified
Expand Up @@ -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
(cl-subseq name 0 1)))}}$0
2 changes: 1 addition & 1 deletion snippets/haskell-mode/lang-pragma
Expand Up @@ -5,5 +5,5 @@
# contributor: Luke Hoersten <luke@hoersten.org>
# --
{-# 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))` #-}
2 changes: 1 addition & 1 deletion snippets/haskell-mode/module
Expand Up @@ -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")))))
Expand Down
2 changes: 1 addition & 1 deletion snippets/haskell-mode/module.exports
Expand Up @@ -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")))))
Expand Down
2 changes: 1 addition & 1 deletion snippets/haskell-mode/opt-pragma
Expand Up @@ -5,5 +5,5 @@
# contributor: Luke Hoersten <luke@hoersten.org>
# --
{-# 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))` #-}

0 comments on commit 9e41a53

Please sign in to comment.