(just) emacs mode

221 views
Skip to first unread message

John V

unread,
Apr 27, 2011, 6:13:13 AM4/27/11
to Clojure
Hi, I would like to have syntax highlighting for Clojure code in
Emacs. I am using Emacs on Windows (23.2.1). I found this page:

http://dev.clojure.org/display/doc/Getting+Started+with+Emacs

... but it was clearly much more involved than I was looking for.
Nevertheless, I downloaded package.el, loaded it, set the location for
"marmalade", and gave it a shot, but as expected, it didn't work. It
said, "Failed to download 'gnu' archive."

I would like to use Emacs as a text editor, not as a combination IDE/
ftp browser. Is there a clojure mode written which is simple to
download and use?

I used ILISP for many years, and I've encountered SLIME when I was
using SBCL, but never got it working properly on Windows. I know how
cool and powerful an integrated environment like ILISP can be, but
also how buggy it can be, and at the moment, I just don't think it's
worth the effort to get it working. For now, I prefer to run Clojure
in a Command Prompt, and use Emacs solely as a text editor.

Thanks very much for any advice.

Sam Aaron

unread,
Apr 27, 2011, 8:16:54 AM4/27/11
to clo...@googlegroups.com
Hi John,

On 27 Apr 2011, at 11:13, John V wrote:

> Hi, I would like to have syntax highlighting for Clojure code in
> Emacs. I am using Emacs on Windows (23.2.1).

> <SNIP>


> I would like to use Emacs as a text editor, not as a combination IDE/
> ftp browser. Is there a clojure mode written which is simple to
> download and use?

A couple of good starting points are

* emacs-starter-kit: https://github.com/technomancy/emacs-starter-kit
* live coding emacs config: https://github.com/overtone/live-coding-emacs

I used the starter kit when I got started with emacs and found it very useful. As everyone should with emacs, I started modifying it to do the kinds of things I wanted and ended up with the live coding emacs config which is set up just the way I like it for Clojure coding with emacs.

You might find some inspiration looking at these.

Sam

---
http://sam.aaron.name


gaz jones

unread,
Apr 27, 2011, 8:17:49 AM4/27/11
to clo...@googlegroups.com
i highly recommend taking a look at Phil Hagelberg's emacs-starter-kit :

https://github.com/technomancy/emacs-starter-kit.git

it helped me a LOT when getting started with emacs in general, and
emacs and clojure together. i also put together a couple of blog posts
on my experience of using it which might be useful for you:

http://blog.gaz-jones.com/post/2486737162/setting-up-clojure-development-on-osx-using-emacs-and
http://blog.gaz-jones.com/post/2501842155/interactive-clojure-development-in-emacs-with-leiningen

gaz

> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@googlegroups.com
> Note that posts from new members are moderated - please be patient with your first post.
> To unsubscribe from this group, send email to
> clojure+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

Rasmus Svensson

unread,
Apr 27, 2011, 8:30:35 AM4/27/11
to clo...@googlegroups.com
2011/4/27 John V <johnv...@gmail.com>:

If you are only interested in the editing features, you just need
clojure-mode. You can get it directly at:

https://github.com/technomancy/clojure-mode

// raek

Rasmus Svensson

unread,
Apr 27, 2011, 8:51:23 AM4/27/11
to clo...@googlegroups.com
2011/4/27 John V <johnv...@gmail.com>:

> Hi, I would like to have syntax highlighting for Clojure code in
> Emacs.  I am using Emacs on Windows (23.2.1).  I found this page:
>
> http://dev.clojure.org/display/doc/Getting+Started+with+Emacs
>
> ... but it was clearly much more involved than I was looking for.
> Nevertheless, I downloaded package.el, loaded it, set the location for
> "marmalade", and gave it a shot, but as expected, it didn't work.  It
> said, "Failed to download 'gnu' archive."

I happened to have access to a computer running Windows 7 with exactly
that Emacs version, so I thought I'd try to investigate the error.
However, I could not reproduce it. For me, package.el was able to
access the GNU repo. Maybe this was a network issue?

One thing you could try (if you still are interested in using
package.el, that is) is to leave out the GNU repo, since it's not used
in the tutorial. The Marmalade repo, which supersedes the original
ELPA repo, should contain everything you need to follow the tutorial.

In the instructions you linked, replace this:

(add-to-list 'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/"))

with this:

(setq package-archives
'(("marmalade" . "http://marmalade-repo.org/packages/")))

I could add "editing-only" instructions to the Getting Started page
this evening. Do you have any comments regarding what they should
contain?

// raek

John V

unread,
Apr 27, 2011, 9:07:33 AM4/27/11
to Clojure


On Apr 27, 2:51 pm, Rasmus Svensson <r...@lysator.liu.se> wrote:
> I happened to have access to a computer running Windows 7 with exactly
> that Emacs version, so I thought I'd try to investigate the error.
> However, I could not reproduce it. For me, package.el was able to
> access the GNU repo. Maybe this was a network issue?

Yes, very likely. But, I don't want to debug the network issue. :)
(I'm using Windows XP, which could be relevant, but more likely it's a
problem with my proxy or some other network configuration issue.) I
can try again from home later on.

> One thing you could try (if you still are interested in using
> package.el, that is) is to leave out the GNU repo, since it's not used
> in the tutorial. The Marmalade repo, which supersedes the original
> ELPA repo, should contain everything you need to follow the tutorial.
>
> In the instructions you linked, replace this:
>
> (add-to-list 'package-archives
>              '("marmalade" . "http://marmalade-repo.org/packages/"))
>
> with this:
>
> (setq package-archives
>       '(("marmalade" . "http://marmalade-repo.org/packages/")))
>
> I could add "editing-only" instructions to the Getting Started page
> this evening. Do you have any comments regarding what they should
> contain?
>
> // raek

Thanks! Well, of course the URL (which, by the way, turned into:
https://github.com/technomancy/clojure-mode
..., redirected from the URL you supplied), with perhaps an
explanation of the four files, specifically clojure-test-mode.el. I'm
not sure, there is a delicate balance between writing enough for
beginners to follow, and being brief enough to not bore/annoy
experienced users. I would prefer to err on the case of too much
information, particularly since I suspect that emacs is the best way
to edit Clojure files. So, I would include info about using -*- in
the .clj file and how to modify the auto-mode-alist and enable or
disable fontifying the buffer.

I could take a swipe at writing something up if you like.

Roman Sykora

unread,
Apr 27, 2011, 2:09:06 PM4/27/11
to Clojure
Hi

Since you're working with XP, I can recommend Lisp Cabinet from
http://lispcabinet.sourceforge.net/ . It has a windows istaller and
works out of the box. An additional advantage may be the availability
of various lisp implementations parallel to clojure. Didn't get that
configured in several attempts before.

I saw on the website that there was an update, which I have not tried,
but used its predecessor a few month ago after I got frustrated with
manual installing emacs, slime, swank and whatnot and something didn't
work everytime. It was the best installation/configuration so far.
Since then I switched over to ubuntu, and I it seems that despite
emacsW32 on dos, emacs fits more naturally on a unix based system.
YMMV

Sincerely
Roman Syora

Phil Hagelberg

unread,
Apr 28, 2011, 12:23:14 AM4/28/11
to Clojure
On Apr 27, 6:07 am, John V <johnv02...@gmail.com> wrote:
> So, I would include info about using -*- in
> the .clj file and how to modify the auto-mode-alist and enable or
> disable fontifying the buffer.

This is the kind of thing that package.el does for you, (along with
autoloading and byte-compiling) which is why doing it manually is not
explained.

It's more awkward right now because package.el is not included in
Emacs 23, but once Emacs 24 is released, you won't have to install
package.el yourself.

-Phil

John V

unread,
Apr 28, 2011, 10:33:24 AM4/28/11
to Clojure


On Apr 28, 6:23 am, Phil Hagelberg <p...@hagelb.org> wrote:
> On Apr 27, 6:07 am, John V <johnv02...@gmail.com> wrote:
>
> > So, I would include info about using -*- in
> > the .clj file and how to modify the auto-mode-alist and enable or
> > disable fontifying the buffer.
>
> This is the kind of thing that package.el does for you, (along with
> autoloading and byte-compiling) which is why doing it manually is not
> explained.

Ah, ok. That could be handy. It is pretty awkward the old-fashioned
way. But how does it do it? By writing out files into .emacs
or .emacs.d?

> It's more awkward right now because package.el is not included in
> Emacs 23, but once Emacs 24 is released, you won't have to install
> package.el yourself.
>
> -Phil

OK, but that wasn't my issue. I did install package.el myself. The
problem was the functionality of package.el, not the installation.

There's definitely something to be said for a simple "do it all"
installation, but the details shouldn't be completely hidden. I'd
like to have the ability to understand what I'm downloading and what
the installation will change.

In any case, clojure-mode.el is working fine for me, so for now, I'm
happy. :) Thanks.
Reply all
Reply to author
Forward
0 new messages