ghc-mod 0.4.0 → 0.4.1
raw patch · 4 files changed
+65/−4 lines, 4 files
Files
- GHCMod.hs +1/−1
- elisp/Makefile +2/−1
- elisp/ghc-command.el +60/−0
- ghc-mod.cabal +2/−2
GHCMod.hs view
@@ -16,7 +16,7 @@ ---------------------------------------------------------------- usage :: String-usage = "ghc-mod version 0.4.0\n"+usage = "ghc-mod version 0.4.1\n" ++ "Usage:\n" ++ "\t ghc-mod list\n" ++ "\t ghc-mod lang\n"
elisp/Makefile view
@@ -1,10 +1,11 @@-SRCS = ghc.el ghc-func.el ghc-doc.el ghc-comp.el ghc-flymake.el+SRCS = ghc.el ghc-func.el ghc-doc.el ghc-comp.el ghc-flymake.el ghc-command.el EMACS = emacs TEMPFILE = temp.el all: $(TEMPFILE) ghc.el $(EMACS) -batch -q -no-site-file -l ./$(TEMPFILE) -f ghc-compile+ rm -f $(TEMPFILE) $(TEMPFILE): @echo '(setq load-path (cons "." load-path))' >> $(TEMPFILE)
+ elisp/ghc-command.el view
@@ -0,0 +1,60 @@+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+;;;+;;; ghc-command.el+;;;++;; Author: Kazu Yamamoto <Kazu@Mew.org>+;; Created: Apr 13, 2010++;;; Code:++(provide 'ghc-flymake)++(defun ghc-insert-template ()+ (interactive)+ (cond+ ((bobp)+ (ghc-insert-module-template))+ ((save-excursion+ (beginning-of-line)+ (looking-at "^[^ ]+ *::"))+ (ghc-insert-function-template))+ ((ghc-flymake-have-errs-p)+ (ghc-flymake-insert-from-warning))+ (t+ (message "Nothing to be done"))))++(defun ghc-insert-module-template ()+ ;; xxx mod from filename...+ (let ((mod (file-name-sans-extension (buffer-name))))+ (insert "module " mod " where\n")))++(defun ghc-insert-function-template ()+ (save-excursion+ (beginning-of-line)+ (when (looking-at "^\\([^ ]+\\) *::")+ (save-match-data+ (forward-line)+ (if (eobp) (insert "\n")))+ (insert (match-string 1) " = undefined\n"))))++(defun ghc-sort-lines (beg end)+ (interactive "r")+ (save-excursion+ (save-restriction+ (narrow-to-region beg end)+ (goto-char (point-min))+ (let ((inhibit-field-text-motion t))+ (sort-subr nil 'forward-line 'end-of-line+ (lambda ()+ (re-search-forward "^import\\( *qualified\\)? *" nil t)+ nil)+ 'end-of-line)))))++(defun ghc-save-buffer ()+ (interactive)+ (if (buffer-modified-p)+ (save-buffer)+ (flymake-start-syntax-check)))++(provide 'ghc-command)
ghc-mod.cabal view
@@ -1,5 +1,5 @@ Name: ghc-mod-Version: 0.4.0+Version: 0.4.1 Author: Kazu Yamamoto <kazu@iij.ad.jp> Maintainer: Kazu Yamamoto <kazu@iij.ad.jp> License: BSD3@@ -20,7 +20,7 @@ Build-Type: Simple Data-Dir: elisp Data-Files: Makefile ghc.el ghc-func.el ghc-doc.el ghc-comp.el- ghc-flymake.el+ ghc-flymake.el ghc-command.el Executable ghc-mod Main-Is: GHCMod.hs Other-Modules: List Browse Check Lang Lint Types