Update of /project/mcclim/cvsroot/mcclim/ESA In directory clnet:/tmp/cvs-serv4848/ESA
Modified Files: esa-io.lisp Log Message: When saving a buffer with no associated pathname, act as Write Buffer.
This needs some more thought, the save/write buffer dichotomy is not awesome.
--- /project/mcclim/cvsroot/mcclim/ESA/esa-io.lisp 2008/01/13 22:22:06 1.6 +++ /project/mcclim/cvsroot/mcclim/ESA/esa-io.lisp 2008/01/15 08:05:09 1.7 @@ -269,18 +269,22 @@ (setf (needs-saving buffer) nil)))
(define-command (com-save-buffer :name t :command-table esa-io-table) () - "Write the contents of the buffer to a file. + "Write the contents of the buffer to a file. If there is filename associated with the buffer, write to that file, replacing its contents. If not, prompt for a filename." (let ((buffer (current-buffer))) - (if (or (null (filepath buffer)) - (needs-saving buffer)) - (handler-case (save-buffer buffer) - (buffer-writing-error (e) - (with-minibuffer-stream (minibuffer) - (let ((*print-escape* nil)) - (print-object e minibuffer))))) - (display-message "No changes need to be saved from ~a" (name buffer))))) + (if (null (filepath buffer)) + (com-write-buffer (accept 'pathname :prompt "Write Buffer to File: " + :prompt-mode :raw + :default (directory-of-current-buffer) :insert-default t + :default-type 'pathname)) + (if (needs-saving buffer) + (handler-case (save-buffer buffer) + (buffer-writing-error (e) + (with-minibuffer-stream (minibuffer) + (let ((*print-escape* nil)) + (print-object e minibuffer))))) + (display-message "No changes need to be saved from ~a" (name buffer))))))
(set-key 'com-save-buffer 'esa-io-table '((#\x :control) (#\s :control)))