Dear Coot users out there,

Hello.

I am a new coot user and have tried many methods to save changes while rebuilding, short of "save coordinates". The manual says that coot saves changes automatically after every change and writes a new .pdb.gz file in coot-backup.

Does it? If it does it is wrong. Coot saves the coordinates *before* making a change, thus Undo restores from that most recently saved file.

I notice a new file appearing in coot-backup after every change alright but it does not have the changes I made.

Indeed. It will save previous changes.

I could write out a .pdb every time I make a change but isn't there anything akin to File->save in O (writing out binary.o as the default file) that coot has?

Yes, this kind of thing is fairly straightforward (if I have understood your question correctly). See attached, function is bound to the X key.

Or, to make the coot-backup files actually reflect the change I've made?

They *do* reflect your changes. Just not the most recent one. You can't change that (not easily).

I discovered that "save state" only saves the position in the molecule I am walking and not any changes made, much to my horror.

Your horror is that you expected Coot's "Save State" to save something other than Coot's state?

Anyway, enjoy your new key binding. There is a Coot list if you want to follow up.

Paul.




(define save-it-molecule
  (let ((ml (model-molecule-list)))
    (if (null? ml)
	#f
	(car ml))))

(define make-counter
  (lambda ()

    (let ((next 0))
      (lambda ()
        (let ((v next))
          (set! next (+ 1 next))
          v)))))

(define count (make-counter))

(define (save-it)
  (if save-it-molecule
      (let ((file-name (string-append (file-name-sans-extension
				       (molecule-name save-it-molecule))
				      "-"
				      (number->string (count))
				      ".pdb")))
	(format #t "saving molecule ~s to ~s~%"
		save-it-molecule file-name)
	(write-pdb-file save-it-molecule file-name))))


(define graphics-general-key-press-hook
  (lambda (key)

    (cond 
     ((= key 120) ; X key
      (save-it)))))

Reply via email to