Lisp Cabinet is a set of configuration files, tools and utilites bundled with automated installer to deliver full-fledged Emacs based Lisp development environment for Microsoft Windows.
Lisp Cabinet was created in order to compensate restrictions of the Lispbox and provide modular development environment comparable by features with Linux/Unix counterparts. In addition, Lisp Cabinet tries to eliminate need for manual configuration of its underlying components, so you can download it and start work immediately.
If you don't need any of the Lisp tools, but need a Windows-friendly Emacs distribution as a base for your own Emacs environment, consider the Cabinet Emacs installer, which does not install any Lisp related components and offers an isolated Emacs home environment, a few essential GNU utilities (such as archivers and grep/find), spell checking, some boilerplate customizations and optionally a C/C++ compiler accessible from Emacs.
WARNING: LispCabinet currently uses a little bit outdated technology and probably will not be updated in foreseeable future. The most of the tools could be upgraded manually after the installation, but if you are searching for an IDE for Clojure, see CCW or Cursive
¤ GNU Emacs ¤
Lisp Cabinet includes version 24 of GNU Emacs text editor with EmacsW32 extensions. To make your Emacs custom settings and adjustments permanent (a color theme, for example), place the corresponding elisp code (a call of the color theme function in the case of color theme) into the .emacs file in the Lisp Cabinet home directory which you selected during the installation. A current path to the Lisp Cabinet home directory is available in the `About Lisp Cabinet' buffer, under the Emacs `Help' menu.
¤ Basic Convenience Kit ¤
Basic Convenience Kit is a set of additional modes and settings included in a Emacs installation to make editing more convenient. Basic Convenience Kit consists of:
Note that EmacsW32 comes with nXhtml mode, and you can enable it in EmacsW32 customization group (M-x emacsw32-custom-start).
¤ Additional Modes (optional) ¤
See the `An Approach to Productivity' section.
¤ Lisp Implementations ¤
It's possible to install the following Lisp implementations with Lisp Cabinet:
|Lisp implementation||Version||Emacs extension||Works stable with SLIME||Package management1||Multithreading||Requirements|
|ABCL||1.1.1||SLIME||Yes||Quicklisp||Java||JDK 1.5 or higher|
|ECL3||12.7.1||SLIME||Windows XP only||Quicklisp||Native||MinGW|
|Clojure4||1.5.15||SLIME6||Yes||Leiningen 27||Java||JDK 1.5 or higher|
1 All Common Lisp implementations use the same ASDF repository, so Lisp that does not support ASDF-INSTALL or Quicklisp could load systems installed by Lisp implementation which supports these features. For detailed information about package management see `Package Management' section below.
2 ASDF-INSTALL is also available. Because Quicklisp has been updated, you might need to completely remove the `<Lisp Cabinet Home>\lisp\quicklisp' directory if it doesn't load systems from the net.
3 Will not work if path to the user's home directory contains spaces or non-ASCII characters.
4 ClojureScript is also available. For details see the `Running ClojureScript' section. 5 You may place libraries you need in the command-line Clojure REPL into `<Lisp Cabinet Home>/clojure/lib' directory. 6 `Emacs (Clojure open project)' and `Emacs (Legacy SLIME)' Windows shortcuts use an old version of SLIME which is congruent with Swank-Clojure communication protocol. In other cases (launch from the Emacs menu or the M-x slime command) Clojure will use the latest installed version of SLIME (with `Autodoc' mode turned off). The `Autodoc' minor mode may be a cause of a spontanious disconnection, you may try to connect back with the `M-x slime-connect' command if you know the port, which usually could be found at the `*swank*' buffer.
7 By default Lisp Cabinet uses Leiningen 2 which is available through the Emacs Command Shell (you can use `lein' command as usual). It's also possible to load configured Leiningen projects with SLIME using Leiningen `jack-in' feature with the M-x clojure-jack-in Emacs command or the corresponding Windows shortcut (see the section on package management for details). Leiningen 1.7.1 is available through the `lein1' command-line command.
Most of the Lisp implementations could be upgraded (except CLISP 2.49 which contains a bug that prevents it to work with Emacs properly on Windows) or downgraded by replacing contents of the tool folder under the `<Lisp Cabinet Installation Directory>/bin' path.
¤ Additional Tools and Languages (optional) ¤
|Python||2.7.2||pywin32, Pymacs, Rope1, easy_install|
|Python||3.2.2||pywin32, Pymacs, easy_install|
|MinGW2||4.7.0 (gcc)||zlib 1.2.6, Boost3 1.50 (precompiled), MSYS Developer Toolkit|
|JDK||7.0||Java Runtime Environment|
1 Optional, ropemacs global prefix is changed to `C-x /' to avoid conflict with Bookmark+. May interfere with the auto complete mode in Emacs 24 (use of rope-code-assist is recommended instead of the auto complete mode).
2 Contains such tools as `make', `perl' and other common GNU utilites besides the C++ compiler.
¤ SLIME ¤
Hint: you can launch any installed Common Lisp implementation using M-- M-x slime <RET> implementation-name <RET> Emacs keyboard shortcut. Use <TAB> key after the first hit on Return to list available implementation names.
Important: what to do if a SLIME REPL evaluation request freezes? If you are running a multithreaded Lisp, you can save the existing Lisp environment by recurrent connection to the corresponding Lisp process. To accomplish this, use the M-x slime-connect command or simply command from the previous paragraph. For example, if you are running Clozure CL, type M-- M-x slime <RET> ccl <RET> (actually it's only necessary to type M-x slime when you use ccl) and answer 'No' to the following SLIME question. Clozure then will create additional thread in the current Lisp environment, and you could continue to work.
`Emacs (Legacy SLIME)' Windows shortcut launches Emacs with legacy SLIME (from 2009-10-15) loaded. This SLIME version may be used to connect to a standalone swank-clojure server with the `slime-connect' command or to interact with Clojure avoiding troubles related to the autodoc mode.
¤ Open SSL ¤
Open SSL is required by CL+SSL and by libraries which use CL+SSL (e.g. drakma or hunchentoot).
¤ Common Lisp HyperSpec ¤
You can also install local copy of Common Lisp HyperSpec and browse keyword documentation from SLIME using C-c C-d h keyboard shortcut.
¤ lispx-proxy ¤
With lispx-proxy you can easily launch Common Lisp, Clojure or Scheme files as scripts and create more complex application distributions. For further info, please visit lispx-proxy home page.
lispx-proxy is fully integrated into Lisp Cabinet, and you could use all installed Common Lisp implementations and all Lisp Cabinet ASDF repositories while executing Common Lisp code. Lisp Cabinet knows about lispx-proxy `executable source code distribution' structure, and all ASDF systems and resources from the `shared' folder of a distribution will be available to the inferior Lisp (the distribution should be placed into one of the Lisp Cabinet ASDF repositories). In other words, you can easily develop lispx-proxy applications with Lisp Cabinet.
¤ Quicklisp ¤
Quicklisp is a yet another package management tool, more advanced than ASDF-INSTALL. For the information about how to use Quicklisp see `Package management' section below.
Emacs has ability to emulate command shell, which could be used to run Lisp implementations without overhead made by Swank or ASDF-INSTALL. This may be useful when you want to reduce memory footprint of a generated program binary.
It is possible to run any Lisp implementation out of Emacs using lispx-proxy. For example, you could run SBCL command-line REPL with the following command: lispx -i sbcl --repl. To run Clojure REPL type lispx -l clojure --repl in your command prompt. Common Lisp package management systems are not automatically available with this scenario.
Lisp Cabinet installer will ask you where do you want to store personal settings and data. There are three options available:
You can change path of the home directory used by Lisp Cabinet at any time through menu item named `Set Home Directory' in the menu bar `((' menu (administrator privileges are required). But it's better not to do this when using portable Lisp Cabinet. It's recommended to choose a path without spaces or non-ASCII characters for the Lisp Cabinet home directory.
Common Lisp implementations included in Lisp Cabinet use ASDF2 translation facility to manage location of compiled fasl files. By default, compiled files are placed into `.fasl-cache' subfolder of the Lisp Cabinet home directory. Fasl cache could be cleaned with `Clear Fasl Cache' menu item under the `Lisp Cabinet' menu group. It may be the first thing to do when something fails by no obvious reason.
There are several places which are considered as ASDF/Code repositories by Lisp Cabinet:
where <LISP_CABINET_DIR> is a Lisp Cabinet installation directory, and <HOME> is a Lisp Cabinet home directory. It's necessary to place directories with ASDF systems in one of these folders to make them accessible by ASDF. In addition, you can store Leiningen Clojure projects in <HOME>\clojure directory (it has no special meaning for Leiningen).
It's possible to disable any ASDF repository by placing a file named `.noindex' into it (including repositories inside lispx-proxy executable source distributions).
There are two package management systems both automatically available for the Common Lisp implementations: ASDF-INSTALL and Quicklisp.
ASDF-INSTALL is automatically preloaded for CL implementations in which it's supported (see the implementation table above). To install a system with ASDF-INSTALL simply call (asdf-install:install "system-name") function from the REPL. ASDF-INSTALL installs systems to a common ASDF repository visible by any Common Lisp implementation.
Quicklisp is automatically preloaded for CL implementations with built-in ASDF2 (currently all the implementations included into Lisp Cabinet). After Quicklisp is loaded, it's possible to use ql:apropos-system and ql:quickload functions (for details see the manual at Quicklisp home site).
There are some quirks when using the `jack-in' feature with Leiningen 1.x:
There is currently poor support of Scheme and Racket in Lisp Cabinet. For package management you can use built-in Racket PLaneT facility according to the documentation. Lisp Cabinet brings nothing special in this case.
Automatic ClojureScript compilation is possible with the Leiningen plugin. To compile ClojureScript files manually you could use the following two commands (which are actually the renamed `repl' and `repljs' commands from the ClojureScript distribution) in the Emacs command shell:
Read ClojureScript docs for more information.
A quick glimpse at some advanced Emacs features and extensions.
When working on a large project with huge amount of different files, shells and REPLs, it's often useful to open them in several Emacs windows simultaneously, for example, as at the screenshot below, to use shorter Emacs commmands or mouse to switch between the windows and for better overview.
To do this, you may need to use Emacs window split or resize commands. The Emacs documentation section on windows explains these commands in detail. Emacs 24 also has handy built-in M-x speedbar to manage directory trees visually (by default it opens in a separate frame, the preinstalled sr-speedbar mode allows to open the speedbar in a existing frame). The ido-mode (see below) may be used as a more convenient alternative for speedbar. It's also possible to save a current window configuration with winsav save mode (could be enabled in winsav customization group - M-x customize-group winsav), although it works a little clumsy.
If you prefer mouse, the tabbar mode (enabled by default) is also comes useful. But it has one not so obvious feature - the ability to switch between buffer mode window collections with mouse wheel. Move the mouse cursor over the tab bar at the top of a window and scroll the mouse wheel, the tabbar mode will switch window collections as you scroll.
highlight-symbol, highlight-80+ and linum modes bring some cosmetic features to Emacs, which usually could be found only in advanced IDEs such as Eclipse: line numbering, symbol highlighting (green) and line width limiting "gutter" (blue), as shown at the screenshot below. The symbol highlighting operations are bound to C-f3, M-f3 and S-f3 keys (all these features will be available automatically with some buffer modes, if `Additional Modes' installer option is checked during the installation). The linum mode may work ungraceful with the auto complete mode.
The ido-mode could be described as the iswitchb mode on steroids (it also works with find-file and in some other cases). The advantages over the iswitchb mode are: flexy completion (for example, if you have buffers named `core.clj' and `core.cljs' you need to type only `crjs' to select the second), filtering, ability to switch between items with keyboard and better path support in find-file mode by comparison to the standard find-file, it's also possible to quickly jump to the root or home folder with simple keystrokes (`//' and `~/' respectively). The `Additional modes' installer option makes this mode enabled by default.
Anything mode provides a command interface to some Emacs features like the Quicksilver or Enso Launcher applications. It has wast amount of commands worth to explore, but M-x anything-imenu and M-x anything-show-kill-ring are probably among the most useful ones.
YASnippet mode is a yet another feature which could be found only in advanced IDEs, it allows to insert predefined code templates with ability to quickly switch between the template insertion points. To insert a template you need to type a template abbreviation (key) and press the expansion trigger keyboard shortcut (C-TAB in the case of Lisp Cabinet, `yas' minor mode also should be active). For example, being in a buffer with the `Clojure' major mode, type `kwargs' and press C-TAB - the abbreviation will be expanded into a keyword arguments destructuring template with two insertion points (you can switch between them with the TAB key). You can find which abbreviation is mapped to a snippet (if it's not obvious) by visiting its file with `C-c & C-v' sequence (the `&' key here should be pressed on the keyboard).
The M-x lgrep and M-x rgrep Emacs commands do exactly this (it's also possible to use the low level M-x grep command itself, these commands work flawlessly in Emacs 24 only). To replace a text in multiple files, use the dired query-replace-regexp command. There are more options which could be installed separately. M-x occur also may come useful.
Emacs has built-in support of some common version control systems. Third party VC extensions are also available. Note that you need to place your ssh keys and other personal VC settings into the Lisp Cabinet home directory to use VC from Emacs.
Because SLIME is an advanced IDE by itself, there is no need in such monster things as CEDET or ECB here (already mentioned anything-mode could probably replace some capabilities of the ECB). But it would be nice to have a project management system in the sense of Visual Studio `solutions'. Although not obvious, it's possible in vanilla Emacs with M-x desktop-save and M-x desktop-change-dir commands (it's necessary to save a desktop file in the project root directory). But there is a better third party solution exist: Bookmark+ desktop bookmarks. For example, there is a project directory tree with root in the ~/lisp/development/my-app directory and you are editing its files. To add a bookmark to the current desktop, you need to issue the following commands:
The C-x r l (and also M-x anything-bookmarks) command allows to list all bookmarks and quickly switch between saved project desktops, it's also possible to clear the current desktop with M-x desktop-clear command.
The `lispcabinet' (or `cabinetemacs' in the case of a Cabinet Emacs distribution) command is available through the system PATH variable and could be used to open files from the command line or to use Emacs as an external editor in some applications (this could be useful with panel file managers such as FAR Manager or, for example, Firefox It's all text addon). The `lispcabinet' (`cabinetemacs') command accepts only one file argument, though.
The `lispx' command is also available at the command prompt and could be used for Lisp scripting. Common Lisp scripts could use all ASDF systems from the Lisp Cabinet repositories, Clojure scripts may use libraries placed in the `<Lisp Cabinet Home>/clojure/lib' directory.
© 2010-2013 g/christensen (gchristnsngmail.com)