Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help me improve my Ultimate N00b SLIME/Emacs Cheat Sheet

588 views
Skip to first unread message

Peter Christensen

unread,
Feb 14, 2008, 12:10:39 PM2/14/08
to
In the spirit of my SLIME movie reference[1] and the positive feedback
I received[2], I've posted my Ultimate N00b SLIME/Emacs Cheat Sheet on
my website, with a little blurb about its strengths and weaknesses.
I've jokingly called it a "public beta", which basically means 1) it's
not done, and 2) I'd rather hear from experienced users what's useful
than wade through the Emacs manual looking for them. So, if you've
ever looked over the shoulder of a new Emacs user and cringed at the
way they do things, here's your chance to make the world a better
place!

http://www.pchristensen.com/blog/articles/public-beta-open-for-ultimate-n00b-slimeemacs-cheat-sheet/

Thanks,
Peter


[1] http://www.pchristensen.com/blog/articles/reference-for-the-slimelispemacs-screencast/
[2] http://groups.google.com/group/comp.lang.lisp/browse_frm/thread/dc401f785faaa808

Peter Hildebrandt

unread,
Feb 14, 2008, 2:58:36 PM2/14/08
to
Peter Christensen wrote:
> In the spirit of my SLIME movie reference[1] and the positive feedback
> I received[2], I've posted my Ultimate N00b SLIME/Emacs Cheat Sheet on
> my website, with a little blurb about its strengths and weaknesses.
> I've jokingly called it a "public beta", which basically means 1) it's
> not done, and 2) I'd rather hear from experienced users what's useful
> than wade through the Emacs manual looking for them. So, if you've
> ever looked over the shoulder of a new Emacs user and cringed at the
> way they do things, here's your chance to make the world a better
> place!
>
> http://www.pchristensen.com/blog/articles/public-beta-open-for-ultimate-n00b-slimeemacs-cheat-sheet/

Wow, that's pretty cool!

Personally, I use paredit for sexp based editing. I really like it, and
I think it is worthwhile for a beginner to learn how to operate it.

paredit can be downloaded here:

http://mumble.net/~campbell/emacs/paredit.el

The file goes into your site-lisp directory. Alternatively, install the
package for your distribution, eg. paredit-el for ubuntu.

I put the following in my .emacs
-----
(require 'paredit)
(autoload 'paredit-mode "paredit"
"Minor mode for pseudo-structurally editing Lisp code."
t)
(mapc (lambda (mode)
(let ((hook (intern (concat (symbol-name mode)
"-mode-hook"))))
(add-hook hook (lambda () (paredit-mode +1)))))
'(emacs-lisp lisp inferior-lisp))
-----

The key bindings are explained here:

http://mumble.net/~campbell/emacs/paredit.html

Peter

Adam

unread,
Feb 14, 2008, 3:06:13 PM2/14/08
to

Many thanks Peter.
As some of us on dial-up haven't seen the movie yet.

I should really download it elsewhere, and take a look.


Peter Christensen

unread,
Feb 14, 2008, 3:35:58 PM2/14/08
to

Thanks Adam, if you want to get a feel for how powerful the Slime/
Emacs combo can be, there's probably not a better way to spend an
hour. I'm a .NET guy by day so I'm used to Visual Studio, and I'd put
Emacs/Slime on the same shelf. Not the same graphical tools and
modern gui, but more features and more consistent operation. Plus,
the keyboard-centricity is great fun.

Adam

unread,
Feb 14, 2008, 5:27:25 PM2/14/08
to
Peter Christensen wrote:

> Thanks Adam, if you want to get a feel for how powerful the Slime/
> Emacs combo can be, there's probably not a better way to spend an
> hour. I'm a .NET guy by day so I'm used to Visual Studio, and I'd put
> Emacs/Slime on the same shelf. Not the same graphical tools and
> modern gui, but more features and more consistent operation. Plus,
> the keyboard-centricity is great fun.

Interesting, Pete. Almost suggests you're working in XP or NT,
but perhaps not.

I have emacs+slime on my Linux box, and it works great with my
restricted or constrained operation (the cheat-sheet will help),
but haven't taken the plunge with Emacs on my WinXP machine.

This was raised earlier in a thread of this group, but can I
ask what you recommend for Emacs (+ slime) for a machine with
a Win XP OS ? It would be with Common Lisp too down the track.
I think my options are either Emacs (+) under Cygwin, or Xemacs.
Just cautious before I take the plunge.


Peter Christensen

unread,
Feb 14, 2008, 6:00:08 PM2/14/08
to

You caught me. I have a box setup with Ubuntu but learning Linux,
Lisp, SLIME, and Emacs all at once was too much so I've stuck with XP
for now. I use Lisp in a Box, whatever version is linked to from the
Practical Common Lisp page[1]. I don't know if it is different from
the sourceforge page[2] and right now, I'm not interested in
learning. I'll deal with the minutiae of setup, configuration,
versions, etc later. I've got coding to do in the meantime. Lispbox
on Windows works just fine, no issues, no hangups at all. Well, M-TAB
doesn't work for completion and I have to find a good alternate key
binding, but other than that it's great!

Right now I'm using SLIME functions much more than Lisp functions, so
all of the Emacs stuff I use it pretty basic and standard and I don't
think the version would make a difference for me.

-Peter

[1] http://www.gigamonkeys.com/lispbox/
[2] http://common-lisp.net/project/lispbox/

John Thingstad

unread,
Feb 14, 2008, 6:27:12 PM2/14/08
to
På Fri, 15 Feb 2008 00:00:08 +0100, skrev Peter Christensen
<peter.t.c...@gmail.com>:

> on Windows works just fine, no issues, no hangups at all. Well, M-TAB
> doesn't work for completion and I have to find a good alternate key
> binding, but other than that it's great!

TAB itself is pretty useless when editing Lisp. So I just bind
fuzzy-complete to that.

--------------
John Thingstad

John Thingstad

unread,
Feb 14, 2008, 6:52:43 PM2/14/08
to
På Fri, 15 Feb 2008 00:27:12 +0100, skrev John Thingstad
<jpt...@online.no>:

Correction. It is set up to be context sensitive. It fuzzy completes OR
indents lines depending on the position of the cursor.


--------------
John Thingstad

Thomas Elam

unread,
Feb 14, 2008, 7:04:57 PM2/14/08
to
On Feb 14, 10:10 pm, Peter Christensen <peter.t.christen...@gmail.com>
wrote:

> In the spirit of my SLIME movie reference[1] and the positive feedback
> I received[2], I've posted my Ultimate N00b SLIME/Emacs Cheat Sheet on
> my website, with a little blurb about its strengths and weaknesses.
> I've jokingly called it a "public beta", which basically means 1) it's
> not done, and 2) I'd rather hear from experienced users what's useful
> than wade through the Emacs manual looking for them. So, if you've
> ever looked over the shoulder of a new Emacs user and cringed at the
> way they do things, here's your chance to make the world a better
> place!
>
> http://www.pchristensen.com/blog/articles/public-beta-open-for-ultima...
>
> Thanks,
> Peter
>
> [1]http://www.pchristensen.com/blog/articles/reference-for-the-slimelisp...
> [2]http://groups.google.com/group/comp.lang.lisp/browse_frm/thread/dc401...


Peter,

Thanks a lot! I definitely need this kind of thing!

Regards,
Tom

Victor Kryukov

unread,
Feb 14, 2008, 7:20:30 PM2/14/08
to
"John Thingstad" <jpt...@online.no> writes:

>> TAB itself is pretty useless when editing Lisp. So I just bind
>> fuzzy-complete to that.
>
> Correction. It is set up to be context sensitive. It fuzzy completes
> OR indents lines depending on the position of the cursor.

Now, that sounds interesting! I once binded it to fuzzy complete
unconditionally, but then decided to remap it to Ctrl-Tab is I like
indentation feature as well. Could you share this bit of Emacs magic
with us?

Regards,
Victor.

--
http://macrodefinition.blogspot.com

Edi Weitz

unread,
Feb 14, 2008, 7:30:00 PM2/14/08
to
On Thu, 14 Feb 2008 18:20:30 -0600, Victor Kryukov <victor....@gmail.com> wrote:

> Now, that sounds interesting! I once binded it to fuzzy complete
> unconditionally, but then decided to remap it to Ctrl-Tab is I like
> indentation feature as well. Could you share this bit of Emacs magic
> with us?

There's no magic involved. The function you want is called
`slime-indent-and-complete-symbol' and has been in SLIME since 2004 or
so.

Edi.

--

European Common Lisp Meeting, Amsterdam, April 19/20, 2008

http://weitz.de/eclm2008/

Real email: (replace (subseq "spam...@agharta.de" 5) "edi")

Ken Tilton

unread,
Feb 14, 2008, 8:28:14 PM2/14/08
to

Edi Weitz wrote:
> On Thu, 14 Feb 2008 18:20:30 -0600, Victor Kryukov <victor....@gmail.com> wrote:
>
>
>>Now, that sounds interesting! I once binded it to fuzzy complete
>>unconditionally, but then decided to remap it to Ctrl-Tab is I like
>>indentation feature as well. Could you share this bit of Emacs magic
>>with us?
>
>
> There's no magic involved. The function you want is called
> `slime-indent-and-complete-symbol' and has been in SLIME since 2004 or
> so.

How's Arcslime coming along?

kenny

--
http://smuglispweeny.blogspot.com/
http://www.theoryyalgebra.com/

"In the morning, hear the Way;
in the evening, die content!"
-- Confucius

vtail

unread,
Feb 15, 2008, 1:40:25 AM2/15/08
to
On Feb 14, 6:30 pm, Edi Weitz <spamt...@agharta.de> wrote:

> On Thu, 14 Feb 2008 18:20:30 -0600, Victor Kryukov <victor.kryu...@gmail.com> wrote:
> > Now, that sounds interesting! I once binded it to fuzzy complete
> > unconditionally, but then decided to remap it to Ctrl-Tab is I like
> > indentation feature as well. Could you share this bit of Emacs magic
> > with us?
>
> There's no magic involved.  The function you want is called
> `slime-indent-and-complete-symbol' and has been in SLIME since 2004 or
> so.

Thanks a lot, Edi - somehow I missed this beauty.

Regards,
Victor.

Robert Uhl

unread,
Feb 16, 2008, 12:38:15 AM2/16/08
to
Peter Christensen <peter.t.c...@gmail.com> writes:

> Lispbox on Windows works just fine, no issues, no hangups at all.
> Well, M-TAB doesn't work for completion and I have to find a good
> alternate key binding, but other than that it's great!

ESC-TAB will do the same job (ALT & ESC do the same thing in emacs). Of
course, the real long-term solution is to bind right-alt to SUPER and
then bind SUPER-TAB to frame switching.

This is made rather easier in a Unix desktop environment.

--
Robert Uhl <http://public.xdi.org/=ruhl>
12 is the smallest abundant number. A number is abundant if the sum of
all the divisors except the number itself is larger than the number.
(1+2+3+4+6=16>12)

Mirko....@gmail.com

unread,
Feb 16, 2008, 9:02:52 AM2/16/08
to

First, many thanks to Peter for his cheat sheet.

Second, here is my emacs+lisp+slime setup on windows XP (both desktop
and laptop)

Although I started my lisp adventures with on Windows XP with lisp-in-
a-box, I switched to the standard emacs distribution because I wanted
to use the latest official emacs. This is my setup:

- emacs: standard windows binary
- clisp: I have cygwin installed, and clisp comes with it (tried
compiling sbcl into cygwin, but that failed. Greater minds than mine
have also failed).
- slime: standard distribution.

My .emacs slime setting is standard slime setup (a bit convolved
because I have a helper function (local-setting) to return the
appropriate values for desktop/laptop):

(setq inferior-lisp-program (concat
(local-setting 'cygwin-root)
(local-setting 'cygwin-clisp)))
(add-to-list 'load-path (local-setting 'slime))
(require 'slime)
(slime-setup)

Here are the values that I set the inferior-lisp-program and load-path
that emacs understands:

inferior-lisp-program: "c:/cygwin-root/bin/clisp.exe"
load-path has the following for slime: "c:/slime-2.0"

hth,

Mirko

Mirko....@gmail.com

unread,
Feb 16, 2008, 10:21:01 AM2/16/08
to

To clarify a bit,

- cygwin installs a unix like directory tree (/). In my example that
tree is in c:\cygwin-root. But under cygwin, one refers to it as /
- slime is installed in c:\slime-2.0
- it is OK in emacs to substitute the back-slashes from windows path
names into forward slashes (and removes the need to escape the
backslash with another backslash).

Mirko

John Thingstad

unread,
Feb 16, 2008, 1:27:20 PM2/16/08
to
På Sat, 16 Feb 2008 15:02:52 +0100, skrev <Mirko....@gmail.com>:

>
> inferior-lisp-program: "c:/cygwin-root/bin/clisp.exe"
> load-path has the following for slime: "c:/slime-2.0"
>

That is a strange place for SLIME to be.
EMACS usually assumes additions to be placed under "emacsroot"/site-lisp
So I would use "emacsroot"/site-lisp/slime-2.0. No biggie but things are
easier to find if you follow the usual convention. For instance auctex, a
advanced LaTeX mode, installs itself there.
In cygwin "emacsroot" for data would be /usr/share/data/emacs
(Also if you want it to work under several users place the loading code in
"emacsroot"/site-lisp/site-init.el instead of .emacs)

--------------
John Thingstad

Edward

unread,
Feb 16, 2008, 2:49:11 PM2/16/08
to
On Feb 14, 10:10 am, Peter Christensen <peter.t.christen...@gmail.com>
wrote:

> In the spirit of my SLIME movie reference[1] and the positive feedback
> I received[2], I've posted my Ultimate N00b SLIME/Emacs Cheat Sheet on
> my website, with a little blurb about its strengths and weaknesses.
> I've jokingly called it a "public beta", which basically means 1) it's

<snip>

Don't forget the cheat sheet at cliki:

http://www.cliki.net/SLIME%20Features

Edward

Mirko....@gmail.com

unread,
Feb 16, 2008, 3:01:32 PM2/16/08
to
On Feb 16, 1:27 pm, "John Thingstad" <jpth...@online.no> wrote:

Admittedly, it is strange, and in this particular case is a leftover
of my experiments as I figured out how to make it work. Once it
started working, I just left it there. When I move to a new laptop (a
few years down the road, considering the budgetary constraints these
days), I will put it in a more sensible place.

otoh, I was not sure whether the right place for it is the emacs lisp
library, or a general lisp library, since the package contains both
types of lisps. On my other machines, I keep it under a /user/local/
lib directory -- or something like that (I am not fully familiar with
linux folder usage conventions).


Mirko

Maciej Katafiasz

unread,
Feb 16, 2008, 5:06:05 PM2/16/08
to
Den Thu, 14 Feb 2008 09:10:39 -0800 skrev Peter Christensen:

> So, if you've
> ever looked over the shoulder of a new Emacs user and cringed at the way
> they do things, here's your chance to make the world a better place!

I have to pimp CUA-mode.el here. It comes in the standard distribution of
GNU Emacs 22, and features awesome CUA clipboard support together with
better versions of pc-selection-mode and delete-region-mode, as well as
an absolutely superior visual rectangle mark mode. CUA-mode should be
especially valuable for newbies, as it lets you use the clipboard model
familiar from Windows/MacOS/GNOME/KDE (although I don't consider myself
a newbie and I still prefer it over the stock Emacs clipboard/region
handling). A couple of remarks:

1) I do NOT use the C-{x,c,v} bindings. They're stupid and inconvenient,
and aren't even CUA keys, despite the widespread misconception.

2) I do use, however, the actual CUA clipboard keys, that is C-<insert>,
S-<insert>, S-<delete>, for a variety of reasons, like the fact I can use
the same keys in just about every other GUI programme (and a couple of
non-GUI ones), and that it's the most convenient bindings set, much less
straining than any of the alternatives.

3) A must-try is CUA-mode's visual rectangle mark support. It's
absolutely rocktastic, and has truckloads of goodies. Read the docs!

4) For best results, inform CUA-mode about additional movement commands
you want to be treated the same as the standard ones (ie. mark with Shift,
deactivate mark otherwise). For instance:

(put 'c-backward-into-nomenclature 'CUA 'move)
(put 'c-forward-into-nomenclature 'CUA 'move)

5) Default keybindings of paredit conflict with those of CUA-mode, you
need to put some code in your .emacs to agree them. For me the list
is somewhat longer, as I have other commands I don't want paredit to
remap, in particular, I have sexp navigation bound to C-A-cursors. I
have commented out keys that aren't directly used by CUA:

========================BEGIN SNIPPET===============================

(defun check-region-parens ()
"Check if parentheses in the region are balanced. Signals a
scan-error if not."
(interactive)
(save-restriction
(save-excursion
(let ((deactivate-mark nil))
(condition-case c
(progn
(narrow-to-region (region-beginning) (region-end))
(goto-char (point-min))
(while (/= 0 (- (point)
(forward-list))))
t)
(scan-error (signal 'scan-error '("Region parentheses not balanced"))))))))

(defun paredit-backward-maybe-delete-region ()
(interactive)
(if mark-active
(progn
(check-region-parens)
(cua-delete-region))
(paredit-backward-delete)))

(defun paredit-forward-maybe-delete-region ()
(interactive)
(if mark-active
(progn
(check-region-parens)
(cua-delete-region))
(paredit-forward-delete)))

;; Change the path to where you have paredit.el
(load-file "~/elisp/paredit.el")
;; Unbind some of the keys paredit binds by default that conflict with CUA
(eval-after-load "~/elisp/paredit.el"
'(let ((map paredit-mode-map))
(mapcar (lambda (key)
(define-key map (read-kbd-macro key) nil))
(list
;; Choose which of standard paredit keys you don't want to bind
;; "C-M-p"
;; "C-M-n"
;; "M-<up>"
;; "M-<down>"
"C-<right>"
"C-<left>"
;; "C-M-<left>"
;; "C-M-<right>"))
;; Make <backspace> and <delete> delete region in paredit-mode too.
;; You can only delete balanced regions, however.
(define-key map (read-kbd-macro "<delete>") 'paredit-forward-maybe-delete-region)
(define-key map (read-kbd-macro "DEL") 'paredit-backward-maybe-delete-region)))

==========================END SNIPPET================================

I'd also recommend windmove.el, a package that allows directional
window switching instead of C-x o. It's a must-have for any kind of
efficient window navigation in Emacs.

Cheers,
Maciej

David Golden

unread,
Feb 17, 2008, 12:46:44 AM2/17/08
to
Maciej Katafiasz wrote:

> CUA-mode should be especially valuable for newbies, as it lets you
> use the clipboard model familiar from Windows/MacOS/GNOME/KDE

cua-mode is only part of the puzzle for GNOME/KDE (i.e. on X desktops)
due to the way emacs deals with "X selections". There's a
thread "Improving X selection?" currently on emacs-devel list about
addressing that.


Maciej Katafiasz

unread,
Feb 17, 2008, 4:52:26 AM2/17/08
to

That's true, but I'm actually pretty happy with the non-conformant
behaviour of Emacs. As long as it's the only app to be broken, it's
surprisingly useful. I've recently tried (setq x-select-enable-clipboard
t), but I decided it's even more broken than having it nil, so I went
back to the quirky defaults.

Cheers,
Maciej

David Golden

unread,
Feb 17, 2008, 11:38:15 AM2/17/08
to
Maciej Katafiasz wrote:


> I've recently tried (setq
> x-select-enable-clipboard t), but I decided it's even more broken than
> having it nil, so I went back to the quirky defaults.
>

Indeed. However, if you apply the experimental patch at end of [1] (and
then erratum at [2]) to recent emacs cvs head, and the settings at the
end of the mail at [1], emacs can be made to conform (evil laugh). You
might also want the patch at [3] which improves right-click behaviour
(set it to nil or :double to "fit in" with the settings in [1]).

That patch plus CUA mode means emacs pretty much perfectly imitates
freedesktop.org comforming behaviour on X. Even without the patch, but
with certain new customisations in emacs cvs, you can get pretty close.
I dunno whether the emacs gods will ever integrate the patch or
something like it (it's rather invasive), but anyway, I've demonstrated
it's technically possible.

[1] http://lists.gnu.org/archive/html/emacs-devel/2008-02/msg01403.html
[2] http://lists.gnu.org/archive/html/emacs-devel/2008-02/msg01406.html
[3] http://lists.gnu.org/archive/html/emacs-devel/2008-02/msg01018.html

Adam

unread,
Feb 19, 2008, 4:26:10 AM2/19/08
to

> To clarify a bit,
>
> - cygwin installs a unix like directory tree (/). In my example that
> tree is in c:\cygwin-root. But under cygwin, one refers to it as /
> - slime is installed in c:\slime-2.0
> - it is OK in emacs to substitute the back-slashes from windows path
> names into forward slashes (and removes the need to escape the
> backslash with another backslash).
>
> Mirko


Thanks, M.

Ads.


0 new messages