can't use "S" in normal mode with haskell-mode

Linus Arver linusarver at gmail.com
Tue Mar 19 18:13:22 CET 2013


On Mon, Mar 18, 2013 at 08:25:32PM +0100, Michael Markert wrote:
> On Mon, Mar 18 2013 (19:34), Linus Arver <linusarver at gmail.com> wrote: 
> 
> > Hello all,
> >
> > I use emacs-evil with haskell-mode. Whenever I enter the "S"
> > hotkey a new buffer (haskell-mode's "Help" file) is opened on a split
> > window and it gets stuck in <M> state. I can use the "S" hotkey fine
> > when haskell-mode is not active, though.
> >
> > Any pointers?
> 
> As emacs has no haskell-mode: Which are you using? This one[1] (or from
> marmalade)?

I am using https://github.com/haskell/haskell-mode.

> And more important what does
> 
>     C-h k S RET
> 
> in normal-state tell you?

Well, I only need to do

    C-h k S

because by the time I press 'S' in that key chord it already gives me a
new *Help* buffer in a new split window. Anyway, the *Help* buffer says:

    S runs the command evil-change-whole-line, which is an interactive compiled Lisp
    function in `evil-commands.el'.

    It is bound to S.

    (evil-change-whole-line BEG END &optional TYPE REGISTER YANK-HANDLER)

    Change whole line.

    [back]

I just noticed that the command 'S' does indeed work in the haskell-mode
buffer (it delete the whole line and goes into <I> Insert mode) --- the
only problem is that I get a new split window with a haskell-mode *Help*
buffer, which gets stuck in <M> state. Here is some of the leading
contents of this new buffer:

    haskell-mode-hook is a variable defined in `haskell-mode.el'.
    Its value is shown below.

      This variable is potentially risky when used as a file local variable.

    Documentation:

    Hook run after entering Haskell mode.

    --------------------------------------------------------------------------------

    CONFIGURING INDENTATION

      Using this you can configure the Haskell indentation mode. There
      are three major Haskell indentation modes:

      `haskell-indentation', Kristof Bastiaensen
        Intelligent semi-automatic indentation, mark two. How to enable:
    ...

So I guess haskell-mode-hook is responsible for this. I've looked at
haskell-mode.el and it appears that this function is responsible:

    (defun haskell-mode-suggest-indent-choice ()
      "Ran when the user tries to indent in the buffer but no indentation mode has been selected.
    Brings up the documentation for haskell-mode-hook."
      (describe-variable 'haskell-mode-hook))

Maybe evil-change-whole-line for "S" (and also "cc", as this triggers the
same behavior) has some indenting code in it, which ends up triggering
haskell-mode-suggest-indent-choice?

I have in my ~/.emacs the following:

    (load-library "haskell-site-file")
    (add-to-list 'auto-mode-alist '("\\.hs\\'" . haskell-mode))

Thanks,
-L



More information about the implementations-list mailing list