Skip to content

haskell-mode-contextual-space called on zero length identifier #572

Closed
@RasmusWL

Description

@RasmusWL

I tried turning on debug-on-error in my emacs, and it comes up with the following error when performing a haskell-mode-contextual-space. This bug seems to break the current session, as nothing happens when i call haskell-process-cabal-build.

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-match("^[A-Za-z_]" nil)
  #[(state) "\301�@\302\303�A\"\203��\304\305�A\"\202��\304\306�A\"\"\207" [state haskell-process-send-string string-match "^[A-Za-z_]" format ":info %s" ":info (%s)"] 5]((((name . "futhark") (current-response-cursor . 0) (current-response . "") (command-queue) (inferior-process . #<process futhark>) (is-restarting) (current-command . [cl-struct-haskell-command #0 #[(state) "\301�@\302\303�A\"\203��\304\305�A\"\202��\304\306�A\"\"\207" [state haskell-process-send-string string-match "^[A-Za-z_]" format ":info %s" ":info (%s)"] 5] nil #[(state response) "\301\302�\"\206��\301\303�\"?\205��\304�!\207" [response string-match "^Top level" "^<interactive>" haskell-mode-message-line] 3]]) (suggested-imported) (sent-stdin) (evaluating) (session (name . "futhark") (ignored-files "/home/rasmus/uni/flat/futhark/.ghci" "/home/rasmus/uni/flat/futhark") (interactive-buffer . #<buffer *futhark*>) (current-dir . "/home/rasmus/uni/flat/futhark/") (target . "") (cabal-checksum . "7e75d6e37133be0705f160ed78fc3dd7") (cabal-dir . "/home/rasmus/uni/flat/futhark/") (process (name . "futhark") (current-response-cursor . 0) (current-response . "") (command-queue) (inferior-process . #<process futhark>) (is-restarting) (current-command . [cl-struct-haskell-command #0 #[(state) "\301�@\302\303�A\"\203��\304\305�A\"\202��\304\306�A\"\"\207" [state haskell-process-send-string string-match "^[A-Za-z_]" format ":info %s" ":info (%s)"] 5] nil #[(state response) "\301\302�\"\206��\301\303�\"?\205��\304�!\207" [response string-match "^Top level" "^<interactive>" haskell-mode-message-line] 3]]) (suggested-imported) (sent-stdin) (evaluating) #2)))))
  haskell-command-exec-go([cl-struct-haskell-command (((name . "futhark") (current-response-cursor . 0) (current-response . "") (command-queue) (inferior-process . #<process futhark>) (is-restarting) (current-command . #0) (suggested-imported) (sent-stdin) (evaluating) (session (name . "futhark") (ignored-files "/home/rasmus/uni/flat/futhark/.ghci" "/home/rasmus/uni/flat/futhark") (interactive-buffer . #<buffer *futhark*>) (current-dir . "/home/rasmus/uni/flat/futhark/") (target . "") (cabal-checksum . "7e75d6e37133be0705f160ed78fc3dd7") (cabal-dir . "/home/rasmus/uni/flat/futhark/") (process (name . "futhark") (current-response-cursor . 0) (current-response . "") (command-queue) (inferior-process . #<process futhark>) (is-restarting) (current-command . #0) (suggested-imported) (sent-stdin) (evaluating) #3)))) #[(state) "\301�@\302\303�A\"\203��\304\305�A\"\202��\304\306�A\"\"\207" [state haskell-process-send-string string-match "^[A-Za-z_]" format ":info %s" ":info (%s)"] 5] nil #[(state response) "\301\302�\"\206��\301\303�\"?\205��\304�!\207" [response string-match "^Top level" "^<interactive>" haskell-mode-message-line] 3]])
  haskell-process-trigger-queue(((name . "futhark") (current-response-cursor . 0) (current-response . "") (command-queue) (inferior-process . #<process futhark>) (is-restarting) (current-command . [cl-struct-haskell-command (#0) #[(state) "\301�@\302\303�A\"\203��\304\305�A\"\202��\304\306�A\"\"\207" [state haskell-process-send-string string-match "^[A-Za-z_]" format ":info %s" ":info (%s)"] 5] nil #[(state response) "\301\302�\"\206��\301\303�\"?\205��\304�!\207" [response string-match "^Top level" "^<interactive>" haskell-mode-message-line] 3]]) (suggested-imported) (sent-stdin) (evaluating) (session (name . "futhark") (ignored-files "/home/rasmus/uni/flat/futhark/.ghci" "/home/rasmus/uni/flat/futhark") (interactive-buffer . #<buffer *futhark*>) (current-dir . "/home/rasmus/uni/flat/futhark/") (target . "") (cabal-checksum . "7e75d6e37133be0705f160ed78fc3dd7") (cabal-dir . "/home/rasmus/uni/flat/futhark/") (process (name . "futhark") (current-response-cursor . 0) (current-response . "") (command-queue) (inferior-process . #<process futhark>) (is-restarting) (current-command . [cl-struct-haskell-command (#0) #[(state) "\301�@\302\303�A\"\203��\304\305�A\"\202��\304\306�A\"\"\207" [state haskell-process-send-string string-match "^[A-Za-z_]" format ":info %s" ":info (%s)"] 5] nil #[(state response) "\301\302�\"\206��\301\303�\"?\205��\304�!\207" [response string-match "^Top level" "^<interactive>" haskell-mode-message-line] 3]]) (suggested-imported) (sent-stdin) (evaluating) #1))))
  haskell-process-queue-command(((name . "futhark") (current-response-cursor . 0) (current-response . "") (command-queue) (inferior-process . #<process futhark>) (is-restarting) (current-command . [cl-struct-haskell-command (#0) #[(state) "\301�@\302\303�A\"\203��\304\305�A\"\202��\304\306�A\"\"\207" [state haskell-process-send-string string-match "^[A-Za-z_]" format ":info %s" ":info (%s)"] 5] nil #[(state response) "\301\302�\"\206��\301\303�\"?\205��\304�!\207" [response string-match "^Top level" "^<interactive>" haskell-mode-message-line] 3]]) (suggested-imported) (sent-stdin) (evaluating) (session (name . "futhark") (ignored-files "/home/rasmus/uni/flat/futhark/.ghci" "/home/rasmus/uni/flat/futhark") (interactive-buffer . #<buffer *futhark*>) (current-dir . "/home/rasmus/uni/flat/futhark/") (target . "") (cabal-checksum . "7e75d6e37133be0705f160ed78fc3dd7") (cabal-dir . "/home/rasmus/uni/flat/futhark/") (process (name . "futhark") (current-response-cursor . 0) (current-response . "") (command-queue) (inferior-process . #<process futhark>) (is-restarting) (current-command . [cl-struct-haskell-command (#0) #[(state) "\301�@\302\303�A\"\203��\304\305�A\"\202��\304\306�A\"\"\207" [state haskell-process-send-string string-match "^[A-Za-z_]" format ":info %s" ":info (%s)"] 5] nil #[(state response) "\301\302�\"\206��\301\303�\"?\205��\304�!\207" [response string-match "^Top level" "^<interactive>" haskell-mode-message-line] 3]]) (suggested-imported) (sent-stdin) (evaluating) #1))) [cl-struct-haskell-command (((name . "futhark") (current-response-cursor . 0) (current-response . "") (command-queue) (inferior-process . #<process futhark>) (is-restarting) (current-command . #0) (suggested-imported) (sent-stdin) (evaluating) (session (name . "futhark") (ignored-files "/home/rasmus/uni/flat/futhark/.ghci" "/home/rasmus/uni/flat/futhark") (interactive-buffer . #<buffer *futhark*>) (current-dir . "/home/rasmus/uni/flat/futhark/") (target . "") (cabal-checksum . "7e75d6e37133be0705f160ed78fc3dd7") (cabal-dir . "/home/rasmus/uni/flat/futhark/") (process (name . "futhark") (current-response-cursor . 0) (current-response . "") (command-queue) (inferior-process . #<process futhark>) (is-restarting) (current-command . #0) (suggested-imported) (sent-stdin) (evaluating) #3)))) #[(state) "\301�@\302\303�A\"\203��\304\305�A\"\202��\304\306�A\"\"\207" [state haskell-process-send-string string-match "^[A-Za-z_]" format ":info %s" ":info (%s)"] 5] nil #[(state response) "\301\302�\"\206��\301\303�\"?\205��\304�!\207" [response string-match "^Top level" "^<interactive>" haskell-mode-message-line] 3]])
  haskell-process-do-try-info(nil)
  haskell-mode-contextual-space()
  ad-Orig-call-interactively(haskell-mode-contextual-space nil nil)
  (with-no-warnings (ad-Orig-call-interactively function record-flag keys))
  (setq ad-return-value (with-no-warnings (ad-Orig-call-interactively function record-flag keys)))
  (let ((ido-ubiquitous-next-override (ido-ubiquitous-get-command-override function))) (setq ad-return-value (with-no-warnings (ad-Orig-call-interactively function record-flag keys))))
  (ido-ubiquitous-with-override (ido-ubiquitous-get-command-override function) (setq ad-return-value (with-no-warnings (ad-Orig-call-interactively function record-flag keys))))
  (let (ad-return-value) (ido-ubiquitous-with-override (ido-ubiquitous-get-command-override function) (setq ad-return-value (with-no-warnings (ad-Orig-call-interactively function record-flag keys)))) ad-return-value)
  call-interactively(haskell-mode-contextual-space nil nil)

Specs

I'm using haskell-mode-20150403.1144 with emacs 24.3.1 onUbuntu 14.04.2 LTS, using ghc 7.8.4 and cabal 1.22.2.0

init.el

Here is the haskell part of my init.el (no ghc-mod currently)

(require 'haskell-mode)
(load "haskell-mode-autoloads")

(eval-after-load 'haskell-mode
  '(progn
     (setq haskell-notify-p t)
     (setq haskell-tags-on-save t)
     (setq haskell-indent-offset 2)))

(add-hook 'haskell-mode-hook 'rwl-haskell-hook)

(defun rwl-haskell-hook ()
  (turn-on-haskell-simple-indent)
  (define-key haskell-mode-map (kbd "<return>") 'haskell-simple-indent-newline-same-col)
  (define-key haskell-mode-map (kbd "C-<return>") 'haskell-simple-indent-newline-indent)

  ;; Taken from Troels / haskell-mode example
  ;; Contextually do clever things on the space key, in particular:
  ;;   1. Complete imports, letting you choose the module name.
  ;;   2. Show the type of the symbol after the space.
  (define-key haskell-mode-map (kbd "SPC") 'haskell-mode-contextual-space)

  ;; Jump to the imports. Keep tapping to jump between import
  ;; groups. C-u f8 to jump back again.
  (define-key haskell-mode-map [f8] 'haskell-navigate-imports)

  ;; Indent the below lines on columns after the current column.
  (define-key haskell-mode-map (kbd "C-S-<right>")
    (lambda ()
      (interactive)
      (haskell-move-nested 1)))
  ;; Same as above but backwards.
  (define-key haskell-mode-map (kbd "C-S-<left>")
    (lambda ()
      (interactive)
      (haskell-move-nested -1)))

  (interactive-haskell-mode t))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions