[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: I for Interactive Programming? (was: widget_control and group_leader)



Vapuser wrote:
> 
>   For those willing to learn emacs and Carsten Dominik's marvelous
> idlwave_shell mode, you would have no more problems with saving the
> results of your 'tappling' at the keyboard. Just start up an instance
> of idlwave_shell in emacs and tapple to your hearts delight, then
> write the idlwave-shell buffer out to a file. Or, kill/yank
> (i.e. cut/paste) it to another buffer, edit it and write that out to a
> file.
> 
> This is almost the *only* way I develop code anymore, I try stuff
> out in emacs/idlwave-shell and then cut/paste it to the 'work in
> progress' file. (doesn't work for widgets programming, of course, but
> in this area it's the debugging capabilities, which are totally
> awesome *d00d* that recommend it)
> 
> No more need to remember to turn journalling on or to set
> variables to assure that you save enough of your work.
> 
>   It does have a steep learning curve, especially if you're not used to
> emacs or you're on a Windows/Mac system. If that's the case,
> journalling is probably the best bet. But if you're moderately used to
> emacs and on a unix system, emacs/idlwave-shell mode simply can't be
> beat (IMHO) and it's well worth the effort!
> 
> Kudo's to Carsten for his fine work!

Hear Hear!  I've got something even better (from Carsten, of course). 
I'm not sure if this has been put into IDLWAVE yet as a more palatable
form (I vote for it), but if you have version >4.7b (meaning when 4.8
comes out, if you're leary of alpha's) you can simply use in your
.emacs:

(add-hook 'idlwave-shell-mode-hook
  (lambda ()
    (set (make-local-variable 'comint-input-ring-file-name)
"~/.idlwhist")
    (comint-read-input-ring)))

(add-hook 'idlwave-shell-sentinel-hook 'comint-write-input-ring)

I.e. just set up a "comint input ring filename" to ~/.idlwhist (or
whatever you like), and ensures it is read in when the shell starts (in
the idlwave-shell-mode-hook), and written out after it exits (in the
idlwave-shell-sentinel-hook).

This way, you always get all of your input history (which is actually
maintained by comint, not IDL), between sessions, etc.  Now restarting
IDL is not nearly so painful.  The commands are still right there, at
your fingertips.

Never wonder where your command history went again.  And for the really
brave, try:

(setq comint-input-ring-size 1024)  

outside of your idlwave-shell-mode-hook (since comint runs before
idlwave-shell).  Now you'll have the silly command you tried 3 weeks
ago, somewhere in there.  By the way, try [C-c C-l] to see your entire
history in another buffer, with ability to scroll through it and click
on the command you're after (or cut and paste between many such
commands).  .idlwhist is a plain file, which you can search through
using grep or a pager or however you like, if you don't want to load
IDL.

Good luck,

JD