Lisp Knowledgebase
Title: Displaying Lisp files by double-clicking in Windows Explorer
ID: 16016
| Product: LispWorks for Windows Version: 4.3, 4.4 OS: All Windows platforms | |
| Description: Displaying Lisp files by double-clicking in Windows Explorer Suppose you wish to associate '.lisp' files with LispWorks so that opening the file in the Windows Explorer displays it in a LispWorks Editor buffer. Use LispWorks' -edit command line argument which starts an Editor with the next argument as the filename. A. First, make sure you have downloaded and installed the latest patch bundle from our website. B. If you're running LWW4.1 you need to be at version 4.1.18+ Then save an image with patch level 18 loaded; say you call it my-lispworks.exe. See the LispWorks Reference Manual for instructions on saving an image. You may like to add a shortcut to your new image on the Start menu. C. Create a new File Type from the Explorer's View > Options dialog associated with the lisp extension and give it an action called open that runs my-lispworks.exe -edit "%0". Instructions 1-5 in the example below describe how to do this. So far, so good: opening a '.lisp' file in the Explorer should launch a new instance of LispWorks and display the file. D. Now use DDE to make your running LispWorks image display the file you open. Load the example below and follow instructions 6-9. E. You may like to associate the LispWorks icon with .lisp files too; do this by View > Options > File Types > Edit > Change Icon in the Explorer. Windows 98 may do this automatically. ------------------------------------------------------------------------------ ;; -*- Mode: Lisp -*- ;;; ======================================================================== ;;; examples/dde/lispworks-ide.lisp ;;; ;;; This example demonstrates DDE support for Windows Explorer interaction ;;; with the LispWorks IDE. ;;; ;;; To try it, compile and load this file and then execute: ;;; ;;; (TEST-LISPWORKS-IDE-SERVER-LOOP) ;;; ;;; Alternatively, simply load this file in your .lispworks file ;;; or save an image with it loaded. ;;; ;;; Then configure the Windows Explorer to invoke DDE as follows: ;;; ;;; 1. Choose View->Options... from any explorer window. ;;; 2. Select the File Types tab and click the New Type button. ;;; 3. Enter Lisp Source File as the description and lisp as the ;;; associated extension. ;;; 4. Click New... in the Actions section. ;;; 5. Enter open as the action and lispworks-4450.exe -edit "%1" as the ;;; application used to perform the action (browse for ;;; lispworks-4450.exe if needed, choosing the correct name of your ;;; version of LispWorks). ;;; 6. Click on Use DDE and enter [open("%1")] as the message, LispWorks as ;;; the application and Editor as the topic. ;;; 7. Click OK on the New Action dialog. ;;; 8. Click Close on the Add New File Type dialog and the Options dialog. ;;; 9. Now locate a .lisp file in the explorer and double click on it. It ;;; should be opened in the LispWorks editor. ;;; ======================================================================== ;;; Copyright (c) 2000-05 LispWorks Ltd. All rights reserved. ;;; ======================================================================== (in-package "CL-USER") (eval-when (:compile-toplevel :load-toplevel :execute) (require "dde")) (win32:define-dde-server lispworks-ide-server () () (:service "LispWorks")) (win32:define-dde-dispatch-topic editor :server lispworks-ide-server) (win32:define-dde-server-function (open :topic editor) :execute ((filename string)) (let ((path (probe-file filename))) (when path (ed path) t))) (defun run-lispworks-ide-server-loop () "Starts the DDE server and runs its message loop." (win32:start-dde-server 'lispworks-ide-server) (loop (mp:wait-processing-events 1))) (defvar *lispworks-ide-server-process-info* '("DDE IDE Server" () run-lispworks-ide-server-loop)) (defun test-lispworks-ide-server-loop () "This is a test function." (apply 'mp:process-run-function *lispworks-ide-server-process-info*)) ;; Make the server run automatically when LispWorks starts. (pushnew *lispworks-ide-server-process-info* mp:*initial-processes* :test 'equal :key 'car) ------------------------------------------------------------------------------ | |
| See Also: Workaround: Patch:4.1.18 required | |
| Hardware:N/A | |
| Summary:Displaying Lisp files by double-clicking in Windows Explorer | |
| Bug#:7102 | |
| Patch Enhancement#: | |
| Reported: | |


