M-C-t for showing type.
This commit is contained in:
parent
537d825668
commit
30924fa26d
@ -1,4 +1,5 @@
|
|||||||
SRCS = ghc.el ghc-func.el ghc-doc.el ghc-comp.el ghc-flymake.el ghc-command.el
|
SRCS = ghc.el ghc-func.el ghc-doc.el ghc-comp.el ghc-flymake.el \
|
||||||
|
ghc-command.el ghc-info.el
|
||||||
EMACS = emacs
|
EMACS = emacs
|
||||||
|
|
||||||
TEMPFILE = temp.el
|
TEMPFILE = temp.el
|
||||||
|
23
elisp/ghc-info.el
Normal file
23
elisp/ghc-info.el
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;;;
|
||||||
|
;;; ghc-info.el
|
||||||
|
;;;
|
||||||
|
|
||||||
|
;; Author: Kazu Yamamoto <Kazu@Mew.org>
|
||||||
|
;; Created: Nov 15, 2010
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
(require 'ghc-func)
|
||||||
|
|
||||||
|
(defun ghc-show-type ()
|
||||||
|
(interactive)
|
||||||
|
(if (not (ghc-which ghc-module-command))
|
||||||
|
(message "%s not found" ghc-module-command)
|
||||||
|
(let ((expr (thing-at-point 'symbol))
|
||||||
|
(file (buffer-name)))
|
||||||
|
(with-temp-buffer
|
||||||
|
(call-process ghc-module-command nil t nil "type" file expr)
|
||||||
|
(message (buffer-substring (point-min) (1- (point-max))))))))
|
||||||
|
|
||||||
|
(provide 'ghc-info)
|
@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
(require 'ghc-comp)
|
(require 'ghc-comp)
|
||||||
(require 'ghc-doc)
|
(require 'ghc-doc)
|
||||||
|
(require 'ghc-info)
|
||||||
(require 'ghc-flymake)
|
(require 'ghc-flymake)
|
||||||
(require 'ghc-command)
|
(require 'ghc-command)
|
||||||
(require 'dabbrev)
|
(require 'dabbrev)
|
||||||
@ -40,6 +41,7 @@
|
|||||||
(defvar ghc-help-key "\e?")
|
(defvar ghc-help-key "\e?")
|
||||||
(defvar ghc-insert-key "\et")
|
(defvar ghc-insert-key "\et")
|
||||||
(defvar ghc-sort-key "\es")
|
(defvar ghc-sort-key "\es")
|
||||||
|
(defvar ghc-type-key "\e\C-t")
|
||||||
(defvar ghc-check-key "\C-x\C-s")
|
(defvar ghc-check-key "\C-x\C-s")
|
||||||
(defvar ghc-toggle-key "\C-c\C-c")
|
(defvar ghc-toggle-key "\C-c\C-c")
|
||||||
|
|
||||||
@ -55,6 +57,7 @@
|
|||||||
(unless ghc-initialized
|
(unless ghc-initialized
|
||||||
(define-key haskell-mode-map ghc-completion-key 'ghc-complete)
|
(define-key haskell-mode-map ghc-completion-key 'ghc-complete)
|
||||||
(define-key haskell-mode-map ghc-document-key 'ghc-browse-document)
|
(define-key haskell-mode-map ghc-document-key 'ghc-browse-document)
|
||||||
|
(define-key haskell-mode-map ghc-type-key 'ghc-show-type)
|
||||||
(define-key haskell-mode-map ghc-import-key 'ghc-import-module)
|
(define-key haskell-mode-map ghc-import-key 'ghc-import-module)
|
||||||
(define-key haskell-mode-map ghc-previous-key 'flymake-goto-prev-error)
|
(define-key haskell-mode-map ghc-previous-key 'flymake-goto-prev-error)
|
||||||
(define-key haskell-mode-map ghc-next-key 'flymake-goto-next-error)
|
(define-key haskell-mode-map ghc-next-key 'flymake-goto-next-error)
|
||||||
|
Loading…
Reference in New Issue
Block a user