Update elisps enable to pass ghc options widely.

This commit is contained in:
HIBINO Kei 2011-11-15 20:40:25 +09:00
parent 21c5072e37
commit fe13f74c16
4 changed files with 12 additions and 6 deletions

View File

@ -87,7 +87,7 @@ unloaded modules are loaded")
(lambda ()
(message "Loading names...")
(apply 'call-process ghc-module-command nil t nil
(cons "-l" (cons "browse" mods)))
`(,@(ghc-make-ghc-options) "-l" "browse" ,@mods))
(message "Loading names...done"))
(length mods))))

View File

@ -9,11 +9,11 @@
;;; Code:
(require 'flymake)
(require 'ghc-func)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar ghc-hlint-options nil "*Hlint options")
(defvar ghc-ghc-options nil "*GHC options")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -47,8 +47,7 @@
(if ghc-flymake-command
(let ((hopts (ghc-mapconcat (lambda (x) (list "-h" x)) ghc-hlint-options)))
`(,@hopts "lint" ,file))
(let ((gopts (ghc-mapconcat (lambda (x) (list "-g" x)) ghc-ghc-options)))
`(,@gopts "check" ,file))))
`(,@(ghc-make-ghc-options) "check" ,file)))
(defun ghc-flymake-toggle-command ()
(interactive)

View File

@ -11,6 +11,8 @@
(defvar ghc-module-command "ghc-mod"
"*The command name of \"ghc-mod\"")
(defvar ghc-ghc-options nil "*GHC options")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun ghc-replace-character (string from to)
@ -135,4 +137,7 @@
(fset getter (list 'lambda '(struct) (list 'nth i 'struct)))
(setq keys (cdr keys)))))
(defun ghc-make-ghc-options ()
(ghc-mapconcat (lambda (x) (list "-g" x)) ghc-ghc-options))
(provide 'ghc-func)

View File

@ -26,7 +26,8 @@
(file (buffer-name)))
(with-temp-buffer
(cd cdir)
(call-process ghc-module-command nil t nil "type" file modname expr)
(apply 'call-process ghc-module-command nil t nil
`(,@(ghc-make-ghc-options) "type" ,file ,modname ,expr))
(message (buffer-substring (point-min) (1- (point-max)))))))
(defun ghc-show-info (&optional ask)
@ -49,7 +50,8 @@
(insert
(with-temp-buffer
(cd cdir)
(call-process ghc-module-command nil t nil "info" file modname expr)
(apply 'call-process ghc-module-command nil t nil
`(,@(ghc-make-ghc-options) "info" ,file ,modname ,expr))
(buffer-substring (point-min) (1- (point-max))))))
(display-buffer buf)))