Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

(haskell-ident-at-point): New fun. Copy of haskell-doc-get-current-word.

Ignore-this: a142f12fc162f69bedde6db00b0e59d5
(haskell-ident-at-point): New fun.  Copy of haskell-doc-get-current-word.
(haskell-mode-map): Add bindings for inferior-haskell-(type|info|find).

darcs-hash:20070210071701-c2f2e-bc6fa62ccb98390f4b6e5c97f4ff281901932eb5.gz
  • Loading branch information...
commit 9e992796b89b3931293298bc0b7440b0f12a3a6c 1 parent 6566d19
monnier authored
Showing with 16 additions and 2 deletions.
  1. +16 −2 haskell-mode.el
View
18 haskell-mode.el
@@ -1,6 +1,6 @@
;;; haskell-mode.el --- A Haskell editing mode -*-coding: iso-8859-1;-*-
-;; Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc
+;; Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc
;; Copyright (C) 1992, 1997-1998 Simon Marlow, Graeme E Moss, and Tommy Thorn
;; Authors: 1992 Simon Marlow
@@ -272,9 +272,12 @@ be set to the preferred literate style."
(define-key map [?\C-c ?\C-r] 'inferior-haskell-reload-file)
(define-key map [?\C-c ?\C-b] 'switch-to-haskell)
;; (define-key map [?\C-c ?\C-s] 'inferior-haskell-start-process)
-
;; That's what M-; is for.
;; (define-key map "\C-c\C-c" 'comment-region)
+
+ (define-key map (kbd "C-c C-t") 'inferior-haskell-type)
+ (define-key map (kbd "C-c C-i") 'inferior-haskell-info)
+ (define-key map (kbd "C-c M-.") 'inferior-haskell-find-definition)
map)
"Keymap used in Haskell mode.")
@@ -366,6 +369,17 @@ be set to the preferred literate style."
table)
"Syntax table used in Haskell mode.")
+(defun haskell-ident-at-point ()
+ "Return the identifier under point, or nil if none found."
+ (save-excursion
+ (if (looking-at "\\s_")
+ (buffer-substring-no-properties
+ (progn (skip-syntax-backward "_") (point))
+ (progn (skip-syntax-forward "_") (point)))
+ (buffer-substring-no-properties
+ (progn (skip-syntax-backward "w'") (skip-syntax-forward "'") (point))
+ (progn (skip-syntax-forward "w'") (point))))))
+
;; Various mode variables.
(defcustom haskell-mode-hook nil
Please sign in to comment.
Something went wrong with that request. Please try again.