Automatically move cursor focus in split window in haskell-mode in emacs on load (C-c C-l) command?

With the community server down it looks like I can't join the haskell-mode mailing list, and also I thought someone might have already done this, so I've posted here. I'm new to Haskell and emacs... and don't know any elisp at all! I'm trying to set up my haskell-mode so that when I've finished inputting code in a buffer that's in haskell-mode, and I then do C-c C-l to split the screen and load the code into ghci in the lower buffer, the cursor focus will automatically jump down to the bottom half of the split screen and I can instantly begin to interact with ghci. The way it defaults to now is that the cursor stays in the topmost editing half of the split screen, and I inevitably begin typing and mess up my code and have to do some backspacing and then mouse over to the bottom half. :) I checked on #haskell and #emacs last night, and someone suggested either "doing it with elisp" or keyboard macros, but I'm not sure how to do the first, and I think the second is not what I'm looking for. I'd like for haskell-mode to otherwise remain the same, and to still use the same C-c C-l key sequence, but I'd just like it to always be set up to add the step in the load sequence of jumping the cursor focus down to the lower half of the split for me. Any ideas? (Thanks in advance.)

On Sun, Jan 30, 2011 at 11:30 AM, JETkoten
The way it defaults to now is that the cursor stays in the topmost editing half of the split screen, and I inevitably begin typing and mess up my code and have to do some backspacing and then mouse over to the bottom half.
:)
I checked on #haskell and #emacs last night, and someone suggested either "doing it with elisp" or keyboard macros, but I'm not sure how to do the first, and I think the second is not what I'm looking for.
I'd like for haskell-mode to otherwise remain the same, and to still use the same C-c C-l key sequence, but I'd just like it to always be set up to add the step in the load sequence of jumping the cursor focus down to the lower half of the split for me.
From my .emacs;
;Default behaviour is to always jump to the GHCi window. ;Jump back automatically unless errors. (defadvice haskell-ghci-load-file (after name) (other-window 1)) (ad-activate 'haskell-ghci-load-file t) -- gwern http://www.gwern.net

On 1/30/11 11:37 AM, Gwern Branwen wrote:
On Sun, Jan 30, 2011 at 11:30 AM, JETkoten
wrote: The way it defaults to now is that the cursor stays in the topmost editing half of the split screen, and I inevitably begin typing and mess up my code and have to do some backspacing and then mouse over to the bottom half.
:)
I checked on #haskell and #emacs last night, and someone suggested either "doing it with elisp" or keyboard macros, but I'm not sure how to do the first, and I think the second is not what I'm looking for.
I'd like for haskell-mode to otherwise remain the same, and to still use the same C-c C-l key sequence, but I'd just like it to always be set up to add the step in the load sequence of jumping the cursor focus down to the lower half of the split for me. From my .emacs;
;Default behaviour is to always jump to the GHCi window. ;Jump back automatically unless errors. (defadvice haskell-ghci-load-file (after name) (other-window 1)) (ad-activate 'haskell-ghci-load-file t)
Thanks! However, this doesn't do anything at all after adding it to my .emacs. Or else maybe it's a problem with the formatting? It looks like parts of the code got line wrapped in replying to my first email. I tried various combinations of moving the various lines around and nothing works. Is the indentation significant in elisp? Anyone know how to get this working? (Gwern, sorry for the double post, I forgot to press Reply All the first time and only mailed my response to you)

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 1/30/11 12:13 , JETkoten wrote:
;Default behaviour is to always jump to the GHCi window. ;Jump back automatically unless errors. (defadvice haskell-ghci-load-file (after name) (other-window 1)) (ad-activate 'haskell-ghci-load-file t)
I tried various combinations of moving the various lines around and nothing works. Is the indentation significant in elisp?
Aside from the comments, wich go to end of line but got broken in this case, no; all that matters is the parens. I suspect it may depend strongly on what version of emacs you're running though. - -- brandon s. allbery [linux,solaris,freebsd,perl] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk1GDB8ACgkQIn7hlCsL25XwUwCfTYktCZ2WuayLprACS79LS8gG td4AnR5WygspwmARIUUeNRm9E++cHOMa =1r0X -----END PGP SIGNATURE-----

On 1/30/11 8:10 PM, Brandon S Allbery KF8NH wrote:
Aside from the comments, which go to end of line but got broken in this case, no; all that matters is the parens. I suspect it may depend strongly on what version of emacs you're running though. Thanks for your comments. After reading them I had subscribed to the emacs mailing list for my platform/version, but it seems to be really low traffic.
Thank goodness this list came through for me.
participants (3)
-
Brandon S Allbery KF8NH
-
Gwern Branwen
-
JETkoten