[Openmcl-cvs-notifications] r14248 - in /trunk/source/cocoa-ide: cocoa-editor.lisp ide-contents/Resources/English.lproj/MainMenu.nib/classes.nib 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
Fri Sep 10 16:49:47 CDT 2010
Author: rme
Date: Fri Sep 10 16:49:47 2010
New Revision: 14248
Log:
Add Open Selection menu item to File Menu, with shortcut of cmd-D.
Find Previous is now shift-cmd-G (which is standard).
Add a Source Of contextual menu item. This seems of dubious utility, but
maybe someone out there doesn't know about M-. yet.
Update MainMenu.nib nib file format.
Removed:
trunk/source/cocoa-ide/ide-contents/Resources/English.lproj/MainMenu.ni=
b/classes.nib
trunk/source/cocoa-ide/ide-contents/Resources/English.lproj/MainMenu.ni=
b/info.nib
Modified:
trunk/source/cocoa-ide/cocoa-editor.lisp
trunk/source/cocoa-ide/ide-contents/Resources/English.lproj/MainMenu.ni=
b/keyedobjects.nib
Modified: trunk/source/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/source/cocoa-ide/cocoa-editor.lisp (original)
+++ trunk/source/cocoa-ide/cocoa-editor.lisp Fri Sep 10 16:49:47 2010
@@ -1799,15 +1799,22 @@
(not (directory-pathname-p pathname)))
pathname)))
=
-;;; If we get here, we've already checked that the selection represents
-;;; a valid pathname.
+(defun find-symbol-in-packages (string pkgs)
+ (setq string (string-upcase string))
+ (let (sym)
+ (dolist (p pkgs)
+ (when (setq sym (find-symbol string p))
+ (return)))
+ sym))
+
(objc:defmethod (#/openSelection: :void) ((self hemlock-text-view) sender)
(declare (ignore sender))
(let* ((text (#/string self))
(selection (#/substringWithRange: text (#/selectedRange self)))
(pathname (pathname-for-namestring-fragment
(lisp-string-from-nsstring selection))))
- (ed pathname)))
+ (when (pathnamep pathname)
+ (ed pathname))))
=
;;; If we get here, we've already checked that the selection represents
;;; a valid symbol name.
@@ -1815,8 +1822,20 @@
(declare (ignore sender))
(let* ((text (#/string self))
(selection (#/substringWithRange: text (#/selectedRange self)))
- (symbol-name (string-upcase (lisp-string-from-nsstring selection)=
)))
- (inspect (find-symbol symbol-name))))
+ (symbol-name (string-upcase (lisp-string-from-nsstring selection)=
))
+ (buffer (hemlock-buffer self))
+ (package-name (hi::variable-value 'hemlock::current-package :buff=
er buffer)))
+ (inspect (find-symbol-in-packages symbol-name =
+ (cons package-name
+ (package-use-list package-name=
))))))
+
+(objc:defmethod (#/sourceForSelection: :void) ((self hemlock-text-view) se=
nder)
+ (declare (ignore sender))
+ (let* ((text (#/string self))
+ (selection (#/substringWithRange: text (#/selectedRange self)))
+ (sym (find-symbol-in-packages (lisp-string-from-nsstring selectio=
n)
+ (list-all-packages))))
+ (ed sym)))
=
;;; If we don't override this, NSTextView will start adding Google/
;;; Spotlight search options and dictionary lookup when a selection
@@ -1828,11 +1847,23 @@
(s (lisp-string-from-nsstring selection))
(menu (if (> (length s) 0)
(#/copy (#/menu self))
- (#/retain (#/menu self)))))
- (when (find-symbol (string-upcase s))
+ (#/retain (#/menu self))))
+ (buffer (hemlock-buffer self))
+ (package-name (hi::variable-value 'hemlock::current-package :buff=
er buffer)))
+ (when (find-symbol-in-packages (string-upcase s)
+ (cons package-name
+ (package-use-list package-name)))
(let* ((title (#/stringByAppendingString: #@"Inspect " selection))
(item (make-instance 'ns:ns-menu-item :with-title title
:action (@selector #/inspectSelection:)
+ :key-equivalent #@"")))
+ (#/setTarget: item self)
+ (#/insertItem:atIndex: menu item 0)
+ (#/release item)))
+ (when (find-symbol-in-packages (string-upcase s) (list-all-packages))
+ (let* ((title (#/stringByAppendingString: #@"Source of " selection))
+ (item (make-instance 'ns:ns-menu-item :with-title title
+ :action (@selector #/sourceForSelection:)
:key-equivalent #@"")))
(#/setTarget: item self)
(#/insertItem:atIndex: menu item 0)
@@ -2601,6 +2632,10 @@
(let* ((buffer (hemlock-buffer self))
(pathname (hi::buffer-pathname buffer)))
(not (null pathname))))
+ ((eql action (@selector #/openSelection:))
+ (let* ((text (#/string self))
+ (selection (#/substringWithRange: text (#/selectedRange =
self))))
+ (pathname-for-namestring-fragment (lisp-string-from-nsstring =
selection))))
(t (call-next-method item)))))
=
(defmethod user-input-style ((doc hemlock-editor-document))
Removed: trunk/source/cocoa-ide/ide-contents/Resources/English.lproj/MainMe=
nu.nib/classes.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/source/cocoa-ide/ide-contents/Resources/English.lproj/MainMenu.ni=
b/classes.nib (original)
+++ trunk/source/cocoa-ide/ide-contents/Resources/English.lproj/MainMenu.ni=
b/classes.nib (removed)
@@ -1,83 +1,0 @@
-<?xml version=3D"1.0" encoding=3D"UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com=
/DTDs/PropertyList-1.0.dtd">
-<plist version=3D"1.0">
-<dict>
- <key>IBClasses</key>
- <array>
- <dict>
- <key>ACTIONS</key>
- <dict>
- <key>toggleConsole</key>
- <string>id</string>
- <key>toggleTypeout</key>
- <string>id</string>
- </dict>
- <key>CLASS</key>
- <string>NSApplication</string>
- <key>LANGUAGE</key>
- <string>ObjC</string>
- <key>SUPERCLASS</key>
- <string>NSResponder</string>
- </dict>
- <dict>
- <key>ACTIONS</key>
- <dict>
- <key>backtrace</key>
- <string>id</string>
- <key>compileAndLoadBuffer</key>
- <string>id</string>
- <key>compileBuffer</key>
- <string>id</string>
- <key>compileFile</key>
- <string>id</string>
- <key>continue</key>
- <string>id</string>
- <key>evalAll</key>
- <string>id</string>
- <key>evalSelection</key>
- <string>id</string>
- <key>exitBreak</key>
- <string>id</string>
- <key>hyperSpecLookUp</key>
- <string>id</string>
- <key>inspect</key>
- <string>id</string>
- <key>interrupt</key>
- <string>id</string>
- <key>loadBuffer</key>
- <string>id</string>
- <key>loadFile</key>
- <string>id</string>
- <key>newListener</key>
- <string>id</string>
- <key>restarts</key>
- <string>id</string>
- <key>showAproposWindow</key>
- <string>id</string>
- <key>showListener</key>
- <string>id</string>
- <key>showNewInspector</key>
- <string>id</string>
- <key>showPreferences</key>
- <string>id</string>
- <key>showProcessesWindow</key>
- <string>id</string>
- <key>showSearchFiles</key>
- <string>id</string>
- <key>showXaproposWindow</key>
- <string>id</string>
- <key>updateCCL</key>
- <string>id</string>
- </dict>
- <key>CLASS</key>
- <string>FirstResponder</string>
- <key>LANGUAGE</key>
- <string>ObjC</string>
- <key>SUPERCLASS</key>
- <string>NSObject</string>
- </dict>
- </array>
- <key>IBVersion</key>
- <string>1</string>
-</dict>
-</plist>
Removed: trunk/source/cocoa-ide/ide-contents/Resources/English.lproj/MainMe=
nu.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/source/cocoa-ide/ide-contents/Resources/English.lproj/MainMenu.ni=
b/info.nib (original)
+++ trunk/source/cocoa-ide/ide-contents/Resources/English.lproj/MainMenu.ni=
b/info.nib (removed)
@@ -1,18 +1,0 @@
-<?xml version=3D"1.0" encoding=3D"UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com=
/DTDs/PropertyList-1.0.dtd">
-<plist version=3D"1.0">
-<dict>
- <key>IBFramework Version</key>
- <string>677</string>
- <key>IBOldestOS</key>
- <integer>5</integer>
- <key>IBOpenObjects</key>
- <array>
- <integer>29</integer>
- </array>
- <key>IBSystem Version</key>
- <string>9J61</string>
- <key>targetFramework</key>
- <string>IBCocoaFramework</string>
-</dict>
-</plist>
Modified: trunk/source/cocoa-ide/ide-contents/Resources/English.lproj/MainM=
enu.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