Skip to content

Commit

Permalink
(haskell-doc-in-code-p): New function.
Browse files Browse the repository at this point in the history
Ignore-this: 22ab4b915006208964f54f4e81451b08
(haskell-doc-in-code-p): New function.
(haskell-doc-show-type): Use it.

darcs-hash:20071212050419-c2f2e-babcee282d5cd608aa3f6b466a7dc3e6ec124e2c.gz
  • Loading branch information
monnier committed Dec 12, 2007
1 parent 2bf1697 commit 2c9e9d0
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion haskell-doc.el
Expand Up @@ -128,6 +128,10 @@
;;; Changelog:
;; ==========
;; $Log: haskell-doc.el,v $
;; Revision 1.29 2007/12/12 04:04:19 monnier
;; (haskell-doc-in-code-p): New function.
;; (haskell-doc-show-type): Use it.
;;
;; Revision 1.28 2007/08/30 03:10:08 monnier
;; Comment/docs fixes.
;;
Expand Down Expand Up @@ -1508,6 +1512,14 @@ function. Only the user interface is different."

;;@cindex haskell-doc-show-type

(defun haskell-doc-in-code-p ()
(not (or (and (eq haskell-literate 'bird)
;; Copied from haskell-indent-bolp.
(<= (current-column) 2)
(eq (char-after (line-beginning-position)) ?\>))
(if (fboundp 'syntax-ppss)
(nth 8 (syntax-ppss))))))

;;;###autoload
(defun haskell-doc-show-type (&optional sym)
"Show the type of the function near point.
Expand All @@ -1520,7 +1532,7 @@ current buffer."
;; if printed before do not print it again
(unless (string= sym (car haskell-doc-last-data))
(let ((doc (haskell-doc-sym-doc sym)))
(when doc
(when (and doc (haskell-doc-in-code-p))
;; In emacs 19.29 and later, and XEmacs 19.13 and later, all
;; messages are recorded in a log. Do not put haskell-doc messages
;; in that log since they are legion.
Expand Down

0 comments on commit 2c9e9d0

Please sign in to comment.