diff --git a/Makefile b/Makefile index c3dfdd976..7e4acd289 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,3 @@ - # # Note: Due to MELPA distributing directly from github source version # needs to be embedded in files as is without proprocessing. @@ -28,9 +27,9 @@ INSTALL_INFO = install-info EMACS := $(shell echo "$${EMACS:-emacs}") EFLAGS = --eval "(add-to-list 'load-path (expand-file-name \"tests/compat\") 'append)" \ - --eval "(when (< emacs-major-version 24) \ - (setq byte-compile-warnings '(not cl-functions)))" \ - --eval '(setq byte-compile-error-on-warn t)' + --eval "(when (< emacs-major-version 24) \ + (setq byte-compile-warnings '(not cl-functions)))" \ + --eval '(setq byte-compile-error-on-warn t)' BATCH = $(EMACS) $(EFLAGS) --batch -Q -L . @@ -73,7 +72,6 @@ ELFILES = \ haskell-string.el \ haskell-unicode-input-method.el \ haskell-utils.el \ - haskell-yas.el \ inf-haskell.el ELCFILES = $(ELFILES:.el=.elc) @@ -114,12 +112,12 @@ dir: haskell-mode.info haskell-mode.info: haskell-mode.texi # Check if chapter order is same as node order @sed -n -e '/@chapter/ s/@code{\(.*\)}/\1/' \ - -e 's/@chapter \(.*\)$$/* \1::/p' \ - -e 's/@unnumbered \(.*\)$$/* \1::/p' \ - haskell-mode.texi > haskell-mode-menu-order.txt + -e 's/@chapter \(.*\)$$/* \1::/p' \ + -e 's/@unnumbered \(.*\)$$/* \1::/p' \ + haskell-mode.texi > haskell-mode-menu-order.txt @sed -e '1,/@menu/ d' \ - -e '/end menu/,$$ d' \ - haskell-mode.texi > haskell-mode-content-order.txt + -e '/end menu/,$$ d' \ + haskell-mode.texi > haskell-mode-content-order.txt diff -C 1 haskell-mode-menu-order.txt haskell-mode-content-order.txt @rm haskell-mode-menu-order.txt haskell-mode-content-order.txt diff --git a/haskell-customize.el b/haskell-customize.el index 700ab4b4d..b48345b3a 100644 --- a/haskell-customize.el +++ b/haskell-customize.el @@ -363,7 +363,7 @@ sure all haskell customize definitions have been loaded." (interactive) ;; make sure all modules with (defcustom ...)s are loaded (mapc 'require - '(haskell-checkers haskell-compile haskell-doc haskell-font-lock haskell-indentation haskell-indent haskell-interactive-mode haskell-menu haskell-process haskell-yas inf-haskell)) + '(haskell-checkers haskell-compile haskell-doc haskell-font-lock haskell-indentation haskell-indent haskell-interactive-mode haskell-menu haskell-process inf-haskell)) (customize-browse 'haskell)) (provide 'haskell-customize) diff --git a/haskell-yas.el b/haskell-yas.el deleted file mode 100644 index 1efc24369..000000000 --- a/haskell-yas.el +++ /dev/null @@ -1,70 +0,0 @@ -;;; haskell-yas.el --- Customization support for Luke Hoersten's yasnippets - -;; Copyright (C) 2013 John Wiegley, Luke Hoersten - -;; Author: John Wiegley -;; Luke Hoersten -;; Keywords: faces files Haskell - -;; This file is not part of GNU Emacs. - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; Provides customization variables for Luke Hoersten's yasnippet collection -;; to depend on. - -;;; Code: - -(eval-when-compile - (require 'yasnippet nil t)) - -(defgroup haskell-yas nil - "Customizations for Luke Hoersten's yasnippet collection for haskell-mode." - :group 'haskell - :prefix "haskell-yas-") - -(defcustom haskell-yas-completing-function 'ido-completing-read - "Function to use for completing among alternatives." - :group 'haskell-yas - :type 'function) - -;;;###autoload -(defun haskell-yas-complete (&rest args) - (apply haskell-yas-completing-function args)) - -(defconst haskell-snippets-dir - (expand-file-name "snippets" (file-name-directory load-file-name))) - -(defvar yas-snippet-dirs) -(declare-function yas-load-directory "ext:yasnippet" - (top-level-dir &optional use-jit interactive)) - -;;;###autoload -(defun haskell-snippets-initialize () - "Register haskell snippets with yasnippet." - (add-to-list 'yas-snippet-dirs haskell-snippets-dir t) - (yas-load-directory haskell-snippets-dir)) - -;;;###autoload -(eval-after-load 'yasnippet - '(haskell-snippets-initialize)) - - -;; Provide ourselves: - -(provide 'haskell-yas) - -;;; haskell-yas.el ends here diff --git a/snippets/README.md b/snippets/README.md deleted file mode 100644 index fec26bdbf..000000000 --- a/snippets/README.md +++ /dev/null @@ -1,89 +0,0 @@ -# Shnippet - - -**Shnippet** is a collection of -[YASnippet][yas] -[Haskell][haskell] snippets for Emacs. - - -## Installation - -Clone repository: - - $ cd ~/.emacs.d/snippets - $ git clone https://github.com/LukeHoersten/shnippet - OR - $ hg clone https://bitbucket.org/LukeHoersten/shnippet - -Add the cloned repository to YASnippet's `yas-snippet-dirs`: - - (setq yas-snippet-dirs - '("~/.emacs.d/snippets/shnippet" - "/other/paths/" - )) - -Snippets may have to be recompiled and reloaded in Emacs if YASnippet -is already in use: - - M-x yas-recompile-all - M-x yas-reload-all - - -Haskell snippts should now be available to use! In a `haskell-mode` -buffer, type `fn`. A prompt should appear asking which `fn` -snippet to expand. - -I **highly** recommend using YASnippet with [ido-mode]. Configure -Emacs: - - (setq-default yas-prompt-functions '(yas-ido-prompt yas-dropdown-prompt)) - -This is important so that alternatives (like `import` vs. `import -qualified`) can quickly be selected with a single key stroke. - - -## Available Expansion Keys - -* `new` - newtype -* `mod` - module [simple, exports] -* `main ` - main module and funtion -* `let` - let bindings -* `lang` - language extension pragmas -* `\` - lambda function -* `inst` - instance declairation -* `imp` - import modules [simple, qualified] -* `if` - if conditional [inline, block] -* `<-` - monadic get -* `fn` - top level function [simple, guarded, clauses] -* `data` - data type definition [inline, record] -* `=>` - type constraint -* `{-` - block comment -* `case` - case statement - - -## Design Ideals - -* Keep snippet keys (the prefix used to auto-complete) to four - characters or less while still being as easy to guess as possible. - -* Have as few keys as possible. The more keys there are to remember, - the harder snippets are to use and learn. - -* Leverage [ido-mode][] when reasonable. For instance, to keep the - number of snippet keys to a minimum as well as auto complete things - like [Haskell Langauge Extension Pragmas][lang-pragma]. When - multiple snippets share a key (ex: `fn`), the `ido-mode` prompts are - unique to one character (ex: `guarded function` and `simple - function` are `g` and `s` respectively). - - -## Authors - -This code is written and maintained by Luke Hoersten, -. - - -[yas]: https://github.com/capitaomorte/yasnippet -[ido-mode]: http://www.emacswiki.org/emacs/InteractivelyDoThings -[lang-pragma]: http://hackage.haskell.org/packages/archive/Cabal/1.16.0.3/doc/html/Language-Haskell-Extension.html#t:KnownExtension -[haskell]: http://haskell.org/ diff --git a/snippets/haskell-mode/.yas-ignore-filenames-as-triggers b/snippets/haskell-mode/.yas-ignore-filenames-as-triggers deleted file mode 100644 index e69de29bb..000000000 diff --git a/snippets/haskell-mode/.yas-make-groups b/snippets/haskell-mode/.yas-make-groups deleted file mode 100644 index e69de29bb..000000000 diff --git a/snippets/haskell-mode/case b/snippets/haskell-mode/case deleted file mode 100644 index e7c0a5d6d..000000000 --- a/snippets/haskell-mode/case +++ /dev/null @@ -1,9 +0,0 @@ -# -*- mode: snippet -*- -# key: case -# name: case -# expand-env: ((yas-indent-line 'fixed)) -# contributor: Luke Hoersten -# -- -case ${1:x} of - ${2:Data} -> ${4:undefined} - ${3:Data} -> ${5:undefined}$0 \ No newline at end of file diff --git a/snippets/haskell-mode/comment.block b/snippets/haskell-mode/comment.block deleted file mode 100644 index 09ad3affd..000000000 --- a/snippets/haskell-mode/comment.block +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -# key: {- -# name: block comment -# contributor: Luke Hoersten -# -- -{- $0 -} \ No newline at end of file diff --git a/snippets/haskell-mode/constraint b/snippets/haskell-mode/constraint deleted file mode 100644 index 617ce6159..000000000 --- a/snippets/haskell-mode/constraint +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -# key: => -# name: Type constraint -# contributor: Luke Hoersten -# -- -(${1:Class} ${2:m}) => $0 \ No newline at end of file diff --git a/snippets/haskell-mode/data.inline b/snippets/haskell-mode/data.inline deleted file mode 100644 index fafaf1e47..000000000 --- a/snippets/haskell-mode/data.inline +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# key: data -# name: inline data -# condition: (= (length "data") (current-column)) -# contributor: Luke Hoersten -# -- -data ${1:Type} = ${2:Data}$0 ${3:deriving (${4:Show, Eq})} \ No newline at end of file diff --git a/snippets/haskell-mode/data.record b/snippets/haskell-mode/data.record deleted file mode 100644 index c4b005b0f..000000000 --- a/snippets/haskell-mode/data.record +++ /dev/null @@ -1,10 +0,0 @@ -# -*- mode: snippet -*- -# key: data -# name: record data -# condition: (= (length "data") (current-column)) -# contributor: Luke Hoersten -# -- -data ${1:Type} = $1 - { ${2:field} :: ${3:Type} - , ${4:field} :: ${5:Type}$0 - } ${6:deriving (${7:Show, Eq})} \ No newline at end of file diff --git a/snippets/haskell-mode/fn b/snippets/haskell-mode/fn deleted file mode 100644 index 8aa9050ac..000000000 --- a/snippets/haskell-mode/fn +++ /dev/null @@ -1,9 +0,0 @@ -# -*- mode: snippet -*- -# key: fn -# name: simple function -# condition: (= (length "fn") (current-column)) -# expand-env: ((yas-indent-line 'fixed)) -# contributor: Luke Hoersten -# -- -${1:f} :: ${2:a} ${3:-> ${4:b}} -$1 ${5:x} = ${6:undefined}$0 \ No newline at end of file diff --git a/snippets/haskell-mode/fn.clause b/snippets/haskell-mode/fn.clause deleted file mode 100644 index c206f864d..000000000 --- a/snippets/haskell-mode/fn.clause +++ /dev/null @@ -1,10 +0,0 @@ -# -*- mode: snippet -*- -# key: fn -# name: clause function -# condition: (= (length "fn") (current-column)) -# expand-env: ((yas-indent-line 'fixed)) -# contributor: Luke Hoersten -# -- -${1:f} :: ${2:a} ${3:-> ${4:b}} -$1 ${5:pattern} = ${7:undefined} -$1 ${6:pattern} = ${8:undefined}$0 \ No newline at end of file diff --git a/snippets/haskell-mode/fn.guarded b/snippets/haskell-mode/fn.guarded deleted file mode 100644 index 08c622f2d..000000000 --- a/snippets/haskell-mode/fn.guarded +++ /dev/null @@ -1,11 +0,0 @@ -# -*- mode: snippet -*- -# key: fn -# name: guarded function -# condition: (= (length "fn") (current-column)) -# expand-env: ((yas-indent-line 'fixed)) -# contributor: Luke Hoersten -# -- -${1:f} :: ${2:a} ${3:-> ${4:b}} -$1 ${5:x} - | ${6:conditional} = ${8:undefined} - | ${7:conditional} = ${9:undefined}$0 \ No newline at end of file diff --git a/snippets/haskell-mode/get b/snippets/haskell-mode/get deleted file mode 100644 index d10c72678..000000000 --- a/snippets/haskell-mode/get +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -# key: <- -# name: monadic get -# contributor: Luke Hoersten -# -- -${1:x} <- ${2:undefined}$0 \ No newline at end of file diff --git a/snippets/haskell-mode/if.block b/snippets/haskell-mode/if.block deleted file mode 100644 index 023fe552b..000000000 --- a/snippets/haskell-mode/if.block +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet -*- -# key: if -# name: block if -# contributor: Luke Hoersten -# -- -if ${1:condition} - then ${2:undefined} - else ${3:undefined}$0 \ No newline at end of file diff --git a/snippets/haskell-mode/if.inline b/snippets/haskell-mode/if.inline deleted file mode 100644 index 8f77d1a0a..000000000 --- a/snippets/haskell-mode/if.inline +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -# key: if -# name: inline if -# contributor: Luke Hoersten -# -- -if ${1:condition} then ${2:undefined} else ${3:undefined}$0 \ No newline at end of file diff --git a/snippets/haskell-mode/import b/snippets/haskell-mode/import deleted file mode 100644 index e8d067f13..000000000 --- a/snippets/haskell-mode/import +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# key: imp -# name: simple import -# condition: (= (length "imp") (current-column)) -# contributor: Luke Hoersten -# -- -import ${1:Module} ${2:(${3:f})} \ No newline at end of file diff --git a/snippets/haskell-mode/import.qualified b/snippets/haskell-mode/import.qualified deleted file mode 100644 index a8f728ffa..000000000 --- a/snippets/haskell-mode/import.qualified +++ /dev/null @@ -1,9 +0,0 @@ -# -*- mode: snippet -*- -# key: imp -# name: qualified import -# condition: (= (length "imp") (current-column)) -# contributor: Luke Hoersten -# -- -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 diff --git a/snippets/haskell-mode/instance b/snippets/haskell-mode/instance deleted file mode 100644 index 6f0607a45..000000000 --- a/snippets/haskell-mode/instance +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet -*- -# key: inst -# name: instance -# condition: (= (length "inst") (current-column)) -# contributor: Luke Hoersten -# -- -instance ${1:Class} ${2:Data} where - ${3:f} = ${4:undefined}$0 \ No newline at end of file diff --git a/snippets/haskell-mode/lambda b/snippets/haskell-mode/lambda deleted file mode 100644 index 43bf09af2..000000000 --- a/snippets/haskell-mode/lambda +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -# key: \ -# name: lambda -# contributor: Luke Hoersten -# -- -\\${1:x} -> ${2:undefined}$0 \ No newline at end of file diff --git a/snippets/haskell-mode/lang-pragma b/snippets/haskell-mode/lang-pragma deleted file mode 100644 index 241d43a90..000000000 --- a/snippets/haskell-mode/lang-pragma +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# key: lang -# name: language pragma -# condition: (= (length "lang") (current-column)) -# contributor: Luke Hoersten , John Wiegley -# -- -{-# LANGUAGE `(progn (require 'haskell-yas) (haskell-yas-complete "Extension: " haskell-ghc-supported-languages))` #-} \ No newline at end of file diff --git a/snippets/haskell-mode/let b/snippets/haskell-mode/let deleted file mode 100644 index 87ca592ea..000000000 --- a/snippets/haskell-mode/let +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -# key: let -# name: let -# contributor: Luke Hoersten -# -- -let ${1:x} = ${2:undefined}$0 \ No newline at end of file diff --git a/snippets/haskell-mode/main b/snippets/haskell-mode/main deleted file mode 100644 index fe1009f59..000000000 --- a/snippets/haskell-mode/main +++ /dev/null @@ -1,13 +0,0 @@ -# -*- mode: snippet -*- -# key: main -# name: main module -# condition: (= (length "main") (current-column)) -# expand-env: ((yas-indent-line 'fixed)) -# contributor: Luke Hoersten -# -- -module Main where - -main :: IO () -main = do - ${1:undefined}$0 - return () \ No newline at end of file diff --git a/snippets/haskell-mode/module b/snippets/haskell-mode/module deleted file mode 100644 index eddac335a..000000000 --- a/snippets/haskell-mode/module +++ /dev/null @@ -1,14 +0,0 @@ -# -*- mode: snippet -*- -# key: mod -# name: simple module -# condition: (= (length "mod") (current-column)) -# expand-env: ((yas-indent-line 'fixed)) -# contributor: Luke Hoersten -# -- -module ${1:`(if (not buffer-file-name) "Module" - (let ((name (file-name-sans-extension (buffer-file-name)))) - (if (search "src/" name) - (replace-regexp-in-string "/" "." (car (last (split-string name "src/")))) - (file-name-nondirectory name))))`} where - -$0 \ No newline at end of file diff --git a/snippets/haskell-mode/module.exports b/snippets/haskell-mode/module.exports deleted file mode 100644 index e5a4b6a7c..000000000 --- a/snippets/haskell-mode/module.exports +++ /dev/null @@ -1,17 +0,0 @@ -# -*- mode: snippet -*- -# key: mod -# name: exports module -# condition: (= (length "mod") (current-column)) -# expand-env: ((yas-indent-line 'fixed)) -# contributor: Luke Hoersten -# -- -module ${1:`(if (not buffer-file-name) "Module" - (let ((name (file-name-sans-extension (buffer-file-name)))) - (if (search "src/" name) - (replace-regexp-in-string "/" "." (car (last (split-string name "src/")))) - (file-name-nondirectory name))))`} - ( ${3:export} - ${4:, ${5:export}} - ) where - -$0 \ No newline at end of file diff --git a/snippets/haskell-mode/newtype b/snippets/haskell-mode/newtype deleted file mode 100644 index 3a705788c..000000000 --- a/snippets/haskell-mode/newtype +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# key: new -# name: newtype -# condition: (= (length "new") (current-column)) -# contributor: Luke Hoersten -# -- -newtype ${1:Type} = $1 { un$1 :: ${2:a} } ${3:deriving (${4:Show, Eq})} \ No newline at end of file