From fe13f74c1686385e986d3dbc261c566bc86956f3 Mon Sep 17 00:00:00 2001 From: HIBINO Kei Date: Tue, 15 Nov 2011 20:40:25 +0900 Subject: [PATCH] Update elisps enable to pass ghc options widely. --- elisp/ghc-comp.el | 2 +- elisp/ghc-flymake.el | 5 ++--- elisp/ghc-func.el | 5 +++++ elisp/ghc-info.el | 6 ++++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/elisp/ghc-comp.el b/elisp/ghc-comp.el index 2e2471b..56df544 100644 --- a/elisp/ghc-comp.el +++ b/elisp/ghc-comp.el @@ -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)))) diff --git a/elisp/ghc-flymake.el b/elisp/ghc-flymake.el index 4af0c56..4b91d63 100644 --- a/elisp/ghc-flymake.el +++ b/elisp/ghc-flymake.el @@ -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) diff --git a/elisp/ghc-func.el b/elisp/ghc-func.el index 009b4f2..bb02e00 100644 --- a/elisp/ghc-func.el +++ b/elisp/ghc-func.el @@ -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) diff --git a/elisp/ghc-info.el b/elisp/ghc-info.el index bb4b5d9..33e022b 100644 --- a/elisp/ghc-info.el +++ b/elisp/ghc-info.el @@ -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)))