Vladimir Vigdorovich wrote:
> Hello all,
> I am trying to add a menu item to allow me to save current state and
> coordinates in one step. The purpose is to prevent the user (me) from
> losing his/her place in the pdb/mtz files and quickly (without dialogs)
> saving current changes in case of a crash. Anyone with scheme experience:
> please help (for I have no scheme experience)!
>
> Below is what I have so far. What I would like to change is to have the
> script apply this to all loaded molecules (not just molecule 0). Also, the
> filenames would have to be the same as filenames of the original files.
As Jürgen says, Coot will back up your modifications for you (into
coot-backup). As it stands, Coot doesn't backup the very last change.
It also will not save the state file.
I disapprove of overwriting the input files, but here is what you asked
for (I bind it to the Q key, which is quicker than using a menu item).
Paul.
And p.s. if you have a recipe to crash Coot, I'd be very interested to
know how you do it!
---
(define (quick-save)
(save-state)
(map (lambda (imol) (write-pdb-file (molecule-name imol)))
(model-molecule-list)))
;; now map quick-save on to the Q key:
(define graphics-general-key-press-hook
(lambda (key)
(cond
((= key 113) ; Q
(quick-save)))))
|