Re: idlwave and emacs "empty input ring" [message #54094 is a reply to message #54090] |
Wed, 23 May 2007 07:05   |
Rob[2]
Messages: 11 Registered: May 2007
|
Junior Member |
|
|
On May 22, 2:56 pm, JD Smith <jdsm...@as.arizona.edu> wrote:
> On Mon, 21 May 2007 15:39:00 -0700, Rob wrote:
>
>> If I close my emacs window w/o closing the IDL shell via "exit" then I
>> lose the comint history for that session. If I first exit the IDL
>> shell, then C-x C-s, when I restart emacs and C-c C-s a new IDL shell,
>> the history from the last session is available. Is there anyway to
>> have the IDL history autosave in case of a crash?
>
> Hmmm, if you can't remember to quit directly (I use C-d), you might add
> this to your idlwave-shell-mode-hook:
>
> (add-hook 'kill-emacs-hook
> (lambda ()
> (let ((buf (idlwave-shell-buffer)))
> (when (get-buffer buf)
> (set-buffer buf)
> (if (and idlwave-shell-save-command-history
> (stringp idlwave-shell-command-history-file))
> (condition-case nil
> (comint-write-input-ring)
> (error nil)))))))
>
> JD
That certainly helps in the case that I forget to C-d in the IDL
session. There are two other situations that I regularly experience
that you can perhaps help with.
1) Until I fixed a video card driver issue, iTool was crashing my
xserver which caused a loss to changes in the IDL comint history. I
suppose this could happen again.
2) I often leave an emacs/IDL open on my work computer. When I get
home, I may do a bit more work by running emacs, etc across X; also a
situation where I don't have access to the last comint history
changes. This is not a big deal, just a "nice to have".
For situation 2), is it possible to issue a HUP-like signal from a
remote shell to kill the emacs running on my work computer in a way
which invokes your save comint code above?
Thanks!
R
|
|
|