Skip to content

Commit

Permalink
Patch courtesy of Alex Ott
Browse files Browse the repository at this point in the history
Ignore-this: e52b612e4c50a13aaff2216e261c0431
 - code for haskell-font-lock.el - adds more unicode symbols
 - code for inf-haskell.el fixes regex for inferior-haskell-type, so it
   will parse type declarations properly
 - code for haskell-mode.el adds ability to search function signatures at
   hayoo

darcs-hash:20091101163319-f57bf-3e1aceaa43782816017587c7b87a3edcc58d8669.gz
  • Loading branch information
svein.ove committed Nov 1, 2009
1 parent 5d9d32b commit f846b94
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
9 changes: 9 additions & 0 deletions haskell-font-lock.el
Expand Up @@ -142,6 +142,15 @@ and `unicode'."
(cons "->" (decode-char 'ucs 8594)) (cons "->" (decode-char 'ucs 8594))
(cons "<-" (decode-char 'ucs 8592)) (cons "<-" (decode-char 'ucs 8592))
(cons "=>" (decode-char 'ucs 8658)) (cons "=>" (decode-char 'ucs 8658))
(cons "()" (decode-char 'ucs #X2205))
(cons "==" (decode-char 'ucs #X2261))
(cons "/=" (decode-char 'ucs #X2262))
(cons ">=" (decode-char 'ucs #X2265))
(cons "<=" (decode-char 'ucs #X2264))
(cons "!!" (decode-char 'ucs #X203C))
(cons "&&" (decode-char 'ucs #X2227))
(cons "||" (decode-char 'ucs #X2228))
(cons "sqrt" (decode-char 'ucs #X221A))
(cons "~>" (decode-char 'ucs 8669)) ;; Omega language (cons "~>" (decode-char 'ucs 8669)) ;; Omega language
;; (cons "~>" (decode-char 'ucs 8605)) ;; less desirable ;; (cons "~>" (decode-char 'ucs 8605)) ;; less desirable
(cons "-<" (decode-char 'ucs 8610)) ;; Paterson's arrow syntax (cons "-<" (decode-char 'ucs 8610)) ;; Paterson's arrow syntax
Expand Down
13 changes: 13 additions & 0 deletions haskell-mode.el
Expand Up @@ -500,6 +500,19 @@ If nil, use the Hoogle web-site."
(start-process "hoogle" (current-buffer) haskell-hoogle-command (start-process "hoogle" (current-buffer) haskell-hoogle-command
query))))) query)))))


;;;###autoload
(defun haskell-hayoo (query)
"Do a Hayoo search for QUERY."
(interactive
(let ((def (haskell-ident-at-point)))
(if (and def (symbolp def)) (setq def (symbol-name def)))
(list (read-string (if def
(format "Hayoo query (default %s): " def)
"Hayoo query: ")
nil nil def))))
(browse-url (format "http://holumbus.fh-wedel.de/hayoo/hayoo.html?query=%s" query)))


;; Provide ourselves: ;; Provide ourselves:


(provide 'haskell-mode) (provide 'haskell-mode)
Expand Down
7 changes: 4 additions & 3 deletions inf-haskell.el
Expand Up @@ -422,10 +422,11 @@ The returned info is cached for reuse by `haskell-doc-mode'."
(save-excursion (goto-char parsing-end) (save-excursion (goto-char parsing-end)
(line-beginning-position 2)) (line-beginning-position 2))
(point)))))) (point))))))
(if (not (string-match (concat "\\`" (regexp-quote expr) "[ \t]+::[ \t]*") (if (not (string-match (concat "^\\(" (regexp-quote expr) "[ \t\n]+::[ \t\n]*\\(.\\|\n\\)*\\)")
type)) type))
(error "No type info: %s" type) (error "No type info: %s" type)

(progn
(setf type (match-string 1 type))
;; Cache for reuse by haskell-doc. ;; Cache for reuse by haskell-doc.
(when (and (boundp 'haskell-doc-mode) haskell-doc-mode (when (and (boundp 'haskell-doc-mode) haskell-doc-mode
(boundp 'haskell-doc-user-defined-ids) (boundp 'haskell-doc-user-defined-ids)
Expand All @@ -442,7 +443,7 @@ The returned info is cached for reuse by `haskell-doc-mode'."
(when insert-value (when insert-value
(beginning-of-line) (beginning-of-line)
(insert type "\n")) (insert type "\n"))
type))) type))))


;;;###autoload ;;;###autoload
(defun inferior-haskell-info (sym) (defun inferior-haskell-info (sym)
Expand Down

0 comments on commit f846b94

Please sign in to comment.