From 2c07d3c3341a723a4e6a86d2022e6cbb92f3be3d Mon Sep 17 00:00:00 2001 From: Alec Date: Fri, 24 Apr 2015 19:09:25 -0400 Subject: [PATCH] ensure a string in `haskell-process-do-try-type` --- haskell-commands.el | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/haskell-commands.el b/haskell-commands.el index c94d49a63..2c3ac96d3 100644 --- a/haskell-commands.el +++ b/haskell-commands.el @@ -572,21 +572,22 @@ command from GHCi." (defun haskell-process-do-try-info (sym) "Get info of `sym' and echo in the minibuffer." - (let ((process (haskell-interactive-process))) - (haskell-process-queue-command - process - (make-haskell-command - :state (cons process sym) - :go (lambda (state) - (haskell-process-send-string - (car state) - (if (string-match "^[A-Za-z_]" (cdr state)) - (format ":info %s" (cdr state)) - (format ":info (%s)" (cdr state))))) - :complete (lambda (state response) - (unless (or (string-match "^Top level" response) - (string-match "^" response)) - (haskell-mode-message-line response))))))) + (when (stringp sym) + (let ((process (haskell-interactive-process))) + (haskell-process-queue-command + process + (make-haskell-command + :state (cons process sym) + :go (lambda (state) + (haskell-process-send-string + (car state) + (if (string-match "^[A-Za-z_]" (cdr state)) + (format ":info %s" (cdr state)) + (format ":info (%s)" (cdr state))))) + :complete (lambda (state response) + (unless (or (string-match "^Top level" response) + (string-match "^" response)) + (haskell-mode-message-line response)))))))) (defun haskell-process-do-try-type (sym) "Get type of `sym' and echo in the minibuffer."