Re: [Haskell-cafe] Automatically move cursor focus in split window in haskell-mode in emacs on load (C-c C-l) command?

2011-01-30 Thread Gwern Branwen
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)

-- 
gwern
http://www.gwern.net

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Automatically move cursor focus in split window in haskell-mode in emacs on load (C-c C-l) command?

2011-01-30 Thread JETkoten

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)


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Automatically move cursor focus in split window in haskell-mode in emacs on load (C-c C-l) command?

2011-01-30 Thread Brandon S Allbery KF8NH
-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]  allb...@kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allb...@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-

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Automatically move cursor focus in split window in haskell-mode in emacs on load (C-c C-l) command?

2011-02-01 Thread JETkoten

On 2/1/11 12:07 AM, Steven Collins wrote:
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.



(defadvice inferior-haskell-load-file (after change-focus-after-load)
  "Change focus to GHCi window after C-c C-l command"
  (other-window 1))

(ad-activate 'inferior-haskell-load-file)

This worked for me! Thank you so very much for taking the time to send 
this and include the explanation of how it works. Not only did I get 
this working with my emacs, but I also got Kazu Yamamoto's ghc-mod 0.5.3 
working, so now I have Haskell Flymake in my haskell-mode too. Great!


Thanks again.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Automatically move cursor focus in split window in haskell-mode in emacs on load (C-c C-l) command?

2011-02-01 Thread JETkoten



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.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe