Changeset 13232


Ignore:
Timestamp:
Nov 24, 2009, 11:16:47 PM (10 years ago)
Author:
greg
Message:

Added URL handling for ccl: scheme, which means that 'ccl:*current-process*' and 'ccl:lib;defstruct-lds.lisp' will do the right thing if treated as a link. (Try it in Colloquy)

Location:
trunk/source/cocoa-ide
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/cocoa-ide/Info.plist-proto

    r8445 r13232  
    108108                </dict>
    109109        </array>
     110        <key>NSAppleScriptEnabled</key>
     111        <string>YES</string>
     112        <key>CFBundleURLTypes</key>
     113        <array>
     114                <dict>
     115                        <key>CFBundleURLSchemes</key>
     116                        <array>
     117                                <string>ccl</string>
     118                        </array>
     119                </dict>
     120        </array>
    110121</dict>
    111122</plist>
  • trunk/source/cocoa-ide/cocoa-editor.lisp

    r13194 r13232  
    32843284                        (hi::handle-hemlock-event view thunk)))))
    32853285
    3286 
    32873286(defun hemlock-ext:open-sequence-dialog (&key title sequence action (printer #'prin1))
    32883287  (make-instance 'sequence-window-controller
     
    33603359(setq ccl::*resident-editor-hook* 'cocoa-edit)
    33613360
     3361(defclass url-handler-command (ns:ns-script-command)
     3362  ()
     3363  (:documentation
     3364   "Handles AppleEvents that send us URLs to open. Both logical pathnames
     3365    ('ccl:lib;foo.lisp') and symbols (ccl::*current-process*) can be parsed as a URL
     3366    with a scheme of 'ccl'. So, we accept those as URLs, and handle them appropriately.")
     3367  (:metaclass ns:+ns-script-command))
     3368
     3369(objc:defmethod #/performDefaultImplementation ((self url-handler-command))
     3370  (let* ((string (ccl::lisp-string-from-nsstring (#/directParameter self)))
     3371         (symbol (let ((*read-eval* nil))
     3372                   (handler-case (read-from-string string)
     3373                     (error () nil)))))
     3374    (if symbol
     3375      (hemlock::edit-definition symbol)
     3376      (execute-in-gui #'(lambda ()
     3377                          (find-or-make-hemlock-view
     3378                           (if (probe-file string)
     3379                             string
     3380                             (let ((lpath (merge-pathnames string *.lisp-pathname*)))
     3381                               (when (probe-file lpath)
     3382                                 lpath))))))))
     3383  +null-ptr+)
Note: See TracChangeset for help on using the changeset viewer.