[Openmcl-cvs-notifications] r7502 - in /trunk/ccl/cocoa-ide: cocoa-editor.lisp cocoa-listener.lisp hemlock/src/bindings.lisp hemlock/src/filecoms.lisp ide-contents/Resources/English.lproj/MainMenu.nib/info.nib ide-contents/Resources/English.lproj/MainMenu.nib/keyedobjects.nib

rme at clozure.com rme at clozure.com
Tue Oct 23 15:28:09 MDT 2007


Author: rme
Date: Tue Oct 23 17:28:08 2007
New Revision: 7502

Log:
Resolve ticket:111 (shouldn't be able to plain save in listener)

hemlock/src/bindings.lisp: In Listener mode, rebind c-x c-s to "Illegal"
and bind c-x c-w to "Save To File".

hemlock/src/filecoms.lisp: New command "Save To File".

Added Save To... item to File menu.

cocoa-listener.lisp: Arrange for Save and Save As... menu items to
be disabled when a listener window is main.

cocoa-editor.lisp: Add method hi::save-hemlock-document-to


Modified:
    trunk/ccl/cocoa-ide/cocoa-editor.lisp
    trunk/ccl/cocoa-ide/cocoa-listener.lisp
    trunk/ccl/cocoa-ide/hemlock/src/bindings.lisp
    trunk/ccl/cocoa-ide/hemlock/src/filecoms.lisp
    trunk/ccl/cocoa-ide/ide-contents/Resources/English.lproj/MainMenu.nib/i=
nfo.nib
    trunk/ccl/cocoa-ide/ide-contents/Resources/English.lproj/MainMenu.nib/k=
eyedobjects.nib

Modified: trunk/ccl/cocoa-ide/cocoa-editor.lisp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/ccl/cocoa-ide/cocoa-editor.lisp (original)
+++ trunk/ccl/cocoa-ide/cocoa-editor.lisp Tue Oct 23 17:28:08 2007
@@ -2616,6 +2616,10 @@
   (#/performSelectorOnMainThread:withObject:waitUntilDone:
    self (@selector #/saveDocumentAs:) +null-ptr+ t))
 =

+(defmethod hi::save-hemlock-document-to ((self hemlock-editor-document))
+  (#/performSelectorOnMainThread:withObject:waitUntilDone:
+   self (@selector #/saveDocumentTo:) +null-ptr+ t))
+
 (defun initialize-user-interface ()
   (#/sharedDocumentController hemlock-document-controller)
   (#/sharedPanel lisp-preferences-panel)

Modified: trunk/ccl/cocoa-ide/cocoa-listener.lisp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/ccl/cocoa-ide/cocoa-listener.lisp (original)
+++ trunk/ccl/cocoa-ide/cocoa-listener.lisp Tue Oct 23 17:28:08 2007
@@ -447,7 +447,9 @@
     (if (typep process 'cocoa-listener-process)
       (let* ((action (#/action item)))
         (cond
-          ((eql action (@selector #/revertDocumentToSaved:))
+          ((or (eql action (@selector #/revertDocumentToSaved:))
+	       (eql action (@selector #/saveDocument:))
+	       (eql action (@selector #/saveDocumentAs:)))
            (values t nil))
           ((eql action (@selector #/interrupt:)) (values t t))
           ((eql action (@selector #/continue:))

Modified: trunk/ccl/cocoa-ide/hemlock/src/bindings.lisp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/ccl/cocoa-ide/hemlock/src/bindings.lisp (original)
+++ trunk/ccl/cocoa-ide/hemlock/src/bindings.lisp Tue Oct 23 17:28:08 2007
@@ -326,6 +326,12 @@
 (bind-key "POP Or Delete Forward" #k"control-d" :mode "Listener")
 (bind-key "Reenter Interactive Input" #k"control-return" :mode "Listener")
 =

+;;; Make the user use C-x C-w to save the file, and take care
+;;; not to associate the Listener document with any particular
+;;; file or type.
+(bind-key "Illegal" #k"control-x control-s" :mode "Listener")
+(bind-key "Save To File" #k"control-x control-w" :mode "Listener")
+
 (bind-key "Editor Evaluate Expression" #k"control-meta-escape")
 (bind-key "Editor Evaluate Expression" #k"meta-escape"  :mode "Editor")
 (bind-key "Editor Evaluate Defun" #k"control-x control-e" :mode "Editor")

Modified: trunk/ccl/cocoa-ide/hemlock/src/filecoms.lisp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/ccl/cocoa-ide/hemlock/src/filecoms.lisp (original)
+++ trunk/ccl/cocoa-ide/hemlock/src/filecoms.lisp Tue Oct 23 17:28:08 2007
@@ -613,6 +613,16 @@
     (when document
       (hi::save-hemlock-document-as document))))
 =

+(defcommand "Save To File" (p &optional (buffer (current-buffer)))
+  "Writes the contents of Buffer, which defaults to the current buffer to
+  the file named by Pathname.  The prefix argument is ignored."
+  "Prompts for a file to write the contents of the current Buffer to.
+  The prefix argument is ignored."
+  (declare (ignore p))
+  (let* ((document (hi::buffer-document buffer)))
+    (when document
+      (hi::save-hemlock-document-to document))))
+
 (defcommand "Save File" (p &optional (buffer (current-buffer)))
   "Writes the contents of the current buffer to the associated file.  If t=
here
   is no associated file, one is prompted for."

Modified: trunk/ccl/cocoa-ide/ide-contents/Resources/English.lproj/MainMenu=
.nib/info.nib
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/ccl/cocoa-ide/ide-contents/Resources/English.lproj/MainMenu.nib/i=
nfo.nib (original)
+++ trunk/ccl/cocoa-ide/ide-contents/Resources/English.lproj/MainMenu.nib/i=
nfo.nib Tue Oct 23 17:28:08 2007
@@ -8,7 +8,7 @@
 	<integer>5</integer>
 	<key>IBOpenObjects</key>
 	<array>
-		<integer>361</integer>
+		<integer>334</integer>
 	</array>
 	<key>IBSystem Version</key>
 	<string>9A559</string>

Modified: trunk/ccl/cocoa-ide/ide-contents/Resources/English.lproj/MainMenu=
.nib/keyedobjects.nib
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
Binary files - no diff available.




More information about the Openmcl-cvs-notifications mailing list