comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: idlwave and emacs "empty input ring"
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: idlwave and emacs "empty input ring" [message #54090] Wed, 23 May 2007 11:02 Go to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Wed, 23 May 2007 07:05:03 -0700, Rob wrote:

> 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?

How about the following instead:

(add-hook 'idlwave-shell-mode-hook
(lambda ()

;; Auto-save buffer contents and input history
(add-hook
'auto-save-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))))))
nil 'local)
(auto-save-mode t)
(add-hook 'idlwave-shell-sentinel-hook
(lambda ()
(delete-auto-save-file-if-necessary 'force)))))

This piggybacks on auto-save to write out the command history every time
an auto-save happens. It also auto-saves the contents of the *idl*
buffer (as some file name like #*idl*#28538NXc#), which might be useful if
you lost your session and wanted to see what was in it. If the process is
ended legitimately, this backup file is removed.

The only real issue here is if you have multiple Emacs + IDLWAVE Shell
sessions going at once, in which case they will step on each other's
toes writing to the same command history file (though that is more or
less true already). Let me know if this works well for you; I may
consider adding it as an option to a future version of IDLWAVE.

JD
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: redout of "name", "type" and "value" tags into a string
Next Topic: Re: 2D interpolation with sparse data

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:32:40 PDT 2025

Total time taken to generate the page: 0.00416 seconds