I&#39;m using haskell-mode-2.8.0 and emacs 22.2.1 on Ubuntu 9.10<div><br></div><div>The following elisp code works for me to change the focus to the GHCi buffer (window) after the C-c C-l command in Haskell Mode.  Try this in your .emacs file.</div>
<div><br></div><div><br></div><div><div>(defadvice inferior-haskell-load-file (after change-focus-after-load)</div><div>  &quot;Change focus to GHCi window after C-c C-l command&quot;</div><div>  (other-window 1))</div><div>
<br></div><div>(ad-activate &#39;inferior-haskell-load-file)</div><div><br></div><div>I have this after the haskell mode configuration section of my .emacs file.</div><div><br></div><div>Remeber to go to the Emacs-lisp menu and &#39;Byte-compile and Load&#39; after adding the above code to your .emacs file.</div>
<div><br></div><div>  To understand what the elisp code is doing you can go to the help menu in emacs, then drill down via &#39;Search Documentation &#39; , then &#39;Find any object by name&#39;.  Which will put you in the mini-buffer.  Type in either defadvice or ad-activate to see the documentation for these functions. If you are a little rusty on elisp this documentation may be a little hard to understand.</div>
<div><br></div><div>  Basically this is what&#39;s happening.  The function that is bound to the C-c C-l command is inferior-haskell-load-file.  Which is an elisp function name and part of the elisp haskell mode code.  The defadvice is kind of overloading this function.   We are telling emacs that &#39;after&#39; executing the &#39;inferior-haskell-load-file&#39; function,  execute our new function who&#39;s name is &#39;change-focus-after-load&#39;.  The body of our function is just one expression (other-window 1).</div>
<div>  This is the kind of stuff that makes it easy to modify (hack) the functionality of emacs to do what you want.</div><div><br></div><div>I hope this helps and enjoy hacking in Haskell</div><div>Steven</div><br><div><br>
</div><br>
</div>