Skip to content

Remove haskell-mode-contextual-space #1191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 6, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions doc/haskell-mode.texi
Original file line number Diff line number Diff line change
Expand Up @@ -297,18 +297,6 @@ To just align imports, jump to an import section and run

@code{M-x haskell-align-imports}

@subsection Entering imports

If you have Haskell Interactive Mode enabled and a session open,
you can write

@code{import}

And then hit @kbd{SPC} (running @code{M-x haskell-mode-contextual-space})
which will prompt a list of all modules, either installed modules or
local project directory files. Then it'll insert it and then format that
module section.

@subsection stylish-haskell

As an alternative to the elisp functions described above, haskell-mode
Expand Down Expand Up @@ -776,7 +764,7 @@ program to start and its arguments:
If it's @code{ghci}, @code{haskell-process-path-ghci} and
@code{haskell-process-args-ghci} will be used.
@item
If it's @code{cabal-repl}, @code{haskell-process-path-ghci} and
If it's @code{cabal-repl}, @code{haskell-process-path-ghci} and
@code{haskell-process-args-ghci}.
@item
If it's @code{stack-ghci}, @code{haskell-process-path-stack} and
Expand Down
3 changes: 1 addition & 2 deletions haskell-indentation.el
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ set and deleted as if they were real tabs."
(defvar haskell-literate) ; defined in haskell-mode.el

(defun haskell-indentation-bird-p ()
"Return t if this is a literate Haskell buffer in bird style,
NIL otherwise."
"Return t if this is a literate Haskell buffer in bird style, NIL otherwise."
(eq haskell-literate 'bird))

;;----------------------------------------------------------------------------
Expand Down
7 changes: 0 additions & 7 deletions haskell-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -655,13 +655,6 @@ May return a qualified name."
(let ((fill-prefix (or fill-prefix (if (eq haskell-literate 'bird) ">"))))
(delete-indentation arg)))

;; Various mode variables.
(defcustom haskell-mode-contextual-import-completion
t
"Enable import completion on haskell-mode-contextual-space."
:type 'boolean
:group 'haskell-interactive)

(defvar eldoc-print-current-symbol-info-function)

(defvar haskell-mode-interactive-prompt-state nil
Expand Down
27 changes: 0 additions & 27 deletions haskell.el
Original file line number Diff line number Diff line change
Expand Up @@ -333,33 +333,6 @@ If `haskell-process-load-or-reload-prompt' is nil, accept `default'."
(haskell-interactive-mode-error-backward)
(haskell-interactive-jump-to-error-line)))))

;;;###autoload
(defun haskell-mode-contextual-space ()
"Contextually do clever stuff when hitting space."
(interactive)
(if (or (not (bound-and-true-p interactive-haskell-mode))
(not (haskell-session-maybe)))
(self-insert-command 1)
(cond ((and haskell-mode-contextual-import-completion
(save-excursion (forward-word -1)
(looking-at "^import$")))
(insert " ")
(let ((module (haskell-complete-module-read
"Module: "
(haskell-session-all-modules (haskell-session)))))
(let ((mapping (assoc module haskell-import-mapping)))
(if mapping
(progn (delete-region (line-beginning-position)
(line-end-position))
(insert (cdr mapping)))
(insert module)))
(haskell-mode-format-imports)))
(t
(let ((ident (save-excursion (forward-char -1) (haskell-ident-at-point))))
(insert " ")
(when ident
(haskell-process-do-try-info ident)))))))

(defvar xref-prompt-for-identifier nil)

;;;###autoload
Expand Down