home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!apple!cambridge.apple.com!cornell@freya.cs.umass.edu
- From: cornell@freya.cs.umass.edu
- Newsgroups: comp.lang.lisp.mcl
- Subject: Opening files from the finder after mclv2.0's started
- Message-ID: <9208152104.AA05234@giane.cs.umass.edu>
- Date: 15 Aug 92 21:04:54 GMT
- Sender: info-mcl-request@cambridge.apple.com
- Lines: 48
- Approved: comp.lang.lisp.mcl@Cambridge.Apple.C0M
- Original-To: info-mcl@cambridge.apple.com
-
- I'm interested in doing this and I don't remember if someone else's
- posted a solution (I remember there was a recent request about it but
- I spaced it). After a little exploring I determined
- ccl::open-application-document is called when I open files from the
- Finder that have ccl2 as their creator. Folling is a file that opens
- one of my object files if the arg passed to
- ccl::open-application-document is appropriate.
-
- Issues:
- - Is is the (or an) Apple/MCL-approved solution?
- - What is the optional mystery arg?
- - Is the application instance every different from *application* and
- are there ever subclasses of it? (It seems defining methods on the
- application class is somewhat useless; in fact the only method mcl
- defines is on T, not APPLICATION.)
-
-
- ;;;
- ;;; finder-open-object-file.lisp
- ;;;
-
- #|
- ================================================================
- Purpose ========================================================
- ================================================================
- Defines an ccl::open-application-document :after method that opens IKit
- files.
-
- |#
-
-
- (defmethod ccl::open-application-document :after ((application t)
- (pathname pathname)
- &optional optional-mystery-arg)
- "An after method that calls open-object-file on pathname if it's an object file."
- (declare (optimize speed)
- (ignore optional-mystery-arg))
- ;;
- (let* ((kw-mac-file-type (mac-file-type pathname))
- (f-wood-file (eq kw-mac-file-type :|WOOD|))
- (f-object-file nil))
- ;; Set f-object-file.
- (when f-wood-file
- (with-open-pheap (pheap pathname)
- (setf f-object-file (ps::f-ikit-pheap pheap))))
- ;;
- (when f-object-file
- (ps::open-object-file pathname))))
-