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 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.
The recent version of Lisp Cabinet includes version 24 of GNU Emacs text editor with (currently extinct) EmacsW32 extension package. Although not everything from EmacsW32 works now, it still may be useful in several circumstances. Lisp Cabinet version 3.2 allows to install Emacs 23, which is perfectly integrated with EmacsW32 package. It's not recommended to install Lisp Cabinet at the write-protected system folders.
Lisp Cabinet installer will ask where do you want to store your personal settings and data. The following three options are available:
You can change the path of the home directory of non-portable Lisp Cabinet at any time through the submenu item named `Set Home Directory' at the top `((' menu. It's recommended to choose a path without spaces or non-ASCII characters for the Lisp Cabinet HOME. The current path to Lisp Cabinet HOME is available in `About Rho' buffer, under the Emacs `Help' menu.
In most cases you will most likely need only the `Basic Convenience Kit' package listed above and install other packages relevant to your needs manually.
Automated package installation is possible through the MELPA repository available with M-x list-packages command.
To install a package manually, you need to place it inside the `<Lisp Cabinet Home>/.emacs.d' directory (which is already added to the Emacs load path). There could be two kinds of extensions:
A quick glimpse at some advanced Emacs features and extensions.
When working on a large project with the huge amount of different files, shells and REPLs, it's often useful to open them in several Emacs buffers simultaneously, for example, as at the screenshot below. Such layout allows to get better overview and makes it possible to switch between the buffers quickly.
Emacs documentation section on windows explains in detail the commands you can use to split or resize them. Emacs 24+ also has a handy built-in M-x speedbar command, which allows to navigate at the current directory tree visually (by default it opens in a separate frame, the optional sr-speedbar mode of the `Additional Modes' package opens speedbar in a existing frame). The ido-mode may be used as a convenient keyboard-driven 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 bit clumsy.
If you prefer mouse, the tabbar mode (enabled by default) is a click away. 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 full-blown IDEs, such as Eclipse. Line numbering, symbol highlighting (green) and line width limiting "gutter" (blue) are 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 the relevant major modes, if `Basic Convenience Kit' option was 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 some other cases). Its advantages over the default iswitchb are: flexy completion (if you have buffers named `core.clj' and `core.cljs' you need to type only `crls' to narrow the selection), filtering, ability to switch between items with keyboard and automatic path expansion. With ido it's also possible to quickly jump to the root or home folders with simple keystrokes (`//' and `~/' respectively). The `Basic Convenience Kit' installer option makes this mode enabled by default.
YASnippet mode allows to insert predefined code templates
at the current point location with the ability
quickly switch between the internal template insertion points. To insert a template you need to type a template
abbreviation and press the expansion trigger keyboard shortcut (C-TAB in the case of Lisp Cabinet;
minor mode also should be active). For example, in a buffer with the `Clojure' major mode, type
The M-x lgrep and M-x rgrep Emacs commands do exactly this. It's also possible to use a little bit lower level M-x grep command. To replace a text in multiple files, use the dired query-replace-regexp function. There are more options which could be installed separately.
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. 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 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 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.
It's possible to install the following Lisp dialects with Lisp Cabinet:
|Lisp dialect||Version||Emacs mode||Works stable with SLIME||Dependency 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||SLIME5||Yes||Leiningen 26||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 the dependency management see the `Dependency Management' section below.
2 CLISP 2.49 contains a bug that prevents it to work with Emacs properly on Windows.
3 Will not work if path to the user's home directory contains spaces or non-ASCII characters.
4 You may place libraries you need in the command-line Clojure REPL into `<Lisp Cabinet Home>/clojure/lib' directory.
5 `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 the cause of a spontaneous 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.
6 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.
Any of the Lisp implementations could be upgraded or downgraded by replacing contents of its subfolder under the `<Lisp Cabinet Installation Directory>/bin' directory.
Hint: you can launch any installed Common Lisp implementation using M-- M-x slime <RET> implementation-name <RET> Emacs keyboard shortcut. Use the <TAB> key after the first <RET> 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> and answer 'No' to the following SLIME question. Clozure then will create additional thread in the current Lisp environment, and you could continue the work.
By using lispx-proxy you can easily launch Common Lisp, Clojure or Scheme files as scripts and create more complex application distributions.
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.
Emacs has ability to emulate command shell, which could be used to run Lisp implementations (by issuing the corresponding commands offered by Rho Shell) without overhead made by SLIME's Swank or Quicklisp. This may be useful when you want to reduce memory footprint of a generated program binary.
It is also possible to run any Lisp implementation out of Emacs using system-wide lispx-proxy. For example, you could run SBCL command-line REPL with the following command: lispx -i sbcl --repl issued in your regular Windows shell. 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, although the REPL or scripts could use any already installed ASDF-systems or Java/Clojure libraries from `<Lisp Cabinet Home>/clojure/lib'.
If necessary, Lisp Cabinet allows to install a local copy of Common Lisp HyperSpec and browse keyword documentation from SLIME using C-c C-d h keyboard shortcut.
There are several places which are considered by Lisp Cabinet as ASDF repositories:
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 (including the repositories inside lispx-proxy executable source distributions) by placing a file named `.noindex' into it.
Quicklisp is automatically preloaded for CL implementations with built-in ASDF2 or above (currently for all implementations included into Lisp Cabinet). It's immediately possible to use ql:apropos-system and ql:quickload functions (for details see the manual at Quicklisp home site).
WARNING: It's not possible to use the `jack-in' feature when a path to the Lisp Cabinet home directory contains spaces, because usage of paths with spaces is not provided in Leningen (this issue was fixed in Leiningen 2).>
WARNING: a Clojure Java process may remain in memory after the Emacs shutdown, because it has not been spawned by Emacs itself. Although Lisp Cabinet tries to work around this issue and close the process before the Emacs shutdown, be aware of this.
There is currently poor support of Scheme and Racket in Lisp Cabinet. For package management you can use the built-in Racket PLaneT facility according to the documentation. Lisp Cabinet brings nothing special in this case.
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 `((' menu group. It may be the first thing to do when something fails by no obvious reason.
|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.
The `LispCabinet' (or `CabinetEmacs') command is available through the system PATH 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' (or `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 can use all ASDF systems installed into Lisp Cabinet repositories, Clojure scripts may load libraries placed in the `<Lisp Cabinet Home>/clojure/lib' directory.
© 2010-2017 g/christensen (gchristnsngmail.com)